targetcli-fb: systemd support
authorChristophe Vu-Brugier <cvubrugier@fastmail.fm>
Thu, 3 Sep 2015 07:55:26 +0000 (09:55 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sat, 3 Oct 2015 12:21:07 +0000 (14:21 +0200)
The systemd service file is taken from Fedora.

Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
Reviewed-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Tested-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/targetcli-fb/target.service [new file with mode: 0644]
package/targetcli-fb/targetcli-fb.mk

diff --git a/package/targetcli-fb/target.service b/package/targetcli-fb/target.service
new file mode 100644 (file)
index 0000000..400284e
--- /dev/null
@@ -0,0 +1,14 @@
+[Unit]
+Description=Restore LIO kernel target configuration
+Requires=sys-kernel-config.mount
+After=sys-kernel-config.mount network.target local-fs.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/targetctl restore
+ExecStop=/usr/bin/targetctl clear
+SyslogIdentifier=target
+
+[Install]
+WantedBy=multi-user.target
index 0a64c4651ded7979aa51af3fc3d4c41ac3742cfc..cf7f29ff4e4e38b613f1726d662a8d854e98050f 100644 (file)
@@ -12,7 +12,13 @@ TARGETCLI_FB_SETUP_TYPE = setuptools
 TARGETCLI_FB_DEPENDENCIES = python-configshell-fb python-rtslib-fb python-six
 
 define TARGETCLI_FB_INSTALL_INIT_SYSV
-       $(INSTALL) -m 0755 -D package/targetcli-fb/S50target $(TARGET_DIR)/etc/init.d/S50target
+       $(INSTALL) -m 0755 -D package/targetcli-fb/S50target \
+               $(TARGET_DIR)/etc/init.d/S50target
+endef
+
+define TARGETCLI_FB_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -m 0644 -D package/targetcli-fb/target.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/target.service
 endef
 
 # Targetcli stores its configuration in /etc/target/saveconfig.json