Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/etc/default/*; fixed incorrect path #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions debian/mogilefsd.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Defaults for mogilefsd - sourced by /etc/init.d/mogilefsd

# Start mogilefsd on boot?
START=yes

# Startup options
DAEMON_OPTS=""

MOGILEFSD_RUNASUSER=mogile
33 changes: 19 additions & 14 deletions debian/mogilefsd.init
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/mogilefsd
DAEMON=/usr/local/bin/mogilefsd
NAME=mogilefsd
DESC=mogilefsd
DEFAULTS=/etc/default/$NAME
PIDDIR=/var/run/$NAME
PIDFILE=$PIDDIR/$NAME.pid
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
Expand Down Expand Up @@ -48,13 +47,6 @@ set -e
#
do_start()
{

if ! test -d ${PIDDIR}
then
mkdir ${PIDDIR}
chown ${MOGILEFSD_RUNASUSER} ${PIDDIR}
fi

if [ -e $PIDFILE ]
then

Expand All @@ -69,7 +61,7 @@ do_start()

fi

start-stop-daemon --start --quiet --exec $DAEMON -b --name $NAME --chuid $MOGILEFSD_RUNASUSER -- $MOGILEFSD_EXTRA_OPTS
start-stop-daemon --start --quiet --exec $DAEMON --pidfile $PIDFILE -b -m --name $NAME --chuid $MOGILEFSD_RUNASUSER
}

#
Expand All @@ -81,6 +73,16 @@ do_stop()
rm -f $PIDFILE
}

do_status()
{
if [ -f ${PIDFILE} ]; then
echo $NAME: running.
else
echo $NAME: not running.
exit 5
fi
}

case "$1" in
start)
echo -n "Starting $DESC: "
Expand All @@ -105,11 +107,14 @@ case "$1" in
do_start
echo "$NAME."
;;
status)
do_status
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
exit 3
;;
esac

:
:
9 changes: 9 additions & 0 deletions debian/mogstored.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Defaults for mogstored - sourced by /etc/init.d/mogstored

# Start mogstored on boot?
START=yes

# Startup options
DAEMON_OPTS=""

MOGSTORED_RUNASUSER=mogile
31 changes: 18 additions & 13 deletions debian/mogstored.init
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/mogstored
DAEMON=/usr/local/bin/mogstored
NAME=mogstored
DESC=mogstored
DEFAULTS=/etc/default/$NAME
PIDDIR=/var/run/$NAME
PIDFILE=$PIDDIR/$NAME.pid
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
Expand Down Expand Up @@ -48,12 +47,6 @@ set -e
#
do_start()
{
if ! test -d ${PIDDIR}
then
mkdir ${PIDDIR}
chown ${MOGSTORED_RUNASUSER} ${PIDDIR}
fi

if [ -e $PIDFILE ]
then

Expand All @@ -80,6 +73,16 @@ do_stop()
rm -f $PIDFILE
}

do_status()
{
if [ -f ${PIDFILE} ]; then
echo $NAME: running.
else
echo $NAME: not running.
exit 5
fi
}

case "$1" in
start)
echo -n "Starting $DESC: "
Expand All @@ -91,7 +94,9 @@ case "$1" in
do_stop
echo "$NAME."
;;

status)
do_status
;;
restart|force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
Expand All @@ -105,10 +110,10 @@ case "$1" in
echo "$NAME."
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
exit 3
;;
esac

:
: