Skip to content

Commit 9e75a41

Browse files
committed
debian: aded reload-or-restart option to the init script
This is a non-standard init script action, ported here only to sync with PE.
1 parent 9b4390a commit 9e75a41

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

debian/syslog-ng.init

+16-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,21 @@ case "$1" in
8686
stop)
8787
syslogng_stop || exit 1
8888
;;
89+
reload-or-restart)
90+
if [ -r "$PIDFILE" ]
91+
then
92+
PID=$(cat $PIDFILE)
93+
EXE=$(readlink /proc/$PID/exe)
94+
if [ "x$EXE" == "x/sbin/syslog-ng" ]
95+
then
96+
syslogng_reload || exit 1
97+
else
98+
syslogng_start || exit 1
99+
fi
100+
else
101+
syslogng_start || exit 1
102+
fi
103+
;;
89104
reload|force-reload)
90105
syslogng_reload || exit 1
91106
;;
@@ -95,7 +110,7 @@ case "$1" in
95110
syslogng_start || exit 1
96111
;;
97112
*)
98-
echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2
113+
echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload|reload-or-restart}" >&2
99114
exit 1
100115
;;
101116
esac

0 commit comments

Comments
 (0)