Commit adb8153a authored by Kamil Trzciński's avatar Kamil Trzciński

Bump golang service

parent 33cb42b8
......@@ -19,7 +19,7 @@
},
{
"ImportPath": "github.com/ayufan/golang-kardianos-service",
"Rev": "bcca2f3a5478ee998aa4aebd10752e7351e2853c"
"Rev": "c03d3ad4a038e0183fcddfe1f640089b894796c5"
},
{
"ImportPath": "github.com/codegangsta/cli",
......
......@@ -368,6 +368,7 @@ user="{{.UserName}}"
cmd={{.Path}}
args="{{range .Arguments}} {{.|cmd}}{{end}}"
lockfile=/var/lock/subsys/$name
pidfile=/var/run/$name.pid
# Source networking configuration.
[ -r /etc/sysconfig/$name ] && . /etc/sysconfig/$name
......@@ -377,7 +378,7 @@ start() {
daemon \
{{if .UserName}}--user=$user{{end}} \
{{if .WorkingDirectory}}--chdir={{.WorkingDirectory|cmd}}{{end}} \
$cmd $args \&
"$cmd $args </dev/null >/dev/null 2>/dev/null & echo \$! > $pidfile"
retval=$?
[ $retval -eq 0 ] && touch $lockfile
echo
......@@ -386,9 +387,10 @@ start() {
stop() {
echo -n $"Stopping $desc: "
killproc $cmd -TERM
killproc -p $pidfile $cmd -TERM
retval=$?
[ $retval -eq 0 ] && rm -f $lockfile
rm -f $pidfile
echo
return $retval
}
......@@ -400,7 +402,7 @@ restart() {
reload() {
echo -n $"Reloading $desc: "
killproc $cmd -HUP
killproc -p $pidfile $cmd -HUP
RETVAL=$?
echo
}
......@@ -410,7 +412,7 @@ force_reload() {
}
rh_status() {
status $cmd
status -p $pidfile $cmd
}
rh_status_q() {
......@@ -441,7 +443,7 @@ case "$1" in
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment