]> git.pld-linux.org Git - packages/eventum.git/blame - eventum-irc.init
- set memory limit as first thing in script
[packages/eventum.git] / eventum-irc.init
CommitLineData
6f779bf8
ER
1#!/bin/sh
2#
3# chkconfig: 345 29 69
4# description: Eventum IRC Notification Bot
5
6# Source function library
7. /etc/rc.d/init.d/functions
8
9# Get network config
10. /etc/sysconfig/network
11
f6586dd5 12PIDFILE=/var/run/eventum/irc_bot.pid
6f779bf8
ER
13
14# Get service config
15[ -f /etc/sysconfig/eventum-irc ] && . /etc/sysconfig/eventum-irc
16
17# Check that networking is up.
18if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then
20 msg_network_down eventum-irc
21 exit 1
22 fi
23else
24 exit 0
25fi
26
27RETVAL=0
28# See how we were called.
29case "$1" in
30start)
31 if [ ! -f /var/lock/subsys/eventum-irc ]; then
32 msg_starting eventum-irc
33 start-stop-daemon --start \
03688434 34 --exec /usr/bin/php \
f647bd0b
ER
35 --pidfile $PIDFILE \
36 --chuid http \
9cd0273b 37 --chdir /usr/share/eventum/irc \
f647bd0b 38 --background -- -q bot.php
6f779bf8
ER
39
40 RETVAL=$?
41 if [ $RETVAL -eq 0 ]; then
42 touch /var/lock/subsys/eventum-irc
43 ok
44 else
45 fail
46 fi
47 else
48 msg_already_running eventum-irc
49 fi
50;;
51stop)
52 if [ -f /var/lock/subsys/eventum-irc ]; then
53 msg_stopping eventum-irc
f647bd0b 54 if start-stop-daemon --stop --oknodo --pidfile $PIDFILE; then
6f779bf8
ER
55 rm -f $PIDFILE /var/lock/subsys/eventum-irc >/dev/null 2>&1
56 ok
57 else
58 fail
59 fi
60 else
61 msg_not_running eventum-irc
62 fi
63;;
64restart)
65 $0 stop
66 $0 start
67 exit $?
68;;
69status)
70 status eventum-irc
71 exit $?
72;;
73*)
74 msg_usage "$0 {start|stop|restart|status}"
75 exit 3
76esac
77
78exit $RETVAL
This page took 0.038361 seconds and 4 git commands to generate.