Skip to content

Instantly share code, notes, and snippets.

@hidsh
Created November 23, 2011 01:13
Show Gist options
  • Save hidsh/1387640 to your computer and use it in GitHub Desktop.
Save hidsh/1387640 to your computer and use it in GitHub Desktop.
sample of startup script for debian 6
#!/bin/sh
### BEGIN INIT INFO
# Provides: startup test
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: test for startup script.
# Description: test for startup script.
### END INIT INFO
# install:
# 1. put this file into /etc/init.d/test
# 2. chmod +x test
# 3. update-rc.d test defaults
#
# uninstall:
# update-rc.d test remove
start() {
echo -n "Starting test-daemon: test start"
# do something
echo "."
return 0
}
stop() {
echo -n "Stopping test-daemon: test stop"
# do something
echo "."
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
esac
# this file ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment