Commit 290176af authored by Rafael Monnerat's avatar Rafael Monnerat

playbook: Fix daemon path and add verbose

  daemon can conflict with the the function available on centos functions.
parent ea8a2fd4
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
# PATH should only include /usr/* if it runs after the mountnfs.sh script # PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
NAME=re6stnet NAME=re6stnet
DESC="Resilient, Scalable, IPv6 Network application" DESC="Resilient, Scalable, IPv6 Network application"
DAEMON=/opt/re6st/bin/$NAME DAEMON=/usr/bin/$NAME
CONFDIR=/etc/re6stnet CONFDIR=/etc/re6stnet
PIDFILE=/var/run/$NAME.pid PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME SCRIPTNAME=/etc/init.d/$NAME
...@@ -26,37 +26,41 @@ LOCKFILE=/var/lock/subsys/re6stnet ...@@ -26,37 +26,41 @@ LOCKFILE=/var/lock/subsys/re6stnet
# Source function library. # Source function library.
. /etc/init.d/functions . /etc/init.d/functions
start() { start() {
echo -n "Starting $NAME: " echo -n "Starting $NAME: "
daemon --user root -n $NAME --pidfile=$PIDFILE -D $CONFDIR -- $DAEMON @re6stnet.conf /usr/local/bin/daemon --user root -n $NAME --pidfile=$PIDFILE -D $CONFDIR -- $DAEMON @re6stnet.conf
RETVAL=$? RETVAL=$?
[ $RETVAL -eq 0 ] && touch $LOCKFILE [ $RETVAL -eq 0 ] && touch $LOCKFILE
[ $RETVAL -eq 0 ] && echo OK || echo FAIL
echo echo
return $RETVAL return $RETVAL
} }
stop() { stop() {
echo -n "Shutting down $NAME: " echo -n "Shutting down $NAME: "
daemon --user root -n $NAME --pidfile=$PIDFILE --stop /usr/local/bin/daemon --user root -n $NAME --pidfile=$PIDFILE --stop
RETVAL=$? RETVAL=$?
[ $RETVAL -eq 0 ] && rm -rf $LOCKFILE [ $RETVAL -eq 0 ] && rm -rf $LOCKFILE
[ $RETVAL -eq 0 ] && echo OK || echo FAIL
echo echo
return $RETVAL return $RETVAL
} }
status() { status() {
echo -n "Status for $NAME: " echo -n "Status for $NAME: "
daemon --user root -n $NAME --pidfile=$PIDFILE --running /usr/local/bin/daemon --user root -n $NAME --pidfile=$PIDFILE --running
RETVAL=$?
[ $RETVAL -eq 0 ] && echo OK || echo FAIL
echo
return $RETVAL
} }
restart() { restart() {
echo -n "Restarting $NAME: " echo -n "Restarting $NAME: "
daemon --user root -n $NAME --pidfile=$PIDFILE -D $CONFDIR --restart -- $DAEMON @re6stnet.conf /usr/local/bin/daemon --user root -n $NAME --pidfile=$PIDFILE -D $CONFDIR --restart -- $DAEMON @re6stnet.conf
RETVAL=$? RETVAL=$?
[ $RETVAL -eq 0 ] && touch $LOCKFILE [ $RETVAL -eq 0 ] && touch $LOCKFILE
[ $RETVAL -eq 0 ] && echo OK || echo FAIL
echo echo
return $RETVAL return $RETVAL
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment