diff options
| author | Armin Kuster <akuster808@gmail.com> | 2019-03-30 14:14:13 -0700 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2019-03-31 10:37:09 -0700 |
| commit | 1460d9b86dfc8100cf6bd112ec01dfc0ce19da39 (patch) | |
| tree | e75d67841f27dbd7370b7c5e8994c731f024e026 /recipes-security/samhain/files/samhain-server.init | |
| parent | 75e609f7b14b57b27143ec9e8d818fc5fab6d106 (diff) | |
| download | meta-security-1460d9b86dfc8100cf6bd112ec01dfc0ce19da39.tar.gz | |
reorg ids: move ids recipes to recipes-ids
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'recipes-security/samhain/files/samhain-server.init')
| -rw-r--r-- | recipes-security/samhain/files/samhain-server.init | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/recipes-security/samhain/files/samhain-server.init b/recipes-security/samhain/files/samhain-server.init deleted file mode 100644 index c456e51..0000000 --- a/recipes-security/samhain/files/samhain-server.init +++ /dev/null | |||
| @@ -1,116 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # chkconfig: 2345 98 11 | ||
| 3 | # description: File Integrity Checking Daemon | ||
| 4 | # | ||
| 5 | # processname: yule | ||
| 6 | # config : /etc/yulerc | ||
| 7 | # logfile : /var/log/yule/yule_log | ||
| 8 | # database: /var/lib/yule/yule_file | ||
| 9 | # | ||
| 10 | |||
| 11 | NAME=yule | ||
| 12 | DAEMON=/usr/sbin/yule | ||
| 13 | RETVAL=0 | ||
| 14 | PIDFILE=/var/run/yule.pid | ||
| 15 | |||
| 16 | . /etc/default/rcS | ||
| 17 | |||
| 18 | . /etc/default/samhain-server | ||
| 19 | |||
| 20 | if [ "x$SAMHAIN_SERVER_START" != "xyes" ]; then | ||
| 21 | echo "${0}: server disabled in /etc/default/samhain-server" | ||
| 22 | exit 0 | ||
| 23 | fi | ||
| 24 | |||
| 25 | if [ -x $DAEMON ]; then | ||
| 26 | : | ||
| 27 | else | ||
| 28 | echo "${0}: executable ${DAEMON} not found" | ||
| 29 | exit 1 | ||
| 30 | fi | ||
| 31 | |||
| 32 | samhain_done() | ||
| 33 | { | ||
| 34 | if [ $RETVAL -eq 0 ]; then | ||
| 35 | echo "." | ||
| 36 | else | ||
| 37 | echo " failed." | ||
| 38 | fi | ||
| 39 | } | ||
| 40 | |||
| 41 | log_stat_msg () { | ||
| 42 | case "$1" in | ||
| 43 | 0) | ||
| 44 | echo "Service $NAME: Running"; | ||
| 45 | ;; | ||
| 46 | 1) | ||
| 47 | echo "Service $NAME: Stopped and /var/run pid file exists"; | ||
| 48 | ;; | ||
| 49 | 3) | ||
| 50 | echo "Service $NAME: Stopped"; | ||
| 51 | ;; | ||
| 52 | *) | ||
| 53 | echo "Service $NAME: Status unknown"; | ||
| 54 | ;; | ||
| 55 | esac | ||
| 56 | } | ||
| 57 | |||
| 58 | case "$1" in | ||
| 59 | start) | ||
| 60 | # | ||
| 61 | # Remove a stale PID file, if found | ||
| 62 | # | ||
| 63 | if test -f ${PIDFILE}; then | ||
| 64 | /bin/rm -f ${PIDFILE} | ||
| 65 | fi | ||
| 66 | # | ||
| 67 | echo -n "Starting ${NAME}" | ||
| 68 | start-stop-daemon --start --quiet --exec $DAEMON | ||
| 69 | RETVAL=$? | ||
| 70 | samhain_done | ||
| 71 | ;; | ||
| 72 | |||
| 73 | stop) | ||
| 74 | echo -n "Stopping $NAME" | ||
| 75 | start-stop-daemon --stop --quiet --exec $DAEMON | ||
| 76 | RETVAL=$? | ||
| 77 | |||
| 78 | # | ||
| 79 | # Remove a stale PID file, if found | ||
| 80 | # | ||
| 81 | if test -f ${PIDFILE}; then | ||
| 82 | /bin/rm -f ${PIDFILE} | ||
| 83 | fi | ||
| 84 | if test -S /var/run/${NAME}.sock; then | ||
| 85 | /bin/rm -f /var/run/${NAME}.sock | ||
| 86 | fi | ||
| 87 | samhain_done | ||
| 88 | ;; | ||
| 89 | |||
| 90 | restart) | ||
| 91 | $0 stop | ||
| 92 | sleep 3 | ||
| 93 | $0 start | ||
| 94 | RETVAL=$? | ||
| 95 | ;; | ||
| 96 | |||
| 97 | reload|force-reload) | ||
| 98 | echo -n "Reloading $NAME configuration files" | ||
| 99 | start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON | ||
| 100 | RETVAL=$? | ||
| 101 | samhain_done | ||
| 102 | ;; | ||
| 103 | |||
| 104 | status) | ||
| 105 | $DAEMON status | ||
| 106 | RETVAL=$? | ||
| 107 | log_stat_msg ${RETVAL} | ||
| 108 | ;; | ||
| 109 | |||
| 110 | *) | ||
| 111 | echo "$0 usage: {start|stop|status|restart|reload}" | ||
| 112 | exit 1 | ||
| 113 | ;; | ||
| 114 | esac | ||
| 115 | |||
| 116 | exit $RETVAL | ||
