[tango] 02/02: fix the tango-common.postinst
Frédéric-Emmanuel Picca
picca at moszumanska.debian.org
Thu May 1 20:50:44 UTC 2014
This is an automated email from the git hooks/post-receive script.
picca pushed a commit to branch master
in repository tango.
commit 6e7ca49acf8fc2ff1b31af45c6a233e87e2c49b3
Author: Picca Frédéric-Emmanuel <picca at debian.org>
Date: Thu May 1 20:28:08 2014 +0200
fix the tango-common.postinst
add tango to the video group
---
debian/changelog | 10 ++++++++++
debian/rules | 3 +++
debian/tango-common.install | 1 +
debian/tango-common.postinst | 35 +++++++++++++++++++++++++----------
4 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 15433d0..b83827c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+tango (8.1.2c+dfsg-5) UNRELEASED; urgency=medium
+
+ * create the user in the postinst to deal with the piuparts remaining
+ files error. An empty tango home directory (/var/lib.tango) is part of
+ tango-common so we let dpkg deal with its removal (Closes: #657146)
+ * add the tango user to the video group. Some tango devices need access to
+ video grabbers.
+
+ -- Picca Frédéric-Emmanuel <picca at debian.org> Thu, 01 May 2014 11:51:06 +0200
+
tango (8.1.2c+dfsg-4) unstable; urgency=medium
* debian/patches
diff --git a/debian/rules b/debian/rules
index 938b496..253bb56 100755
--- a/debian/rules
+++ b/debian/rules
@@ -33,6 +33,9 @@ override_dh_auto_install:
install -p -m 644 $(CURDIR)/$(BUILDROOT)/cppserver/database/stored_proc.sql debian/tmp/usr/share/tango-db/stored_proc.sql
install -p -m 600 $(CURDIR)/$(BUILDROOT)/cppserver/database/my.cnf debian/tmp/usr/share/tango-db/my.cnf
+ # install the tango home dir
+ install -d debian/tmp/var/lib/tango
+
override_dh_strip:
dh_strip -plibtango8 --dbg-package=libtango8-dbg
dh_strip -pliblog4tango5 --dbg-package=liblog4tango5-dbg
diff --git a/debian/tango-common.install b/debian/tango-common.install
new file mode 100644
index 0000000..5070357
--- /dev/null
+++ b/debian/tango-common.install
@@ -0,0 +1 @@
+var/lib/tango
diff --git a/debian/tango-common.postinst b/debian/tango-common.postinst
index 3d90ea9..b3969bd 100644
--- a/debian/tango-common.postinst
+++ b/debian/tango-common.postinst
@@ -5,29 +5,41 @@ CONFIGFILE=/etc/tangorc
set -e
. /usr/share/debconf/confmodule
-case "$1" in
- install|upgrade)
-
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "$1" in
+ configure)
+
# If the package has default file it could be sourced, so that
# the local admin can overwrite the defaults
-
+
[ -f "/etc/default/tango" ] && . /etc/default/tango
-
+
# Sane defaults:
-
+
[ -z "$SERVER_HOME" ] && SERVER_HOME=/var/lib/tango
[ -z "$SERVER_USER" ] && SERVER_USER=tango
[ -z "$SERVER_NAME" ] && SERVER_NAME="Tango Control System Server"
[ -z "$SERVER_GROUP" ] && SERVER_GROUP=tango
# Groups that the user will be added to, if undefined, then none.
- ADDGROUP=""
+ ADDGROUP="video"
# create user to avoid running server as root
# 1. create group if not existing
if ! getent group | grep -q "^$SERVER_GROUP:" ; then
echo -n "Adding group $SERVER_GROUP.."
- addgroup --quiet --system $SERVER_GROUP 2>/dev/null ||true
+ addgroup --quiet --system $SERVER_GROUP 2>/dev/null || true
echo "..done"
fi
# 2. create homedir if not existing
@@ -51,11 +63,11 @@ case "$1" in
# 5. adjust file and directory permissions
if ! dpkg-statoverride --list $SERVER_HOME >/dev/null
then
- chown -R $SERVER_USER:adm $SERVER_HOME
+ chown -R $SERVER_USER:$SERVER_GROUP $SERVER_HOME
chmod u=rwx,g=rxs,o= $SERVER_HOME
fi
# 6. Add the user to the ADDGROUP group
- if test -n $ADDGROUP
+ if test $ADDGROUP
then
if ! groups $SERVER_USER | cut -d: -f2 | \
grep -qw $ADDGROUP; then
@@ -63,6 +75,9 @@ case "$1" in
fi
fi
;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
esac
# Generate config file, if it doesn't exist.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/tango.git
More information about the debian-science-commits
mailing list