Hello,
I don't know for you but i have troubles using the init.d scripts. I used the suckerd one and modified it as there is no server one ( i imagine this is the old name for the server) , it start but i cannot "restart" or "stop" it. This does not work.
Do any user here have a debian set of init.d that works well for the server ? It seems that the pid written is not the pid of any processes, i suspect that zabbix fork itself in the background then drop the first process perhaps because of privileges issue (to run as zabbix user when launched by root ? ). This seem to be why the script cannot stop zabbix from running.
It seems also that the pid file is created as 666, if i do not make error this can lead to security issues if root restart zabbix and some unpriviledged user put the pid of another process in this file ?
Best regards,
Ghislain.
here is mine:
#! /bin/sh
#
# Zabbix daemon start/stop script.
#
# Written by Alexei Vladishev <[email protected]>.
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/zabbix/bin
DAEMON=/opt/zabbix/bin/zabbix_server
NAME=zabbix_server
DESC="Zabbix daemon"
test -f $DAEMON || exit 0
set -e
case "$1" in
start)
echo "Starting $DESC: $NAME"
start-stop-daemon --oknodo --start --pidfile /tmp/$NAME.pid \
--exec $DAEMON
;;
stop)
echo "Stopping $DESC: $NAME"
start-stop-daemon --oknodo --stop --pidfile /tmp/$NAME.pid \
--exec $DAEMON
;;
restart|force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
# echo -n "Restarting $DESC: zabbix_server"
$0 stop
$0 start
# start-stop-daemon --stop --quiet --pidfile \
# /tmp/$NAME.pid --user zabbix --exec $DAEMON
# sleep 1
# start-stop-daemon --start --quiet --pidfile \
# /tmp/$NAME.pid --user zabbix --exec $DAEMON
# echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
I don't know for you but i have troubles using the init.d scripts. I used the suckerd one and modified it as there is no server one ( i imagine this is the old name for the server) , it start but i cannot "restart" or "stop" it. This does not work.
Do any user here have a debian set of init.d that works well for the server ? It seems that the pid written is not the pid of any processes, i suspect that zabbix fork itself in the background then drop the first process perhaps because of privileges issue (to run as zabbix user when launched by root ? ). This seem to be why the script cannot stop zabbix from running.
It seems also that the pid file is created as 666, if i do not make error this can lead to security issues if root restart zabbix and some unpriviledged user put the pid of another process in this file ?
Best regards,
Ghislain.
here is mine:
#! /bin/sh
#
# Zabbix daemon start/stop script.
#
# Written by Alexei Vladishev <[email protected]>.
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/zabbix/bin
DAEMON=/opt/zabbix/bin/zabbix_server
NAME=zabbix_server
DESC="Zabbix daemon"
test -f $DAEMON || exit 0
set -e
case "$1" in
start)
echo "Starting $DESC: $NAME"
start-stop-daemon --oknodo --start --pidfile /tmp/$NAME.pid \
--exec $DAEMON
;;
stop)
echo "Stopping $DESC: $NAME"
start-stop-daemon --oknodo --stop --pidfile /tmp/$NAME.pid \
--exec $DAEMON
;;
restart|force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
# echo -n "Restarting $DESC: zabbix_server"
$0 stop
$0 start
# start-stop-daemon --stop --quiet --pidfile \
# /tmp/$NAME.pid --user zabbix --exec $DAEMON
# sleep 1
# start-stop-daemon --start --quiet --pidfile \
# /tmp/$NAME.pid --user zabbix --exec $DAEMON
# echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
)

Comment