Jenkins service is being disabled

Jenkins setup:

We have installed jenkins in a windows remote server hosted in Azure cloud and running the service as a LocalSystem. We have a previous instance of jenkins and we took a backup using the thin backup plugin. and after installing the service we restored the backup. It all went well but after a couple of hours the service is being disabled. like in windows services window it showing like below screenshot

checked the logs and all but couldn’t figure out anything. we tried without backing up like only installing the application but the same result. it is being disabled.

we are running Jenkins Version 2.448

adding the logs here. please help us in figuring out the issue

Jenkins wrapper log

2024-04-02 08:14:55,214 DEBUG - Starting WinSW in the service mode
2024-04-02 08:14:55,232 INFO - Starting C:\Program Files\OpenLogic\jdk-17.0.10.7-hotspot\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar “C:\Jenkins\jenkins.war” --httpPort=8000 --webroot=“C:\ProgramData\Jenkins\war”
2024-04-02 08:14:55,239 INFO - Extension loaded: killOnStartup
2024-04-02 08:14:55,241 WARN - The requested PID file ‘C:\ProgramData\Jenkins\jenkins.pid’ does not exist. The runaway process won’t be checked
2024-04-02 08:14:55,273 INFO - Started process 10600
2024-04-02 08:14:55,277 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender
2024-04-02 08:14:55,282 INFO - Recording PID of the started process:10600. PID file destination is C:\ProgramData\Jenkins\jenkins.pid
2024-04-02 08:14:55,284 ERROR - Cannot update the PID file C:\ProgramData\Jenkins\jenkins.pid
System.IO.DirectoryNotFoundException: Could not find a part of the path ‘C:\ProgramData\Jenkins\jenkins.pid’.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
at winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension.OnProcessStarted(Process process)
2024-04-02 08:15:30,948 INFO - Stopping jenkins
2024-04-02 08:15:30,948 DEBUG - ProcessKill 10600
2024-04-02 08:15:31,019 INFO - Found child process: 9240 Name: conhost.exe
2024-04-02 08:15:31,040 INFO - Stopping process 9240
2024-04-02 08:15:31,042 INFO - Send SIGINT 9240
2024-04-02 08:15:31,043 WARN - SIGINT to 9240 failed - Killing as fallback
2024-04-02 08:15:31,044 INFO - Stopping process 10600
2024-04-02 08:15:31,046 INFO - Send SIGINT 10600
2024-04-02 08:15:31,046 WARN - SIGINT to 10600 failed - Killing as fallback
2024-04-02 08:15:31,048 INFO - Finished jenkins
2024-04-02 08:15:31,049 DEBUG - Completed. Exit code is 0
2024-04-02 08:18:23,367 DEBUG - Starting WinSW in the service mode
2024-04-02 08:18:23,398 INFO - Starting C:\Program Files\OpenLogic\jdk-17.0.10.7-hotspot\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar “C:\Jenkins\jenkins.war” --httpPort=8000 --webroot=“C:\ProgramData\Jenkins\war”
2024-04-02 08:18:23,398 INFO - Extension loaded: killOnStartup
2024-04-02 08:18:23,398 WARN - The requested PID file ‘C:\ProgramData\Jenkins\jenkins.pid’ does not exist. The runaway process won’t be checked
2024-04-02 08:18:23,414 INFO - Started process 3204
2024-04-02 08:18:23,414 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender
2024-04-02 08:18:23,430 INFO - Recording PID of the started process:3204. PID file destination is C:\ProgramData\Jenkins\jenkins.pid
2024-04-02 08:26:35,512 INFO - Stopping jenkins
2024-04-02 08:26:35,513 DEBUG - ProcessKill 3204
2024-04-02 08:26:35,607 INFO - Found child process: 4348 Name: conhost.exe
2024-04-02 08:26:35,630 INFO - Stopping process 4348
2024-04-02 08:26:35,633 INFO - Send SIGINT 4348
2024-04-02 08:26:35,634 WARN - SIGINT to 4348 failed - Killing as fallback
2024-04-02 08:26:35,635 INFO - Stopping process 3204
2024-04-02 08:26:35,637 INFO - Send SIGINT 3204
2024-04-02 08:26:35,637 WARN - SIGINT to 3204 failed - Killing as fallback
2024-04-02 08:26:35,640 INFO - Finished jenkins
2024-04-02 08:26:35,641 DEBUG - Completed. Exit code is 0
2024-04-02 08:26:47,921 DEBUG - Starting WinSW in the service mode
2024-04-02 08:26:47,938 INFO - Starting C:\Program Files\OpenLogic\jdk-17.0.10.7-hotspot\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar “C:\Jenkins\jenkins.war” --httpPort=8000 --webroot=“C:\ProgramData\Jenkins\war”
2024-04-02 08:26:47,944 INFO - Extension loaded: killOnStartup
2024-04-02 08:26:47,947 DEBUG - Checking the potentially runaway process with PID=3204
2024-04-02 08:26:47,952 DEBUG - No runaway process with PID=3204. The process has been already stopped.
2024-04-02 08:26:47,988 INFO - Started process 7864
2024-04-02 08:26:47,991 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender
2024-04-02 08:26:47,996 INFO - Recording PID of the started process:7864. PID file destination is C:\ProgramData\Jenkins\jenkins.pid
2024-04-02 08:30:11,565 INFO - Stopping jenkins
2024-04-02 08:30:11,566 DEBUG - ProcessKill 7864
2024-04-02 08:30:11,641 INFO - Found child process: 10492 Name: conhost.exe
2024-04-02 08:30:11,665 INFO - Stopping process 10492
2024-04-02 08:30:11,668 INFO - Send SIGINT 10492
2024-04-02 08:30:11,670 WARN - SIGINT to 10492 failed - Killing as fallback
2024-04-02 08:30:11,672 INFO - Stopping process 7864
2024-04-02 08:30:11,675 INFO - Send SIGINT 7864
2024-04-02 08:30:11,675 WARN - SIGINT to 7864 failed - Killing as fallback
2024-04-02 08:30:11,678 INFO - Finished jenkins
2024-04-02 08:30:11,679 DEBUG - Completed. Exit code is 0
2024-04-02 08:30:17,676 DEBUG - Starting WinSW in the service mode
2024-04-02 08:30:17,697 INFO - Starting C:\Program Files\OpenLogic\jdk-17.0.10.7-hotspot\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar “C:\Jenkins\jenkins.war” --httpPort=8000 --webroot=“C:\ProgramData\Jenkins\war”
2024-04-02 08:30:17,703 INFO - Extension loaded: killOnStartup
2024-04-02 08:30:17,707 DEBUG - Checking the potentially runaway process with PID=7864
2024-04-02 08:30:17,712 DEBUG - No runaway process with PID=7864. The process has been already stopped.
2024-04-02 08:30:17,727 INFO - Started process 2876
2024-04-02 08:30:17,730 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender
2024-04-02 08:30:17,734 INFO - Recording PID of the started process:2876. PID file destination is C:\ProgramData\Jenkins\jenkins.pid
2024-04-02 08:30:23,312 INFO - Stopping jenkins
2024-04-02 08:30:23,313 DEBUG - ProcessKill 2876
2024-04-02 08:30:23,386 INFO - Found child process: 11100 Name: conhost.exe
2024-04-02 08:30:23,408 INFO - Stopping process 11100
2024-04-02 08:30:23,410 INFO - Send SIGINT 11100
2024-04-02 08:30:23,412 WARN - SIGINT to 11100 failed - Killing as fallback
2024-04-02 08:30:23,413 INFO - Stopping process 2876
2024-04-02 08:30:23,416 INFO - Send SIGINT 2876
2024-04-02 08:30:23,416 WARN - SIGINT to 2876 failed - Killing as fallback
2024-04-02 08:30:23,418 INFO - Finished jenkins
2024-04-02 08:30:23,419 DEBUG - Completed. Exit code is 0
2024-04-02 08:30:43,990 DEBUG - Starting WinSW in the service mode
2024-04-02 08:30:44,009 INFO - Starting C:\Program Files\OpenLogic\jdk-17.0.10.7-hotspot\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar “C:\Jenkins\jenkins.war” --httpPort=8000 --webroot=“C:\ProgramData\Jenkins\war”
2024-04-02 08:30:44,016 INFO - Extension loaded: killOnStartup
2024-04-02 08:30:44,020 DEBUG - Checking the potentially runaway process with PID=2876
2024-04-02 08:30:44,026 DEBUG - No runaway process with PID=2876. The process has been already stopped.
2024-04-02 08:30:44,043 INFO - Started process 11076
2024-04-02 08:30:44,046 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender
2024-04-02 08:30:44,051 INFO - Recording PID of the started process:11076. PID file destination is C:\ProgramData\Jenkins\jenkins.pid
2024-04-02 08:32:39,759 INFO - Stopping jenkins
2024-04-02 08:32:39,760 DEBUG - ProcessKill 11076
2024-04-02 08:32:39,832 INFO - Found child process: 7976 Name: conhost.exe
2024-04-02 08:32:39,854 INFO - Stopping process 7976
2024-04-02 08:32:39,856 INFO - Send SIGINT 7976
2024-04-02 08:32:39,857 WARN - SIGINT to 7976 failed - Killing as fallback
2024-04-02 08:32:39,859 INFO - Stopping process 11076
2024-04-02 08:32:39,862 INFO - Send SIGINT 11076
2024-04-02 08:32:39,862 WARN - SIGINT to 11076 failed - Killing as fallback
2024-04-02 08:32:39,865 INFO - Finished jenkins
2024-04-02 08:32:39,866 DEBUG - Completed. Exit code is 0
2024-04-02 08:32:45,708 DEBUG - Starting WinSW in the service mode
2024-04-02 08:32:45,726 INFO - Starting C:\Program Files\OpenLogic\jdk-17.0.10.7-hotspot\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar “C:\Jenkins\jenkins.war” --httpPort=8000 --webroot=“C:\ProgramData\Jenkins\war”
2024-04-02 08:32:45,732 INFO - Extension loaded: killOnStartup
2024-04-02 08:32:45,735 DEBUG - Checking the potentially runaway process with PID=11076
2024-04-02 08:32:45,741 DEBUG - No runaway process with PID=11076. The process has been already stopped.
2024-04-02 08:32:45,755 INFO - Started process 8460
2024-04-02 08:32:45,758 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender
2024-04-02 08:32:45,763 INFO - Recording PID of the started process:8460. PID file destination is C:\ProgramData\Jenkins\jenkins.pid
2024-04-02 09:54:12,094 INFO - Stopping jenkins
2024-04-02 09:54:12,094 DEBUG - ProcessKill 8460
2024-04-02 09:54:12,150 INFO - Found child process: 7668 Name: conhost.exe
2024-04-02 09:54:12,175 INFO - Stopping process 7668
2024-04-02 09:54:12,178 INFO - Send SIGINT 7668
2024-04-02 09:54:12,179 WARN - SIGINT to 7668 failed - Killing as fallback
2024-04-02 09:54:12,181 INFO - Stopping process 8460
2024-04-02 09:54:12,183 INFO - Send SIGINT 8460
2024-04-02 09:54:12,183 WARN - SIGINT to 8460 failed - Killing as fallback
2024-04-02 09:54:12,186 INFO - Finished jenkins
2024-04-02 09:54:12,187 DEBUG - Completed. Exit code is 0
2024-04-10 09:46:40,159 DEBUG - Starting WinSW in the service mode
2024-04-10 09:46:48,968 DEBUG - Completed. Exit code is 0
2024-04-10 09:53:33,280 DEBUG - Starting WinSW in the service mode
2024-04-10 09:53:33,296 INFO - Starting C:\Program Files\OpenLogic\jdk-17.0.10.7-hotspot\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar “C:\Jenkins\jenkins.war” --httpPort=8443 --webroot=“C:\ProgramData\Jenkins\war”
2024-04-10 09:53:33,302 INFO - Extension loaded: killOnStartup
2024-04-10 09:53:33,305 DEBUG - Checking the potentially runaway process with PID=8460
2024-04-10 09:53:33,310 DEBUG - No runaway process with PID=8460. The process has been already stopped.
2024-04-10 09:53:33,325 INFO - Started process 9860
2024-04-10 09:53:33,329 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender
2024-04-10 09:53:33,333 INFO - Recording PID of the started process:9860. PID file destination is C:\ProgramData\Jenkins\jenkins.pid
2024-04-10 10:14:38,834 INFO - Stopping jenkins
2024-04-10 10:14:38,835 DEBUG - ProcessKill 9860
2024-04-10 10:14:38,910 INFO - Found child process: 9408 Name: conhost.exe
2024-04-10 10:14:38,934 INFO - Stopping process 9408
2024-04-10 10:14:38,936 INFO - Send SIGINT 9408
2024-04-10 10:14:38,938 WARN - SIGINT to 9408 failed - Killing as fallback
2024-04-10 10:14:38,939 INFO - Stopping process 9860
2024-04-10 10:14:38,941 INFO - Send SIGINT 9860
2024-04-10 10:14:38,942 WARN - SIGINT to 9860 failed - Killing as fallback
2024-04-10 10:14:38,945 INFO - Finished jenkins
2024-04-10 10:14:38,946 DEBUG - Completed. Exit code is 0
2024-04-10 10:17:46,068 DEBUG - Starting WinSW in the service mode
2024-04-10 10:17:46,088 INFO - Starting C:\Program Files\OpenLogic\jdk-17.0.10.7-hotspot\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar “C:\Jenkins\jenkins.war” --httpPort=8443 --webroot=“C:\ProgramData\Jenkins\war”
2024-04-10 10:17:46,094 INFO - Extension loaded: killOnStartup
2024-04-10 10:17:46,105 DEBUG - Checking the potentially runaway process with PID=9860
2024-04-10 10:17:46,111 DEBUG - No runaway process with PID=9860. The process has been already stopped.
2024-04-10 10:17:46,126 INFO - Started process 3572
2024-04-10 10:17:46,130 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender
2024-04-10 10:17:46,134 INFO - Recording PID of the started process:3572. PID file destination is C:\ProgramData\Jenkins\jenkins.pid
2024-04-10 10:20:52,836 INFO - Stopping jenkins
2024-04-10 10:20:52,837 DEBUG - ProcessKill 3572
2024-04-10 10:20:52,916 INFO - Found child process: 7384 Name: conhost.exe
2024-04-10 10:20:52,942 INFO - Stopping process 7384
2024-04-10 10:20:52,945 INFO - Send SIGINT 7384
2024-04-10 10:20:52,946 WARN - SIGINT to 7384 failed - Killing as fallback
2024-04-10 10:20:52,948 INFO - Stopping process 3572
2024-04-10 10:20:52,951 INFO - Send SIGINT 3572
2024-04-10 10:20:52,951 WARN - SIGINT to 3572 failed - Killing as fallback
2024-04-10 10:20:52,954 INFO - Finished jenkins
2024-04-10 10:20:52,955 DEBUG - Completed. Exit code is 0
2024-04-10 10:21:47,752 DEBUG - Starting WinSW in the service mode
2024-04-10 10:21:47,770 INFO - Starting C:\Program Files\Microsoft\jdk-17.0.10.7-hotspot\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar “C:\Jenkins\jenkins.war” --httpPort=8443 --webroot=“C:\ProgramData\Jenkins\war”
2024-04-10 10:21:47,776 INFO - Extension loaded: killOnStartup
2024-04-10 10:21:47,779 DEBUG - Checking the potentially runaway process with PID=3572
2024-04-10 10:21:47,785 DEBUG - No runaway process with PID=3572. The process has been already stopped.
2024-04-10 10:21:47,806 INFO - Started process 3028
2024-04-10 10:21:47,810 DEBUG - Forwarding logs of the process System.Diagnostics.Process (java) to winsw.SizeBasedRollingLogAppender
2024-04-10 10:21:47,815 INFO - Recording PID of the started process:3028. PID file destination is C:\ProgramData\Jenkins\jenkins.pid
2024-04-10 10:55:20,627 INFO - Stopping jenkins
2024-04-10 10:55:20,627 DEBUG - ProcessKill 3028
2024-04-10 10:55:20,686 INFO - Found child process: 11140 Name: conhost.exe
2024-04-10 10:55:20,708 INFO - Stopping process 11140
2024-04-10 10:55:20,711 INFO - Send SIGINT 11140
2024-04-10 10:55:20,712 WARN - SIGINT to 11140 failed - Killing as fallback
2024-04-10 10:55:20,714 INFO - Stopping process 3028
2024-04-10 10:55:20,717 INFO - Send SIGINT 3028
2024-04-10 10:55:20,717 WARN - SIGINT to 3028 failed - Killing as fallback
2024-04-10 10:55:20,719 INFO - Finished jenkins
2024-04-10 10:55:20,720 DEBUG - Completed. Exit code is 0

Does C:\ProgramData\Jenkins exist? Did you use the Windows installer to install? What version did you install?

Does C:\ProgramData\Jenkins exist? - Yes and accessible as well.
Did you use the Windows installer to install? - Yes
What version did you install? Version 2.448