summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2013-11-01 21:04:41 -0700
committerAndy Grover <agrover@redhat.com>2013-11-01 21:04:41 -0700
commit7cf029d04318b41be8dcc62b732f677cdb0c0b10 (patch)
tree4569c5ac4a2d6c027db25848662c35a51f3f9d12
parentc935a4acf42b4f6fc185bbe97738060cd0f643e0 (diff)
parent5f9575d3abc2293465ed5c330f10c72cfd734d2a (diff)
downloadrtslib-fb-7cf029d04318b41be8dcc62b732f677cdb0c0b10.tar.gz
Merge pull request #40 from JonnyJD/rc_script
add rc script to debian package
-rw-r--r--debian/control9
-rw-r--r--debian/python3-rtslib-fb.install1
-rw-r--r--debian/python3-rtslib-fb.target.init41
-rwxr-xr-xdebian/rules6
4 files changed, 54 insertions, 3 deletions
diff --git a/debian/control b/debian/control
index b8036db..86ddfc2 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ X-Python3-Version: >= 3.1
Package: python-rtslib-fb-docs
Architecture: all
-Description: RisingTide Systems generic SCSI target API in python (Documentation).
+Description: RisingTide Systems LIO target Python API (Documentation).
Package: python-rtslib-fb
Architecture: all
@@ -17,10 +17,13 @@ Depends: ${python:Depends}, ${misc:Depends}
Provides: ${python:Provides}
Suggests: python-rtslib-fb-doc
Conflicts: python-rtslib, rtsadmin-frozen
-Description: RisingTide Systems generic SCSI target API in python (free branch).
+Description: RisingTide Systems LIO target Python 2 API (free branch).
Package: python3-rtslib-fb
Architecture: all
Depends: ${python3:Depends}, ${misc:Depends}
Suggests: python-rtslib-fb-doc
-Description: RisingTide Systems generic SCSI target API in python (Python 3).
+Conflicts: lio-utils
+Replaces: targetcli-fb (<< 2.1.fb32)
+Description: RisingTide Systems LIO target Python 3 API (free branch).
+ This includes the LIO rc scripts to start and stop the target.
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..6250ceb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -31,6 +31,9 @@ install-python%:
override_dh_auto_install: $(PYTHON3:%=install-python%)
dh_auto_install
+ # for using python 3 for targetctl
+ # even though it is overwritten by python2 setup
+ sed -i '1s|/usr/bin/python$$|/usr/bin/python3|' $(install_dir)/usr/bin/targetctl
override_dh_installdocs:
@@ -38,6 +41,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