Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/system-configs/upstart-configs/units/webida-batch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!upstart
description "Webida batch"
author "Webida team"

start on startup
stop on shutdown

# Set the priv of scripts
# If this not not set, the Webida server will be run as root and it'll be a disaster.
setuid webida

# This let upstart track the child process of forever.
# Because forever spawns another monitor process and exits, this is required.
expect fork

env WEBIDA_HOME="/home/webida"
env SERVER_DIR="webida-server/src/server"
env LOG="/dev/null"
env NODE_ENV='production'

env SCRIPT="unit-manager.js svc=batch0"

script
exec forever --sourceDir "$SERVER_ROOT/$SERVER_DIR" -a -l $LOG --minUptime 5000 --spinSleepTime 2000 start $SCRIPT
end script

pre-stop script
exec forever stop $SCRIPT
end script