diff options
author | Johannes Dewender <github@JonnyJD.net> | 2013-11-01 19:51:03 +0100 |
---|---|---|
committer | Johannes Dewender <github@JonnyJD.net> | 2013-11-02 04:00:47 +0100 |
commit | 5a4d2e448477c7a62ddc7c7cb3132f5c12bf3496 (patch) | |
tree | b6117ca79688f55c275e9b269e142c031a303df4 | |
parent | 6d587dd42e6067d9caa422a58459e2e70c543101 (diff) | |
download | rtslib-fb-5a4d2e448477c7a62ddc7c7cb3132f5c12bf3496.tar.gz |
debian: add rc script
This was moved from targetcli to rtslib,
using targetctl.
Signed-off-by: Johannes Dewender <github@JonnyJD.net>
-rw-r--r-- | debian/python3-rtslib-fb.install | 1 | ||||
-rw-r--r-- | debian/python3-rtslib-fb.target.init | 41 | ||||
-rwxr-xr-x | debian/rules | 3 |
3 files changed, 45 insertions, 0 deletions
diff --git a/debian/python3-rtslib-fb.install b/debian/python3-rtslib-fb.install index 4606faa..bf7cd62 100644 --- a/debian/python3-rtslib-fb.install +++ b/debian/python3-rtslib-fb.install @@ -1 +1,2 @@ usr/lib/python3* +usr/bin diff --git a/debian/python3-rtslib-fb.target.init b/debian/python3-rtslib-fb.target.init new file mode 100644 index 0000000..b011013 --- /dev/null +++ b/debian/python3-rtslib-fb.target.init @@ -0,0 +1,41 @@ +#!/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 diff --git a/debian/rules b/debian/rules index e7d4e48..d9ef8a1 100755 --- a/debian/rules +++ b/debian/rules @@ -38,6 +38,9 @@ override_dh_installdocs: --exclude configobj ../$(name)/*.py dh_installdocs $(build_dir)/html +override_dh_installinit: + dh_installinit --name target + override_dh_auto_clean: dh_auto_clean |