From 0f239dc8835df634d17d3281f12d58603ee68a68 Mon Sep 17 00:00:00 2001 From: Jochen Schalanda Date: Sun, 20 Mar 2011 15:18:58 +0100 Subject: [PATCH] Updated Debian package specs for version 0.1 --- extra/debian/changelog | 6 ++++++ extra/debian/default | 2 +- extra/debian/init.d | 8 ++++++-- extra/debian/postinst | 18 ++++++++++++------ 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/extra/debian/changelog b/extra/debian/changelog index a5b2bf6..d96f934 100644 --- a/extra/debian/changelog +++ b/extra/debian/changelog @@ -1,3 +1,9 @@ +foreman-proxy (0.1-1) unstable; urgency=low + + * First public release + + -- Jochen Schalanda Sun, 20 Mar 2011 14:58:00 +0100 + foreman-proxy (0.0.2-1) unstable; urgency=low * Initial release diff --git a/extra/debian/default b/extra/debian/default index 0ee43df..56c3277 100644 --- a/extra/debian/default +++ b/extra/debian/default @@ -1,6 +1,6 @@ # Defaults for smart-proxy initscript # sourced by /etc/init.d/foreman-proxy -DAEMON_USER="foreman-proxy:foreman-proxy" +DAEMON_USER="foreman:foreman" DAEMON_HOME="/usr/share/foreman-proxy" DAEMON_ARGS="" diff --git a/extra/debian/init.d b/extra/debian/init.d index 2cafb8b..640a886 100644 --- a/extra/debian/init.d +++ b/extra/debian/init.d @@ -40,11 +40,15 @@ SCRIPTNAME=/etc/init.d/$NAME do_start() { PIDFILE_DIR=$(dirname $PIDFILE) - if [ ! -x $PIDFILE_DIR ] - then + if [ ! -x $PIDFILE_DIR ]; then mkdir -p $PIDFILE_DIR && chown $DAEMON_USER $PIDFILE_DIR fi + TMP_DIR=/usr/share/$NAME/tmp + if [ ! -x $TMP_DIR ]; then + mkdir -p $TMP_DIR && chown $DAEMON_USER $TMP_DIR + fi + # Return # 0 if daemon has been started # 1 if daemon was already running diff --git a/extra/debian/postinst b/extra/debian/postinst index af46ed6..fd6224f 100644 --- a/extra/debian/postinst +++ b/extra/debian/postinst @@ -5,6 +5,10 @@ set -e +USERNAME="foreman" +GROUPNAME="foreman" +FOREMAN_HOME="/usr/share/foreman-proxy" + # summary of how this script can be called: # * `configure' # * `abort-upgrade' @@ -19,12 +23,14 @@ set -e case "$1" in configure) - getent group foreman-proxy >/dev/null || groupadd -r foreman-proxy - getent passwd foreman-proxy >/dev/null || \ - useradd -r -g foreman-proxy -d /usr/share/foreman-proxy -s /usr/sbin/nologin -c "Foreman Smart-Proxy" foreman-proxy - - chown 'foreman-proxy:foreman-proxy' '/usr/share/foreman-proxy/logs' - chown 'foreman-proxy:foreman-proxy' '/var/log/foreman-proxy' + getent group $GROUPNAME >/dev/null || groupadd -r $GROUPNAME + getent passwd $USERNAME >/dev/null || \ + useradd -r -g $GROUPNAME -d $FOREMAN_HOME -s /usr/sbin/nologin -c "Foreman" $USERNAME + + mkdir -p "$FOREMAN_HOME/tmp" + chown $USERNAME:$GROUPNAME "$FOREMAN_HOME/tmp" + chown $USERNAME:$GROUPNAME "$FOREMAN_HOME/logs" + chown $USERNAME:$GROUPNAME "/var/log/foreman-proxy" ;; abort-upgrade|abort-remove|abort-deconfigure) -- 1.7.4.1