[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#771929: (pre-approved) unblock: openstack-pkg-tools/20



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Dear release team,

Reproducing a message as a bug, as this is the prefered form.

I just wanted to let you know that it's been since the freeze that some
contributors and myself are aware of the very poor systemd support in
OpenStack which can lead to the service not being brought up at boot time.

Since we are slowly approaching the deep freeze deadline of the 5th of
December, I thought it was a good idea to let the release team know.

We're currently working on the issue, but this will mean:
- Update openstack-pkg-tools
- Rebuild all OpenStack packages for which daemon startups are handled
by openstack-pkg-tools

I believe that Mikaël Cluseau (hereby CC) has found a satisfying
solution, though it will need to be tested. His patch can be seen here:

http://lists.alioth.debian.org/pipermail/openstack-devel/2014-December/007950.html

(since I know some of you guys don't like web links and prefer to just read in
the body of the message, I've reproduced the patch at the end of this message)

Since systemd is the default in Jessie, I hope the release team will let
us fix things before the release. Please let me know if I have to worry
that the necessary patches wont be accepted...

Cheers,

Thomas Goirand (zigo)

P.S: Note that I am not a systemd user myself, though I do consider
systemd support every important since it's what we've choose as default.

commit 8b3217905de88f2037f0bbc6eac46dca776c8f48
Author: Mikaël Cluseau <mcluseau at isi.nc>
Date:   Sun Nov 30 18:45:25 2014 +1100

     Fix for bug #770706
---
  init-template/init-script-template   | 23 +++++++++++++----------
  init-template/pkgos-gen-systemd-unit | 10 +++++-----
  2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/init-template/init-script-template 
b/init-template/init-script-template
index 0326b5d..fd20957 100644
--- a/init-template/init-script-template
+++ b/init-template/init-script-template
@@ -36,11 +36,13 @@ fi
  # Exit if the package is not installed
  [ -x $DAEMON ] || exit 0

-# Create /var/lock/X, /var/run/X, /var/lib/X and /var/log/X
-for i in lock run log lib ; do
-    mkdir -p /var/$i/${PROJECT_NAME}
-    chown ${SYSTEM_USER} /var/$i/${PROJECT_NAME}
-done
+# If ran as root, create /var/lock/X, /var/run/X, /var/lib/X and 
/var/log/X as needed
+if [ "x$USER" = "xroot" ] ; then
+    for i in lock run log lib ; do
+        mkdir -p /var/$i/${PROJECT_NAME}
+        chown ${SYSTEM_USER} /var/$i/${PROJECT_NAME}
+    done
+fi

  # This defines init_is_upstart which we use later on (+ more...)
  . /lib/lsb/init-functions
@@ -65,6 +67,10 @@ do_stop() {
      return "$RETVAL"
  }

+do_systemd_start() {
+    exec $DAEMON $DAEMON_ARGS
+}
+
  case "$1" in
  start)
      init_is_upstart > /dev/null 2>&1 && exit 1
@@ -88,11 +94,8 @@ status)
      status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
  ;;
  systemd-start)
-    do_start
+    do_systemd_start
  ;;
-systemd-stop)
-    do_stop
-;;
  restart|force-reload)
      init_is_upstart > /dev/null 2>&1 && exit 1
      log_daemon_msg "Restarting $DESC" "$NAME"
@@ -110,7 +113,7 @@ restart|force-reload)
      esac
  ;;
  *)
-    echo "Usage: $SCRIPTNAME 
{start|stop|status|restart|force-reload|systemd-start|systemd-stop}" >&2
+    echo "Usage: $SCRIPTNAME 
{start|stop|status|restart|force-reload|systemd-start}" >&2
      exit 3
  ;;
  esac
diff --git a/init-template/pkgos-gen-systemd-unit 
b/init-template/pkgos-gen-systemd-unit
index b97e2a9..4c41ef0 100755
--- a/init-template/pkgos-gen-systemd-unit
+++ b/init-template/pkgos-gen-systemd-unit
@@ -12,7 +12,7 @@ fi
  if [ -z "${SYSTEM_USER}" ] ; then
      SYSTEM_USER=${PROJECT_NAME}
  fi
-if [ -z "${SYSTEM_USER}" ] ; then
+if [ -z "${SYSTEM_GROUP}" ] ; then
      SYSTEM_GROUP=${PROJECT_NAME}
  fi

@@ -33,12 +33,12 @@ $AFTER
  [Service]
  User=${SYSTEM_USER}
  Group=${SYSTEM_GROUP}
+WorkingDirectory=/var/lib/${PROJECT_NAME}
+PermissionsStartOnly=true
+ExecStartPre=/bin/mkdir -p /var/lock/${PROJECT_NAME} 
/var/log/${PROJECT_NAME} /var/lib/${PROJECT_NAME}
+ExecStartPre=/bin/chown ${SYSTEM_USER}:${SYSTEM_GROUP} 
/var/lock/${PROJECT_NAME} /var/log/${PROJECT_NAME} /var/lib/${PROJECT_NAME}
  ExecStart=${SCRIPTNAME} systemd-start
-ExecStop=${SCRIPTNAME} systemd-stop
-RuntimeDirectory=${PROJECT_NAME}
-PIDFile=/var/run/${PROJECT_NAME}/${NAME}.pid
  Restart=on-failure
-Type=forking

  [Install]
  WantedBy=multi-user.target


Reply to: