Permalink
Browse files

upstart now uses ip var defined on ubuntu default file

  • Loading branch information...
morpheu committed Jan 6, 2014
1 parent 3e6bc50 commit a922636d9f21a3d639a4f5c1610868c097c51b38
Showing with 20 additions and 2 deletions.
  1. +20 −2 debian/thumbor-worker.upstart
@@ -1,7 +1,7 @@
description "Thumbor image manipulation service"
author "Wichert Akkerman <wichert@wiggy.net>"
-stop on stopped thumbor
+stop on stopping thumbor
respawn
respawn limit 5 10
@@ -20,4 +20,22 @@ chdir /var/lib/thumbor
instance $p
-exec $DAEMON -c "${conffile}" -i "${ip}" -k "${keyfile}" -p "${p}"
+pre-start script
+ [ -r /etc/default/thumbor ] && . /etc/default/thumbor
+ if [ "$enabled" = "0" ] && [ "$force" != "1" ] ; then
+ logger -is -t "$UPSTART_JOB" "Thumbor is disabled by /etc/default/thumbor, add force=1 to your service command"
+ stop
+ exit 0
+ fi
+ exec >"/tmp/${UPSTART_JOB}-${p}"
+ echo "ip=${ip}"
+end script
+
+script
+ . "/tmp/${UPSTART_JOB}-${p}"
+ $DAEMON -c "${conffile}" -i "${ip}" -k "${keyfile}" -p "${p}" -l debug
+end script
+
+post-start script
+ rm -f "/tmp/$UPSTART_JOB-${p}"
+end script

0 comments on commit a922636

Please sign in to comment.