Skip to content

Instantly share code, notes, and snippets.

@mxey
Created December 7, 2013 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxey/7835706 to your computer and use it in GitHub Desktop.
Save mxey/7835706 to your computer and use it in GitHub Desktop.
#!/bin/sh
. /etc/rc.subr
name=ghost
rcvar=ghost_enable
command="/opt/ghost/index.js"
command_interpreter="/usr/local/bin/node"
ghost_user="ghost"
start_cmd="${name}_start"
ghost_start() {
cd /opt/ghost
export NODE_ENV=production
daemon -u ${ghost_user} ${command_interpreter} ${command} 2>&1 | daemon -u ${ghost_user} logger -t ${name}
}
load_rc_config $name
run_rc_command "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment