summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-06-06 17:21:49 -0300
committerTomás Touceda <chiiph@leap.se>2013-06-06 17:21:49 -0300
commit290a66199e978773855b25404a3e35745ea5d0ec (patch)
tree444edb052fc044ea8eca5ec2793c01d4a55793e7
parent151a5c3c18573e7b43728d708660ed69e966e8a1 (diff)
parent34a1686f44248e3ed96ebb58071c4093e16ce794 (diff)
Merge remote-tracking branch 'micah/feature/improve_initscript' into develop
-rw-r--r--changes/feature_initscript-enhancements5
-rw-r--r--pkg/soledad50
2 files changed, 34 insertions, 21 deletions
diff --git a/changes/feature_initscript-enhancements b/changes/feature_initscript-enhancements
new file mode 100644
index 00000000..24ff239e
--- /dev/null
+++ b/changes/feature_initscript-enhancements
@@ -0,0 +1,5 @@
+ o Add LSB (Linux Standards Base) 3.1 compliant header
+ o Remove unnecessary backslashes in variable definitions
+ o Replace environment variables with more standard upper-cased names
+ o Make a TWISTD_PATH environment variable to replace hard-coded /usr/local/bin/twistd
+ o Pull environment variables together into one block \ No newline at end of file
diff --git a/pkg/soledad b/pkg/soledad
index 036b76da..c640a94d 100644
--- a/pkg/soledad
+++ b/pkg/soledad
@@ -1,16 +1,25 @@
#!/bin/sh
+### BEGIN INIT INFO
+# Provides: soledad
+# Required-Start: $network $named $remote_fs $syslog $time
+# Required-Stop: $network $named $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start soledad daemon at boot time
+# Description: Synchronization of locally encrypted data among devices
+### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
-
-
-pidfile=/var/run/soledad.pid \
-rundir=/var/lib/soledad/ \
-obj=leap.soledad.server.application \
-logfile=/var/log/soledad.log \
-https_port=2424 \
-plain_port=65534 \
-cert_path=/etc/leap/soledad-server.pem \
-privkey_path=/etc/leap/soledad-server.pem
+PIDFILE=/var/run/soledad.pid
+RUNDIR=/var/lib/soledad/
+OBJ=leap.soledad.server.application
+LOGFILE=/var/log/soledad.log
+HTTPS_PORT=2424
+PLAIN_PORT=65534
+CERT_PATH=/etc/leap/soledad-server.pem
+PRIVKEY_PATH=/etc/leap/soledad-server.pem
+TWISTD_PATH=/usr/bin/twistd
+HOME=/var/lib/soledad/
[ -r /etc/default/soledad ] && . /etc/default/soledad
@@ -22,23 +31,22 @@ test -r /etc/leap/ || exit 0
case "$1" in
start)
echo -n "Starting soledad: twistd"
- HOME="/var/lib/soledad/" \
- start-stop-daemon --start --quiet --exec /usr/local/bin/twistd -- \
- --pidfile=$pidfile \
- --logfile=$logfile \
+ start-stop-daemon --start --quiet --exec $TWISTD_PATH -- \
+ --pidfile=$PIDFILE \
+ --logfile=$LOGFILE \
web \
- --wsgi=$obj \
- --https=$https_port \
- --certificate=$cert_path \
- --privkey=$privkey_path \
- --port=$plain_port
+ --wsgi=$OBJ \
+ --https=$HTTPS_PORT \
+ --certificate=$CERT_PATH \
+ --privkey=$PRIVKEY_PATH \
+ --port=$PLAIN_PORT
echo "."
;;
stop)
echo -n "Stopping soledad: twistd"
start-stop-daemon --stop --quiet \
- --pidfile $pidfile
+ --pidfile $PIDFILE
echo "."
;;
@@ -52,7 +60,7 @@ case "$1" in
;;
status)
- status_of_proc -p $pidfile /usr/local/bin/twistd soledad && exit 0 || exit $?
+ status_of_proc -p $PIDFILE $TWISTD_PATH soledad && exit 0 || exit $?
;;
*)