Prevent killing process if pid is 0

This commit is contained in:
2025-11-17 10:03:45 +02:00
parent 2aef0c0ff9
commit 81421b0cc4
+2
View File
@@ -353,7 +353,9 @@ func (service *EnitService) StopService() error {
newServiceStatus := EnitServiceCrashed newServiceStatus := EnitServiceCrashed
defer func() { defer func() {
// Kill remaining child processes // Kill remaining child processes
if pid != 0 {
syscall.Kill(-pid, syscall.SIGKILL) syscall.Kill(-pid, syscall.SIGKILL)
}
service.state = newServiceStatus service.state = newServiceStatus
service.processID = 0 service.processID = 0