فهرست منبع

properly read the default file to set the user argument in the init script

Helmut Pozimski 10 سال پیش
والد
کامیت
70b2a49762
3فایلهای تغییر یافته به همراه11 افزوده شده و 5 حذف شده
  1. 6 0
      debian/changelog
  2. 1 1
      debian/control
  3. 4 4
      debian/stdd.init

+ 6 - 0
debian/changelog

@@ -1,3 +1,9 @@
+stdd (0.9-2) unstable; urgency=low
+
+  * Changed init script to properly read /etc/default/stdd and switch user
+
+ -- Helmut Pozimski <helmut@pozimski.eu>  Thu, 01 Aug 2013 19:22:00 +0200
+
 stdd (0.9-1) unstable; urgency=low
 
   * Initial package built for stdd 0.9

+ 1 - 1
debian/control

@@ -9,7 +9,7 @@ Standards-Version: 3.9.4
 
 Package: stdd
 Architecture: all
-Depends: ${misc:Depends}, python (>= 2.7), python-smbus, i2c-tools, python-prctl
+Depends: python (>= 2.7), python-smbus, i2c-tools, python-prctl
 Description: simple time display daemon
  stdd is a small daemon written in python which displays
  the current time on a 7 segment display from Adafruit attached via i2c

+ 4 - 4
debian/stdd.init

@@ -18,6 +18,10 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="simple time display daemon"
 NAME="stdd"
 DAEMON=/usr/bin/$NAME
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
 DAEMON_ARGS="-d -c /etc/stdd.conf -u $STDD_USER -g $STDD_GROUP"
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -30,10 +34,6 @@ fi
 # Exit if the package is not installed
 [ -x "$DAEMON" ] || exit 0
 
-# Read configuration variable file if it is present
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-
 # Define LSB log_* functions.
 # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
 # and status_of_proc is working.