Created
January 23, 2015 16:53
-
-
Save Partyschaum/4681edd68bb104ed95bf to your computer and use it in GitHub Desktop.
fakes3 init script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# /etc/init.d/fakes3 | |
### BEGIN INIT INFO | |
# Provides: fakes3 | |
# Required-Start: $local_fs | |
# Required-Stop: | |
# Should-Start: fakes3 --port 4567 --root /tmp/fakes3 | |
# Should-Stop: fakes3 --port 4567 --root /tmp/fakes3 | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: A lightweight server clone of Amazon S3 | |
# Description: fakes3 simulates most of the commands supported by S3 with minimal dependencies | |
### END INIT INFO | |
set -e | |
DAEMON=/usr/bin/fakes3 | |
OPTIONS="--port 4567 --root /tmp/fakes3" | |
NAME=fakes3 | |
PIDFILE=/var/run/$NAME.pid | |
test -x $DAEMON || exit 0 | |
. /lib/lsb/init-functions | |
case "$1" in | |
start) | |
log_daemon_msg "Starting $NAME" | |
$DAEMON $OPTIONS & | |
echo $! > $PIDFILE | |
;; | |
stop) | |
log_daemon_msg "Stopping $NAME" | |
kill -9 `cat $PIDFILE` && rm $PIDFILE | |
;; | |
*) | |
echo "Usage: /etc/init.d/$NAME {start|stop}" >&2 | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment