It is best if we put our Debian pkging stuff somewhere other than debian/. Move to example-debian/ and also move rpm/ to example-rpm/, for consistency. This leaves 'make deb' and 'make rpm' broken, but I think this is a lesser concern given our stated level of support (very low). Patches accepted :) Fixes #59. Signed-off-by: Andy Grover <agrover@redhat.com>
42 lines
685 B
Bash
42 lines
685 B
Bash
#!/bin/bash
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: target
|
|
# Default-Start: 3 4 5
|
|
# Default-Stop: 0 1 2 6
|
|
# Required-Start: $local_fs $network
|
|
# Required-Stop: $local_fs $network
|
|
# Short-Description: Start LIO targets
|
|
# Description: Loads configfs and restores LIO config with targetctl
|
|
### END INIT INFO
|
|
|
|
|
|
case "$1" in
|
|
start)
|
|
echo "Loading lio configuration"
|
|
/usr/bin/targetctl restore
|
|
if [[ $? -gt 0 ]]; then
|
|
exit 1
|
|
fi
|
|
;;
|
|
|
|
stop)
|
|
echo "Unloading lio configuration"
|
|
/usr/bin/targetctl clear
|
|
if [[ $? -gt 0 ]]; then
|
|
exit 1
|
|
fi
|
|
;;
|
|
|
|
restart|force-reload)
|
|
$0 stop
|
|
sleep 3
|
|
$0 start
|
|
;;
|
|
|
|
*)
|
|
echo "usage: $0 {start|stop|restart|force-reload}"
|
|
esac
|
|
|
|
exit 0
|