From 806dcf91458747d7f5cb96174a90ca224180b658 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 6 Dec 2011 03:53:03 +0100 Subject: [PATCH] prepared packaging for new release --- debian/changelog | 11 +++++++++-- debian/control | 2 +- debian/vzlogger.init | 8 +++++--- debian/vzlogger.postinst | 26 ++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 debian/vzlogger.postinst diff --git a/debian/changelog b/debian/changelog index bdc74e8..55bdf45 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,18 @@ -vzlogger (0.3.1-1) stable; urgency=low +vzlogger (0.3.2-1) stable; urgency=low + + * new release with improvments to various protocols and configuration parsing + * do not run with root privileges anymore + + -- Steffen Vogel Tue, 06 Dec 2011 02:37:26 +0100 + +vzlogger (0.3.1-2) stable; urgency=low * updated version number * fixed forking behavior of init script -- Steffen Vogel Sun, 16 Oct 2011 14:45:32 +0200 -vzlogger (0.3.1) stable; urgency=low +vzlogger (0.3.1-1) stable; urgency=low * fixed bug in parsing configuration for sml meters diff --git a/debian/control b/debian/control index d29ea35..3f177ef 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Vcs-Browser: http://github.com/volkszaehler/volkszaehler.org/tree/master/misc/co Package: vzlogger Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser Description: program for logging measurements to an volkszaehler.org middleware vzlogger... * is a tool to read and log measurements of a wide variety of smartmeters and diff --git a/debian/vzlogger.init b/debian/vzlogger.init index 4518dd6..05f20e8 100644 --- a/debian/vzlogger.init +++ b/debian/vzlogger.init @@ -12,12 +12,14 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="smartmeter server for volkzaehler.org" +DESC="smartmetering server" NAME=vzlogger DAEMON=/usr/bin/vzlogger DAEMON_ARGS="-d" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME +USER=vzlogger +GROUP=vzlogger # Exit if the package is not installed [ -x $DAEMON ] || exit 0 @@ -41,9 +43,9 @@ do_start() # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ + start-stop-daemon --start --chuid $USER --group $GROUP --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ + start-stop-daemon --start --chuid $USER --group $GROUP --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 # Add code here, if necessary, that waits for the process to be ready diff --git a/debian/vzlogger.postinst b/debian/vzlogger.postinst new file mode 100644 index 0000000..1c1ad31 --- /dev/null +++ b/debian/vzlogger.postinst @@ -0,0 +1,26 @@ +#!/bin/sh -e + +case "$1" in + configure) + if ! id vzlogger > /dev/null 2>&1 ; then + adduser --system --home /usr/share/vzlogger --no-create-home \ + --group --disabled-password --shell /bin/false \ + vzlogger + usermod -a -G dialout vzlogger + fi + + touch /var/log/vzlogger.log + chown vzlogger:adm /var/log/vzlogger.log + chown vzlogger:adm /etc/vzlogger.conf + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "$0 called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER#