]> www.infradead.org Git - users/hch/nvmetcli.git/commitdiff
add a systemd unit file
authorChristoph Hellwig <hch@lst.de>
Wed, 1 Jun 2016 18:28:47 +0000 (20:28 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 1 Jun 2016 18:32:01 +0000 (20:32 +0200)
This restores the configuration when started and clears it when shut down.

Signed-off-by: Christoph Hellwig <hch@lst.de>
debian/control
debian/install
debian/rules
nvmet.service [new file with mode: 0644]

index d8eaa3bab9fc4ec5578998e1de0124ff71dfe355..9ba8d0ecefd3068390bc55b6701e51dc8859c8d1 100644 (file)
@@ -2,7 +2,7 @@ Source: nvmetcli
 Section: python
 Priority: optional
 Maintainer: Christoph Hellwig <hch@lst.de>
-Build-Depends: debhelper(>= 8), python, python-setuptools, dh-python
+Build-Depends: debhelper(>= 8), python, python-setuptools, dh-python, dh-systemd  (>= 1.5)
 Standards-Version: 3.9.4
 
 Package: nvmetcli
index 33bc6932384313f926ac5f68af8699774105975a..eb4ad04fd56476599c16c4715e555622fc99915b 100644 (file)
@@ -1 +1,2 @@
 nvmetcli               /usr/sbin
+nvmet.service          /lib/systemd/system
index c21e5a2f8fff8fb2c82211ba86e7bf48431d107a..1869a24d1c81e9835959057aa579e0fe73522eee 100755 (executable)
@@ -8,7 +8,7 @@ export http_proxy = http://127.0.0.1:9
 
 
 %:
-       dh $@ --with python2
+       dh $@ --with python2 --with systemd
 
 override_dh_auto_build:
        python setup.py build
diff --git a/nvmet.service b/nvmet.service
new file mode 100644 (file)
index 0000000..5c7991e
--- /dev/null
@@ -0,0 +1,15 @@
+[Unit]
+Description=Restore NVMe 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/sbin/nvmetcli restore
+ExecStop=/usr/sbin/nvmetcli clear
+SyslogIdentifier=nvmetcli
+
+[Install]
+WantedBy=multi-user.target
+