summaryrefslogtreecommitdiff
path: root/pkg/leap_mx
diff options
context:
space:
mode:
authorTomas Touceda <chiiph@leap.se>2013-05-03 17:05:53 -0300
committerTomas Touceda <chiiph@leap.se>2013-05-03 17:05:53 -0300
commitaed42557a7e8a17561c225426f66db1187006d9c (patch)
tree8b6408a1a8611cc567d0f8e7d579d501905aa0dc /pkg/leap_mx
parentd7478834794cd9e73d43732da28c8bde5c9b8801 (diff)
Add setup script and init.d script
Also, some pep8 fixes
Diffstat (limited to 'pkg/leap_mx')
-rw-r--r--pkg/leap_mx50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkg/leap_mx b/pkg/leap_mx
new file mode 100644
index 0000000..d2c4bc3
--- /dev/null
+++ b/pkg/leap_mx
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+pidfile=/var/run/leap_mx.pid \
+rundir=/var/lib/leap_mx/ \
+file=/etc/leap/mx \
+logfile=/var/log/leap_mx.log
+
+[ -r /etc/default/leap_mx ] && . /etc/default/leap_mx
+
+test -x /usr/bin/twistd || exit 0
+test -r $file || exit 0
+test -r /etc/leap/ || exit 0
+
+
+case "$1" in
+ start)
+ echo -n "Starting leap_mx: twistd"
+ start-stop-daemon --start --quiet --exec /usr/bin/twistd -- \
+ --pidfile=$pidfile \
+ --rundir=$rundir \
+ --python=$file \
+ --logfile=$logfile
+ echo "."
+ ;;
+
+ stop)
+ echo -n "Stopping leap_mx: twistd"
+ start-stop-daemon --stop --quiet \
+ --pidfile $pidfile
+ echo "."
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ ;;
+
+ force-reload)
+ $0 restart
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/leap_mx {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0 \ No newline at end of file