diff options
author | James Carter <james.carter@bytemark.co.uk> | 2017-08-01 15:56:35 +0100 |
---|---|---|
committer | James Carter <james.carter@bytemark.co.uk> | 2017-08-01 15:56:35 +0100 |
commit | 4eff930c3f01414bb454d7bcb5501827cb60289b (patch) | |
tree | a398edd68c7fd30cf3987538e41e9b4df9f561b8 /utils/init_jmauve.sh | |
parent | 0be1fa0ebadf9435a760582d17f47ff96dc0851c (diff) | |
parent | 814ed65fd415cc62b2f6f661a7f6d1629562544b (diff) |
Merge branch '27-package-and-publish-in-gitlab-ci-retire-maker2-job' into 'develop'
Added CI
Closes #27
See merge request !2
Diffstat (limited to 'utils/init_jmauve.sh')
-rwxr-xr-x | utils/init_jmauve.sh | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/utils/init_jmauve.sh b/utils/init_jmauve.sh deleted file mode 100755 index 3011d62..0000000 --- a/utils/init_jmauve.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: mauveserver -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start the mauve alerting daemon at boot time -# Description: Start the mauve alerting daemon at boot time -### END INIT INFO - -PATH=/bin:/sbin:/usr/bin:/usr/local/bin -DAEMON=/usr/bin/jmauveserver -DAEMON_OPTS=/etc/mauvealert/mauveserver.conf -DESC="mauvealert server" -PIDFILE=/var/run/jmauveserver.pid -LOG=/var/log/mauve - -test -x $DAEMON || exit 0 - -. /lib/lsb/init-functions - -case "$1" in - start) - log_begin_msg "Starting $DESC:" "$NAME" - if [ ! -d $LOG ]; then mkdir $LOG; fi - chown mauveserver $LOG /var/lib/mauveserver - $DAEMON $DAEMON_OPTS & - echo $! > $PIDFILE - for i in `seq 0 1 11`;do sleep 1; echo -n '.'; done - kill -0 $(cat $PIDFILE) - if [ $? != 0 ] ; then echo -n "failed"; else echo -n "success"; fi - - # Email on start. - address="yann@bytemark.co.uk" - lastLog=`/bin/ls -tr $LOG/*.log | tail -1` - logLastLines=`tail -101 $lastLog` - echo $logLastLines | mail -s "Mauve was started at `date`" $address - - log_end_msg $? - ;; - stop) - log_begin_msg "Stopping $DESC:" "$NAME" - if [ -f $PIDFILE ] ; then - kill `cat $PIDFILE` - rm $PIDFILE - - # Email on stop. - address="yann@bytemark.co.uk" - lastLog=`/bin/ls -tr $LOG/*.log | tail -1` - logLastLines=`tail -101 $lastLog` - echo $logLastLines | mail -s "Mauve was stopped at `date`" $address - - else - echo Not running to stop - exit 1 - fi - log_end_msg $? - ;; - reload) - if [ -f $PIDFILE ] ; then - echo Sending restart signal to mauveserver - kill -HUP `cat $PIDFILE` - else - echo Not running to reload - fi - ;; - restart|reload|force-reload) - $0 stop - sleep 1 - $0 start - ;; - *) - N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|restart}" >&2 - exit 1 - ;; -esac - -exit 0 |