diff --git a/debian/control b/debian/control index d8eaa3bab9fc4ec5578998e1de0124ff71dfe355..9ba8d0ecefd3068390bc55b6701e51dc8859c8d1 100644 --- a/debian/control +++ b/debian/control @@ -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 diff --git a/debian/install b/debian/install index 33bc6932384313f926ac5f68af8699774105975a..eb4ad04fd56476599c16c4715e555622fc99915b 100644 --- a/debian/install +++ b/debian/install @@ -1 +1,2 @@ nvmetcli /usr/sbin +nvmet.service /lib/systemd/system diff --git a/debian/rules b/debian/rules index c21e5a2f8fff8fb2c82211ba86e7bf48431d107a..1869a24d1c81e9835959057aa579e0fe73522eee 100755 --- a/debian/rules +++ b/debian/rules @@ -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 index 0000000000000000000000000000000000000000..5c7991ec22e520c8378f64df1dce05125dfbeb70 --- /dev/null +++ b/nvmet.service @@ -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 +