This restores the configuration when started and clears it when shut down.
Signed-off-by: Christoph Hellwig <hch@lst.de>
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
nvmetcli /usr/sbin
+nvmet.service /lib/systemd/system
%:
- dh $@ --with python2
+ dh $@ --with python2 --with systemd
override_dh_auto_build:
python setup.py build
--- /dev/null
+[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
+