Skip to content

Instantly share code, notes, and snippets.

@babo
Created May 13, 2015 10:04
Show Gist options
  • Select an option

  • Save babo/064094f8708562099ced to your computer and use it in GitHub Desktop.

Select an option

Save babo/064094f8708562099ced to your computer and use it in GitHub Desktop.
shut down the instance
diff --git i/viewstart/viewstart.service w/viewstart/viewstart.service
index f6cd660..c2c0fc0 100644
--- i/viewstart/viewstart.service
+++ w/viewstart/viewstart.service
@@ -13,6 +13,7 @@ ExecStartPre=/bin/sh -c 'docker ps -a | grep ${NAME} > /dev/null; if [ $? -eq 0
ExecStart=/usr/bin/docker run --name ${NAME} -v /src:/src -v /input:/input ${IMAGE}
ExecStop=/bin/sh -c 'docker ps | grep ${NAME} > /dev/null; if [ $? -eq 0 ] ; then docker stop ${NAME} ; fi'
ExecStopPost=/bin/sh -c 'docker ps -a | grep ${NAME} > /dev/null; if [ $? -eq 0 ] ; then docker rm ${NAME} ; fi'
+ExecStopPost=/usr/bin/sudo /usr/sbin/poweroff
[Install]
WantedBy=multi-user.target
diff --git i/viewstart/viewstart/runit.sh w/viewstart/viewstart/runit.sh
index b9e230b..3dd5e38 100755
--- i/viewstart/viewstart/runit.sh
+++ w/viewstart/viewstart/runit.sh
@@ -11,4 +11,4 @@ else
WORKER='/viewstart'
fi
-env NODE_PATH="/viewstart/node_modules:/src/node_modules" node "${WORKER}/worker.js"
+exec env NODE_PATH="/viewstart/node_modules:/src/node_modules" node "${WORKER}/worker.js"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment