Skip to content
Permalink
Browse files

Add control script and nginx.conf templates. Update spec and monit fi…

…les.
  • Loading branch information...
krasio committed Dec 20, 2018
1 parent c8faf1e commit 9801c1f94549110c1bf02917fef63a9d992d3120
Showing with 42 additions and 0 deletions.
  1. +5 −0 jobs/app/monit
  2. +9 −0 jobs/app/spec
  3. +28 −0 jobs/app/templates/ctl.erb
@@ -0,0 +1,5 @@
check process app
with pidfile /var/vcap/sys/run/app/app.pid
start program "/var/vcap/jobs/app/bin/ctl start"
stop program "/var/vcap/jobs/app/bin/ctl stop"
group vcap
@@ -0,0 +1,9 @@
---
name: app

templates:
ctl.erb: bin/ctl

packages: []

properties: {}
@@ -0,0 +1,28 @@
#!/bin/bash

RUN_DIR=/var/vcap/sys/run/app
LOG_DIR=/var/vcap/sys/log/app
PIDFILE=${RUN_DIR}/app.pid

case $1 in

start)
mkdir -p $RUN_DIR $LOG_DIR
chown -R vcap:vcap $RUN_DIR $LOG_DIR

/var/vcap/packages/akoranga-go/akoranga-go \
>> $LOG_DIR/app.stdout.log \
2>> $LOG_DIR/app.stderr.log & echo $! > $PIDFILE

;;

stop)
kill `cat $PIDFILE`
rm -f $PIDFILE

;;

*)
echo "Usage: ctl {start|stop}" ;;

esac

0 comments on commit 9801c1f

Please sign in to comment.
You can’t perform that action at this time.