2015-04-27 13:59:35 +01:00

53 lines
565 B
Plaintext

#!/sbin/runscript
extra_started_commands="reload"
PM2=%PM2_PATH%
USER=%USER%
export PATH=%NODE_PATH%:$PATH
export PM2_HOME="%HOME_PATH%"
super() {
su - $USER -c "PATH=$PATH; PM2_HOME=$PM2_HOME $*"
}
depend() {
use net localmount
after bootmisc
}
start() {
ebegin "Starting PM2"
super $PM2 resurrect
eend $?
}
stop() {
ebegin "Stopping PM2"
super $PM2 dump
super $PM2 delete all
super $PM2 kill
eend
}
reload() {
ebegin "Reloading PM2"
super $PM2 reload all
eend $?
}
status() {
ebegin "Status for PM2"
super $PM2 list
eend $?
}