+ service: support "-s reload" command

This commit is contained in:
Simon Zolin
2020-02-18 16:01:32 +03:00
parent fa2f793ac7
commit c77907694d
5 changed files with 70 additions and 2 deletions

View File

@@ -25,3 +25,8 @@ func SetRlimit(val uint) {
func HaveAdminRights() (bool, error) {
return os.Getuid() == 0, nil
}
// SendProcessSignal - send signal to a process
func SendProcessSignal(pid int, sig syscall.Signal) error {
return syscall.Kill(pid, sig)
}

View File

@@ -25,3 +25,8 @@ func SetRlimit(val uint) {
func HaveAdminRights() (bool, error) {
return os.Getuid() == 0, nil
}
// SendProcessSignal - send signal to a process
func SendProcessSignal(pid int, sig syscall.Signal) error {
return syscall.Kill(pid, sig)
}

View File

@@ -1,6 +1,11 @@
package util
import "golang.org/x/sys/windows"
import (
"fmt"
"syscall"
"golang.org/x/sys/windows"
)
// Set user-specified limit of how many fd's we can use
func SetRlimit(val uint) {
@@ -26,3 +31,7 @@ func HaveAdminRights() (bool, error) {
}
return true, nil
}
func SendProcessSignal(pid int, sig syscall.Signal) error {
return fmt.Errorf("not supported on Windows")
}