updated on Sat Jan 14 12:12:45 UTC 2012
[aur-mirror.git] / mrimt / mrimt.rc.sh
bloba0de75ecdb097b5bdbebaa463025ad2e13ca688e
1 #! /bin/bash
2 ### BEGIN INIT INFO
3 # Provides: MRIMT
4 # Required-Start: $syslog
5 # Required-Stop: $syslog
6 # Should-Start: $local_fs
7 # Should-Stop: $local_fs
8 # Default-Start: 2 3 4 5
9 # Default-Stop: 0 1 6
10 # Short-Description: starts MRIMt transport for Jabber
11 # Description: starts MRIMt which provides a gateway that allows Jabber users to communicate with their
12 # contacts on the ICQ Messenger network. It can connect to any Jabber server
13 # that supports the Connect component mechanism.
14 ### END INIT INFO
15 set -e
17 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
19 NAME=mrimt
20 DESC="Mail.ru Agent transport for Jabber"
22 PIDDIR=/var/run/mrimt
23 PIDFILE=$PIDDIR/$NAME.pid
24 USER=mrimt
25 GROUP=mrimt
27 SSD_OPTS="--pidfile=$PIDFILE --name=python --user=$USER"
29 DAEMON=/usr/bin/python
30 OPTIONS="/usr/lib/mrimt/src/mrim.py -d -c /etc/ejabberd/mrimt.conf -p $PIDFILE"
32 test -f $DAEMON || exit 0
34 if test ! -e $PIDDIR; then
35 mkdir $PIDDIR
36 chown $USER:$GROUP $PIDDIR
39 case "$1" in
40 start)
41 echo -n "Starting $DESC: "
42 # (start-stop-daemon --start $SSD_OPTS --startas "$DAEMON" --chuid "$USER" -- $OPTIONS)
43 # if test "$?" = 0; then echo "$NAME."; fi
44 su $USER -c "$DAEMON $OPTIONS"
46 stop)
47 echo -n "Stopping $DESC: "
48 # (start-stop-daemon --stop $SSD_OPTS --retry 10)
49 # if test "$?" = 0; then echo "$NAME."; fi
50 kill `cat $PIDFILE`
52 reload|force-reload)
53 echo -n "Reloading $DESC configuration..."
54 (start-stop-daemon --stop $SSD_OPTS --signal HUP)
55 if test "$?" = 0; then echo 'done.'; fi
57 restart)
58 $0 stop
59 $0 start
62 echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2
63 exit 1
65 esac
67 exit 0
69 # vim: filetype=sh