-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
402 additions
and
29 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#!/bin/bash | ||
# | ||
# /etc/rc.d/init.d/updatempppathd | ||
# | ||
# Starts the daemon which updates all MPP LUN paths | ||
# | ||
# chkconfig: 2345 19 76 | ||
# description: Manage the daemon which updates all MPP LUN paths | ||
# processname: updatempppathd | ||
# pidfile: /var/run/updatempppathd.py.pid | ||
|
||
DAEMON=/opt/xensource/sm/updatempppathd.py | ||
prog=`basename $DAEMON` | ||
pidfile=/var/run/${prog}.pid | ||
logfile=/var/log/SMlog | ||
|
||
# Source function library. | ||
. /etc/init.d/functions | ||
|
||
RETVAL=0 | ||
|
||
# | ||
# See how we were called. | ||
# | ||
|
||
start() { | ||
test -x $DAEMON || exit 5 | ||
if [ -f $pidfile ]; then | ||
pid=`cat $pidfile` | ||
ps -p $pid > /dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "$prog already running with pid $pid" | ||
return 0 | ||
else | ||
rm $pidfile | ||
fi | ||
fi | ||
echo -n $"Starting $prog daemon: " | ||
daemon $DAEMON -d $logfile | ||
RETVAL=$? | ||
if [ $RETVAL -eq 0 ]; then | ||
# Wait a while so that we don't race with the process | ||
# while it is doing a double-fork | ||
sleep 5 | ||
|
||
for i in `pidof python`; do | ||
line=`ps -h -p $i -o pid,command 2> /dev/null` | ||
echo $line | grep $prog > /dev/null | ||
if [ $? -eq 0 ]; then | ||
echo $i > $pidfile | ||
break | ||
fi | ||
done | ||
success $"$base startup" | ||
else | ||
failure $"$base startup" | ||
fi | ||
echo | ||
return $RETVAL | ||
} | ||
|
||
stop() { | ||
echo -n $"Stopping $prog daemon: " | ||
`test -e $pidfile` | ||
RETVAL=$? | ||
if [ $RETVAL -eq 0 ]; then | ||
PID=`cat $pidfile` | ||
kill $PID | ||
RETVAL=$? | ||
[ $RETVAL -eq 0 ] && rm -f $pidfile | ||
else | ||
RETVAL=0 | ||
fi | ||
[ $RETVAL -eq 0 ] && success $"$base stop" || failure $"$base stop" | ||
echo | ||
return $RETVAL | ||
} | ||
|
||
restart() { | ||
stop | ||
start | ||
} | ||
|
||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
restart) | ||
restart | ||
;; | ||
condrestart) | ||
if [ -f $pidfile ]; then | ||
restart | ||
fi | ||
;; | ||
status) | ||
status $prog | ||
RETVAL=$? | ||
;; | ||
*) | ||
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" | ||
RETVAL=3 | ||
esac | ||
|
||
exit $RETVAL |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Make a dummy SR if necessary | ||
DefaultDependencies=no | ||
After=local-fs.target | ||
Before=basic.target | ||
|
||
[Service] | ||
ExecStart=/opt/xensource/libexec/make-dummy-sr | ||
|
||
[Install] | ||
WantedBy=basic.target |
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
Oops, something went wrong.