summaryrefslogtreecommitdiff
path: root/network/zabbix_agentd/rc.zabbix_agentd
diff options
context:
space:
mode:
authorMichal Bialozor <bialyy@o2.pl>2013-06-30 20:20:53 -0300
committerErik Hanson <erik@slackbuilds.org>2013-07-02 16:06:52 -0500
commit4dad3e8b3ea9a50f2b637b2ac1afc3316aabaca1 (patch)
tree05c6f655fc8b4b08978edcbc264db8b16a94eb6c /network/zabbix_agentd/rc.zabbix_agentd
parent28ba90f11b47d8f46b8f051715609608eb50c1c9 (diff)
downloadslackbuilds-4dad3e8b3ea9a50f2b637b2ac1afc3316aabaca1.tar.gz
network/zabbix_agentd: Updated for version 2.0.6.
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/zabbix_agentd/rc.zabbix_agentd')
-rw-r--r--network/zabbix_agentd/rc.zabbix_agentd17
1 files changed, 8 insertions, 9 deletions
diff --git a/network/zabbix_agentd/rc.zabbix_agentd b/network/zabbix_agentd/rc.zabbix_agentd
index c015089c34..c4dec471ea 100644
--- a/network/zabbix_agentd/rc.zabbix_agentd
+++ b/network/zabbix_agentd/rc.zabbix_agentd
@@ -1,6 +1,6 @@
#!/bin/sh
-# usage: ./rc.zabbix_agentd { start | stop | restart }
+# Usage: ./rc.zabbix_agentd {start|stop|restart}
PRGNAM=zabbix_agentd
PRGDIR=/usr/sbin/
@@ -10,28 +10,28 @@ DATE=$(date +%a\ %b\ %d\ %T\ %Y)
RETVAL=0
prg_start() {
- echo -n "Starting $PRGNAM ... "
+ echo -n "Starting $PRGNAM ... "
if [ -r ${PIDDIR}${PRGNAM}.pid ]; then
if $(! /sbin/pidof $PRGNAM > /dev/null 2>&1 ) ; then
echo "Removing an old ${PIDDIR}${PRGNAM}.pid"
rm -f ${PIDDIR}${PRGNAM}.pid
fi
fi
- su - @ZABBIXUSER@ -c "${PRGDIR}${PRGNAM} >> ${LOGDIR}${PRGNAM}.log 2>&1"
+ su -s /bin/sh -c "${PRGDIR}${PRGNAM} >> ${LOGDIR}${PRGNAM}.log 2>&1" @ZABBIXAGENTUSER@
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
touch /var/lock/$PRGNAM
sleep 2
- echo "Done"
+ echo "done"
else
- echo "Failed"
+ echo "failed"
fi
return $RETVAL
}
prg_stop() {
- echo -n "Stopping $PRGNAM ... "
+ echo -n "Stopping $PRGNAM ... "
if [ -r ${PIDDIR}${PRGNAM}.pid ]; then
killall $PRGNAM
# Give it some time to die gracefully
@@ -48,7 +48,7 @@ prg_stop() {
sleep 10
else
echo "$DATE EXIT: $PRGNAM stopped by user: $USER (UID: $EUID)" >> ${LOGDIR}${PRGNAM}.log
- echo "Done"
+ echo "done"
fi
fi
rm -f /var/lock/$PRGNAM
@@ -70,8 +70,7 @@ case "$1" in
prg_start
;;
*)
- echo ""
- echo "Usage: $(basename $0) {start | stop | restart }"
+ echo "Usage: $(basename $0) {start|stop|restart}"
RETVAL=1
esac