Skip to content

Commit

Permalink
Merge pull request #46 from davidzuhn/feature/use-init-for-startup
Browse files Browse the repository at this point in the history
Feature/use init for startup
  • Loading branch information
Brian Parry committed Aug 2, 2016
2 parents 24a2e1f + 3bb9b56 commit 8b22b46
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 17 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# package detritus
packagebuild/
on-tftp_*.dsc
on-tftp_*.tar.gz
on-tftp_*.tar.xz
on-tftp_*.build
on-tftp_*.changes
on-tftp_*.deb

# Logs
logs
*.log
Expand Down
48 changes: 48 additions & 0 deletions debian/on-tftp.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh

. /lib/lsb/init-functions

### BEGIN INIT INFO
# Provides: on-tftp
# Required-Start: $syslog $network mongodb rabbitmq-server
# Required-Stop: $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: on-tftp
# Description: RackHD on-tftp service
### END INIT INFO

DESC="on-tftp"

CONFIG=/etc/default/on-tftp
LOGFILE=/var/log/on-tftp.log

do_start()
{
if [ -f "$CONFIG" ]
then
cd /var/renasar/on-tftp
/usr/bin/nodejs /var/renasar/on-tftp/index.js >> "$LOGFILE" 2>&1 &
log_success_msg "Started on-tftp daemon"
else
log_failure_msg "Config file $CONFIG missing, not starting"
fi
}


ACTION=$1

case "$ACTION" in

start)
do_start
;;
stop | restart | reload | force-reload | status)
# unimplemented
;;
*)
logger "Unknown action \"$ACTION\""
;;
esac

exit 0
17 changes: 0 additions & 17 deletions debian/on-tftp.upstart

This file was deleted.

0 comments on commit 8b22b46

Please sign in to comment.