git://git.onelab.eu
/
nodemanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
do not call lsof, this is useless and produces huge logs
[nodemanager.git]
/
initscripts
/
nm
diff --git
a/initscripts/nm
b/initscripts/nm
index
cb58689
..
13f30ed
100755
(executable)
--- a/
initscripts/nm
+++ b/
initscripts/nm
@@
-1,48
+1,38
@@
#!/bin/bash
#
#!/bin/bash
#
-# $Id$
-# $URL$
-#
# nm Starts and stops Node Manager daemon
#
# nm Starts and stops Node Manager daemon
#
-# chkconfig: 3
86
26
+# chkconfig: 3
97
26
# description: Starts and stops Node Manager daemon
#
# Source function library.
. /etc/init.d/functions
# description: Starts and stops Node Manager daemon
#
# Source function library.
. /etc/init.d/functions
-[ -f /etc/sysconfig/NodeManager ] && . /etc/sysconfig/NodeManager
+[ -f /etc/sysconfig/nodemanager ] && . /etc/sysconfig/nodemanager
+
+# Wait for libvirt to finish initializing
+sleep 10
-options=${OPTIONS-"-d -s"}
-restartoptions=${RESTARTOPTIONS-"-d"}
+options=${OPTIONS-"-d"}
# turn on verbosity
verboseoptions=${DEBUGOPTIONS-"-v -d"}
# turn on verbosity
verboseoptions=${DEBUGOPTIONS-"-v -d"}
-# debug mode is interactive, and has faster period
+# debug mode is interactive, and has faster period
+# run in deamon mode with service nm restardebug -d
debugoptions=${DEBUGOPTIONS-"-v -p 30 -r 15"}
debugoptions=${DEBUGOPTIONS-"-v -p 30 -r 15"}
-n
m=${NM-"python /usr/share/NodeManager/nm
.py"}
+n
odemanager=${NODEMANAGER-"python /usr/share/NodeManager/nodemanager
.py"}
prog="Node Manager"
prog="Node Manager"
-pidfile=${PIDFILE-/var/run/nm.pid}
-lockfile=${LOCKFILE-/var/lock/subsys/nm}
+pidfile=${PIDFILE-/var/run/nodemanager.pid}
RETVAL=0
function start() {
RETVAL=0
function start() {
- echo -n $"Starting $prog: "
- daemon --check=nm $nm "$@"
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch ${lockfile}
- return $RETVAL
+ action $"Starting $prog: " daemon --pidfile=$pidfile --check=nodemanager $nodemanager "$@"
}
function stop() {
}
function stop() {
- echo -n $"Stopping $prog: "
- killproc nm
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && rm -f ${lockfile} ${pidfile}
+ action $"Stopping $prog: " killproc -p $pidfile nodemanager
}
case "$1" in
}
case "$1" in
@@
-53,28
+43,28
@@
case "$1" in
stop
;;
status)
stop
;;
status)
- status
$nm
+ status
-p $pidfile nodemanager
RETVAL=$?
;;
restart|reload)
shift
stop
RETVAL=$?
;;
restart|reload)
shift
stop
- start $
restart
options "$@"
+ start $options "$@"
;;
condrestart)
shift
;;
condrestart)
shift
- [ -f ${pidfile} ] && { stop; start $
restart
options "$@"; }
+ [ -f ${pidfile} ] && { stop; start $options "$@"; }
;;
restartverbose)
shift
stop
;;
restartverbose)
shift
stop
- $n
m
$verboseoptions "$@"
+ $n
odemanager
$verboseoptions "$@"
;;
restartdebug)
shift
stop
echo "Restarting with $debugoptions $@ .."
;;
restartdebug)
shift
stop
echo "Restarting with $debugoptions $@ .."
- $n
m
$debugoptions "$@"
+ $n
odemanager
$debugoptions "$@"
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|restartdebug [-d]}"
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|restartdebug [-d]}"