Skip to content

Instantly share code, notes, and snippets.

@nathanborror
Last active August 9, 2016 10:04
Show Gist options
  • Save nathanborror/89f5d10e5e6e3c1243a2 to your computer and use it in GitHub Desktop.
Save nathanborror/89f5d10e5e6e3c1243a2 to your computer and use it in GitHub Desktop.
description "start and stop the go program 'my-project'"
start on filesystem or runlevel [2345]
stop on runlevel [!2345]
env USER='ubuntu'
env APP_DIR='/home/ubuntu/go/src/github.com/your-username/your-project-name/'
env APP_EXEC='your-project-name'
exec start-stop-daemon —start —chuid ${USER} —chdir ${APP_DIR} —exec ${APP_DIR}${APP_EXEC}
@juandiegoh
Copy link

I had to change your

exec start-stop-daemon —start —chuid ${USER} —chdir ${APP_DIR} —exec ${APP_DIR}${APP_EXEC}

with (-- instead of —)

exec start-stop-daemon --start --chuid ${USER} --chdir ${APP_DIR} --exec ${APP_DIR}${APP_EXEC}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment