This commit is contained in:
Kelvin Ly (on the cloud) 2019-07-19 03:16:57 +00:00
parent 46b14665bf
commit eb112d17e2
2 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import (
"net/http"
"os"
"os/exec"
"path"
"strconv"
"strings"
"syscall"
@ -172,7 +173,7 @@ func main() {
daemon.AddCommand(daemon.StringFlag(signal, "stop"), syscall.SIGTERM, termHandler)
daemon.AddCommand(daemon.StringFlag(signal, "reload"), syscall.SIGHUP, reloadHandler)
execName := os.Args[0]
execName := path.Base(os.Args[0])
cntxt := &daemon.Context{
PidFileName: "/tmp/" + execName + "-pid",
PidFilePerm: 0644,

View File

@ -3,5 +3,5 @@
SCRIPT=`realpath $0`
SCRIPTPATH=`dirname $SCRIPT`
BASENAME=`basename $SCRIPTPATH`
echo $BASENAME
echo "killing $BASENAME"
kill `cat /tmp/$BASENAME-pid`