summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2018-02-19 11:42:31 -0800
committerAndy Grover <agrover@redhat.com>2018-02-19 11:42:31 -0800
commit72cb0ed06d072f5c853eb8b5982a2c1ebe953089 (patch)
tree59d7ad06cab5991857b34663b76369078410b404
parenta46e6bf9ea0f83acdff1761a11c502ea5863945f (diff)
downloadrtslib-fb-systemd.tar.gz
Ship a systemd service filesystemd
resolves #119 Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--systemd/README.md8
-rw-r--r--systemd/target.service15
2 files changed, 23 insertions, 0 deletions
diff --git a/systemd/README.md b/systemd/README.md
new file mode 100644
index 0000000..4822045
--- /dev/null
+++ b/systemd/README.md
@@ -0,0 +1,8 @@
+### Service file for rtslib-fb use with systemd
+
+The systemd developers encourage upstream projects to ship and install
+a service file, saving each systemd-based distribution from having to
+create one.
+
+In this directory is the systemd service file for rtslib-fb. However,
+it is not currently installed by default.
diff --git a/systemd/target.service b/systemd/target.service
new file mode 100644
index 0000000..aa0a51b
--- /dev/null
+++ b/systemd/target.service
@@ -0,0 +1,15 @@
+[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
+