------------------------------------------------------------
revno: 17
committer: Dimitri John Ledkov <[email protected]>
branch nick: upstart-jobs
timestamp: Thu 2014-01-16 12:08:34 +0000
message:
  auto update
modified:
  etc/init/lxc-instance.conf
  etc/init/lxc.conf
  etc/init/pollen.conf
  etc/init/pollinate.conf


--
lp:~upstart-devel/upstart/upstart-jobs
https://code.launchpad.net/~upstart-devel/upstart/upstart-jobs

Your team Upstart Reviewers is subscribed to branch 
lp:~upstart-devel/upstart/upstart-jobs.
To unsubscribe from this branch go to 
https://code.launchpad.net/~upstart-devel/upstart/upstart-jobs/+edit-subscription
=== modified file 'etc/init/lxc-instance.conf'
--- etc/init/lxc-instance.conf	2013-11-18 12:42:03 +0000
+++ etc/init/lxc-instance.conf	2014-01-16 12:08:34 +0000
@@ -11,17 +11,12 @@
 
 
 instance $NAME
-usage "NAME=name of LXC instance, CONFIG=full path to configuration file"
+usage "NAME=name of LXC instance"
 
 pre-start script
-	LXC_PATH=$(dirname $(dirname $(readlink $CONFIG)))
-
-	lxc-info -P $LXC_PATH -n $NAME 2>/dev/null | grep state | grep -q "RUNNING" && { stop; exit 0; }
-	[ -f $CONFIG ] || { stop; exit 0; }
+	lxc-wait -s RUNNING -n $NAME -t 0 && { stop; exit 0; } || true
 end script
 
 script
-	LXC_PATH=$(dirname $(dirname $(readlink $CONFIG)))
-
-	exec lxc-start -P $LXC_PATH -n $NAME
+	exec lxc-start -n $NAME
 end script

=== modified file 'etc/init/lxc.conf'
--- etc/init/lxc.conf	2013-11-18 12:42:03 +0000
+++ etc/init/lxc.conf	2014-01-16 12:08:34 +0000
@@ -20,9 +20,8 @@
 
 	[ "x$LXC_AUTO" = "xtrue" ] || exit 0
 
-	ls /etc/lxc/auto/* > /dev/null 2>&1 || exit 0
-	for f in /etc/lxc/auto/*; do
-		c="$(basename $f .conf)"
-		start lxc-instance NAME=$c CONFIG=$f
+	lxc-autostart -L | while read line; do
+		set -- $line
+		(start lxc-instance NAME=$1 && sleep $2) || true
 	done
 end script

=== modified file 'etc/init/pollen.conf'
--- etc/init/pollen.conf	2013-11-18 12:42:03 +0000
+++ etc/init/pollen.conf	2014-01-16 12:08:34 +0000
@@ -6,18 +6,22 @@
 start on start on runlevel [2345]
 stop on start on runlevel [!2345]
 
+setuid pollen
 respawn
 respawn limit 10 5
 
 script
 	. /etc/default/pollen
-	if [ -n "$HTTP_PORT" ] && [ -n "$HTTPS_PORT" ]; then
-		exec go run /usr/share/pollen/pollen.go $HTTP_PORT $HTTPS_PORT
-	elif [ -n "$HTTP_PORT" ] && [ -z "$HTTPS_PORT" ]; then
-		exec go run /usr/share/pollen/pollen.go $HTTP_PORT 0
-	elif [ -z "$HTTP_PORT" ] && [ -n "$HTTPS_PORT" ]; then
-		exec go run /usr/share/pollen/pollen.go 0 $HTTPS_PORT
-	else
-		exec true
+	# Ensure our device exists, and is a character device, before starting our server
+	if [ -c "$DEVICE" ]; then
+		if [ -n "$HTTP_PORT" ] && [ -n "$HTTPS_PORT" ]; then
+			exec pollen $HTTP_PORT $HTTPS_PORT $DEVICE
+		elif [ -n "$HTTP_PORT" ] && [ -z "$HTTPS_PORT" ]; then
+			exec pollen $HTTP_PORT 0 $DEVICE
+		elif [ -z "$HTTP_PORT" ] && [ -n "$HTTPS_PORT" ]; then
+			exec pollen 0 $HTTPS_PORT $DEVICE
+		else
+			exec true
+		fi
 	fi
 end script

=== modified file 'etc/init/pollinate.conf'
--- etc/init/pollinate.conf	2013-11-18 12:42:03 +0000
+++ etc/init/pollinate.conf	2014-01-16 12:08:34 +0000
@@ -3,9 +3,11 @@
 description	"Entropy-as-a-Service client"
 author		"Dustin Kirkland <[email protected]>"
 
+setuid daemon
+
 start on (started networking or starting ssh)
 
 script
 	. /etc/default/pollinate
-	exec pollinate $OPTS
+	exec pollinate
 end script

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to