r43289 - in /scripts/KGB: TODO debian/dirs debian/init debian/postinst
dmn at users.alioth.debian.org
dmn at users.alioth.debian.org
Sun Aug 30 07:21:32 UTC 2009
Author: dmn
Date: Sun Aug 30 07:21:24 2009
New Revision: 43289
URL: http://svn.debian.org/wsvn/?sc=1&rev=43289
Log:
KGB/server: create /var/run/kgb-bot in the init script
solves problem when /var/run is mounted in the memory
Removed:
scripts/KGB/debian/dirs
Modified:
scripts/KGB/TODO
scripts/KGB/debian/init
scripts/KGB/debian/postinst
Modified: scripts/KGB/TODO
URL: http://svn.debian.org/wsvn/scripts/KGB/TODO?rev=43289&op=diff
==============================================================================
--- scripts/KGB/TODO (original)
+++ scripts/KGB/TODO Sun Aug 30 07:21:24 2009
@@ -24,14 +24,3 @@
- 'are you alive' ('yes, master') :)
* make sure client reports any faults verbosely
-* lintian/policy:
-
-E: kgb-bot: dir-or-file-in-var-run var/run/kgb-bot/
-N:
-N: /var/run may be a temporary filesystem, so any directories or files
-N: needed there must be created dynamically at boot time.
-N:
-N: Refer to Debian Policy Manual section 9.3.2 (Writing the scripts) for
-N: details.
-N:
-N: Severity: serious, Certainty: possible
Modified: scripts/KGB/debian/init
URL: http://svn.debian.org/wsvn/scripts/KGB/debian/init?rev=43289&op=diff
==============================================================================
--- scripts/KGB/debian/init (original)
+++ scripts/KGB/debian/init Sun Aug 30 07:21:24 2009
@@ -38,6 +38,23 @@
. /lib/lsb/init-functions
#
+# create /var/run/kgb-bot and ensure right permissions
+#
+init_run_dir()
+{
+ RUN_DIR="/var/run/$NAME"
+ [ -d "$RUN_DIR" ] || mkdir "$RUN_DIR" || return 1
+
+ # allow local administrator overrides
+ if ! dpkg-statoverride --list "$RUN_DIR" > /dev/null; then
+ dpkg-statoverride --update --add root "$RUN_AS" 0775 "$RUN_DIR" \
+ || return 1
+ fi
+
+ return 0
+}
+
+#
# Function that starts the daemon/service
#
do_start()
@@ -46,6 +63,7 @@
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
+ init_run_dir || return 2
start-stop-daemon --start --quiet --chuid $RUN_AS --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --chuid $RUN_AS --pidfile $PIDFILE --exec $DAEMON -- \
Modified: scripts/KGB/debian/postinst
URL: http://svn.debian.org/wsvn/scripts/KGB/debian/postinst?rev=43289&op=diff
==============================================================================
--- scripts/KGB/debian/postinst (original)
+++ scripts/KGB/debian/postinst Sun Aug 30 07:21:24 2009
@@ -10,10 +10,6 @@
if ! dpkg-statoverride --list /etc/kgb-bot/kgb.conf > /dev/null; then
dpkg-statoverride --update --add root Debian-kgb 0640 /etc/kgb-bot/kgb.conf
fi
-
- if ! dpkg-statoverride --list /var/run/kgb-bot > /dev/null; then
- dpkg-statoverride --update --add root Debian-kgb 0775 /var/run/kgb-bot
- fi
fi
#DEBHELPER#
More information about the Pkg-perl-cvs-commits
mailing list