[Pkg-voip-commits] r2367 - op-panel/trunk/debian
Alejandro Rios P.
alerios-guest at costa.debian.org
Sun Sep 10 21:06:28 UTC 2006
Author: alerios-guest
Date: 2006-09-10 21:06:28 +0000 (Sun, 10 Sep 2006)
New Revision: 2367
Added:
op-panel/trunk/debian/postrm
Modified:
op-panel/trunk/debian/postinst
Log:
* Applied patch from Diego Iastrubni to run op-panel as a separate user.
Modified: op-panel/trunk/debian/postinst
===================================================================
--- op-panel/trunk/debian/postinst 2006-09-10 21:00:55 UTC (rev 2366)
+++ op-panel/trunk/debian/postinst 2006-09-10 21:06:28 UTC (rev 2367)
@@ -17,10 +17,31 @@
# the debian-policy package
#
+USER=op-panel
+GROUP=asterisk
+
case "$1" in
configure)
- touch /usr/share/op-panel/flash/variables.txt
-
+ # lets run op-panel in a separate user
+ if ! (getent passwd $USER >/dev/null) ; then
+ adduser --system --group --home /var/lib/$USER --gecos "Flash Operator Panel user" $USER
+ adduser $USER $GROUP
+ fi
+
+ touch /var/lib/op-panel/variables.txt
+ touch /var/run/op-panel.pid
+
+ chown -R $USER.$GROUP /var/lib/op-panel/
+ chmod -R g+rw /var/lib/op-panel/
+ chown -R $USER.$GROUP /etc/op-panel/asternic/
+ chmod -R g+rw /etc/op-panel/asternic/
+ chown -R $USER.$GROUP /var/log/op-panel/
+ chmod -R g+rw /var/log/op-panel/
+ chown $USER.$GROUP /var/run/op-panel.pid
+ chmod g+rw /var/run/op-panel.pid
+ chown -R $USER.$GROUP /usr/share/op-panel/
+ chmod -R g+rw /usr/share/op-panel/
+
for i in op_server op_buttons op_astdb op_style; do
if [ -a /etc/op-panel/$i.cfg ]; then
cp -ba /etc/op-panel/$i.cfg /etc/op-panel/$i.old
@@ -35,7 +56,6 @@
--slave /etc/op-panel/op_astdb.cfg op-astdb-cfg /etc/op-panel/asternic/op_astdb.cfg \
--slave /etc/op-panel/op_style.cfg op-style-cfg /etc/op-panel/asternic/op_style.cfg
- /etc/init.d/op-panel restart
;;
abort-upgrade|abort-remove|abort-deconfigure)
Added: op-panel/trunk/debian/postrm
===================================================================
--- op-panel/trunk/debian/postrm (rev 0)
+++ op-panel/trunk/debian/postrm 2006-09-10 21:06:28 UTC (rev 2367)
@@ -0,0 +1,43 @@
+#! /bin/sh
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+USER=op-panel
+
+case "$1" in
+ purge)
+ # remove files
+ rm -fr /var/lib/op-panel/
+ rm -fr /var/log/op-panel/
+ rm -fr /var/run/op-panel.pid
+
+ deluser $USER
+ ;;
+
+ remove|abort-install|disappear|upgrade)
+ ;;
+
+ abort-upgrade|failed-upgrade)
+ ;;
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
More information about the Pkg-voip-commits
mailing list