mirror of
https://github.com/EnumeratedDev/enit.git
synced 2026-09-16 02:26:11 +00:00
Prevent killing process if pid is 0
This commit is contained in:
+3
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user