Prevent killing process if pid is 0

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