From e37b5fcf938e0b87a6b2f01363a453b5824d0391 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 6 Jun 2013 11:07:02 -0400 Subject: initscript: remove unnecessary backslashes in variable definitions --- pkg/soledad | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/soledad b/pkg/soledad index 036b76da..2e94c339 100644 --- a/pkg/soledad +++ b/pkg/soledad @@ -3,13 +3,13 @@ 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 \ +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 [ -r /etc/default/soledad ] && . /etc/default/soledad -- cgit v1.2.3 From 781fc78dcbabb41bcd7642d30be92a9d6f6d648b Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 6 Jun 2013 11:09:13 -0400 Subject: initscript: replace environment variables with more standard upper-cased names --- pkg/soledad | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/pkg/soledad b/pkg/soledad index 2e94c339..3cfcce5b 100644 --- a/pkg/soledad +++ b/pkg/soledad @@ -3,14 +3,14 @@ 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 [ -r /etc/default/soledad ] && . /etc/default/soledad @@ -24,21 +24,21 @@ case "$1" in echo -n "Starting soledad: twistd" HOME="/var/lib/soledad/" \ start-stop-daemon --start --quiet --exec /usr/local/bin/twistd -- \ - --pidfile=$pidfile \ - --logfile=$logfile \ + --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 +52,7 @@ case "$1" in ;; status) - status_of_proc -p $pidfile /usr/local/bin/twistd soledad && exit 0 || exit $? + status_of_proc -p $PIDFILE /usr/local/bin/twistd soledad && exit 0 || exit $? ;; *) -- cgit v1.2.3 From b3102fadf6bdf85f5ff979df35f337714021fc67 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 6 Jun 2013 11:10:29 -0400 Subject: initscript: make a TWISTD_PATH environment variable to replace hard-coded /usr/local/bin/twistd --- pkg/soledad | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/soledad b/pkg/soledad index 3cfcce5b..018ae927 100644 --- a/pkg/soledad +++ b/pkg/soledad @@ -11,6 +11,7 @@ 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 [ -r /etc/default/soledad ] && . /etc/default/soledad @@ -23,7 +24,7 @@ case "$1" in start) echo -n "Starting soledad: twistd" HOME="/var/lib/soledad/" \ - start-stop-daemon --start --quiet --exec /usr/local/bin/twistd -- \ + start-stop-daemon --start --quiet --exec $TWISTD_PATH -- \ --pidfile=$PIDFILE \ --logfile=$LOGFILE \ web \ @@ -52,7 +53,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 $? ;; *) -- cgit v1.2.3 From f12042b3edfb7bd49877d452191c420c66659fc2 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 6 Jun 2013 11:10:59 -0400 Subject: initscript: pull environment variables together into one block --- pkg/soledad | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/soledad b/pkg/soledad index 018ae927..741ef36c 100644 --- a/pkg/soledad +++ b/pkg/soledad @@ -1,8 +1,6 @@ #!/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin - - PIDFILE=/var/run/soledad.pid RUNDIR=/var/lib/soledad/ OBJ=leap.soledad.server.application -- cgit v1.2.3 From fce125683d7ea5ad01a59788138b5b4ea16c5c22 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 6 Jun 2013 11:11:33 -0400 Subject: initscript: move HOME variable up to environment variable block, remove unnecessary double-quotes --- pkg/soledad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/soledad b/pkg/soledad index 741ef36c..76924e60 100644 --- a/pkg/soledad +++ b/pkg/soledad @@ -10,6 +10,7 @@ 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 @@ -21,7 +22,6 @@ 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 $TWISTD_PATH -- \ --pidfile=$PIDFILE \ --logfile=$LOGFILE \ -- cgit v1.2.3 From ff1f7e75128fbe73e7d017a720586a82eede99bf Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 6 Jun 2013 11:22:19 -0400 Subject: initscript: add LSB (Linux Standards Base) 3.1 compliant header --- pkg/soledad | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/soledad b/pkg/soledad index 76924e60..c640a94d 100644 --- a/pkg/soledad +++ b/pkg/soledad @@ -1,4 +1,13 @@ #!/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 -- cgit v1.2.3 From 34a1686f44248e3ed96ebb58071c4093e16ce794 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 6 Jun 2013 12:37:32 -0400 Subject: add changes file detailing initscript enhancements --- changes/feature_initscript-enhancements | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/feature_initscript-enhancements 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 -- cgit v1.2.3