summaryrefslogtreecommitdiffstats
path: root/usr/lib
diff options
context:
space:
mode:
Diffstat (limited to 'usr/lib')
-rw-r--r--usr/lib/systemd/system/meson.build37
-rw-r--r--usr/lib/systemd/system/stacd.in.service32
-rw-r--r--usr/lib/systemd/system/stafd.in.service35
-rw-r--r--usr/lib/systemd/system/stas-config.target13
-rw-r--r--usr/lib/systemd/system/stas-config@.service17
5 files changed, 134 insertions, 0 deletions
diff --git a/usr/lib/systemd/system/meson.build b/usr/lib/systemd/system/meson.build
new file mode 100644
index 0000000..0076b01
--- /dev/null
+++ b/usr/lib/systemd/system/meson.build
@@ -0,0 +1,37 @@
+# Copyright (c) 2021, Dell Inc. or its subsidiaries. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+# See the LICENSE file for details.
+#
+# This file is part of NVMe STorage Appliance Services (nvme-stas).
+#
+# Authors: Martin Belanger <Martin.Belanger@dell.com>
+#
+sd_unit_dir = prefix / 'lib' / 'systemd' / 'system'
+
+configure_file(
+ input: 'stafd.in.service',
+ output: 'stafd.service',
+ install_dir: sd_unit_dir,
+ configuration: conf,
+)
+
+configure_file(
+ input: 'stacd.in.service',
+ output: 'stacd.service',
+ install_dir: sd_unit_dir,
+ configuration: conf,
+)
+
+configure_file(
+ input: 'stas-config@.service',
+ output: 'stas-config@.service',
+ install_dir: sd_unit_dir,
+ copy: true,
+)
+
+configure_file(
+ input: 'stas-config.target',
+ output: 'stas-config.target',
+ install_dir: sd_unit_dir,
+ copy: true,
+)
diff --git a/usr/lib/systemd/system/stacd.in.service b/usr/lib/systemd/system/stacd.in.service
new file mode 100644
index 0000000..77a4ad5
--- /dev/null
+++ b/usr/lib/systemd/system/stacd.in.service
@@ -0,0 +1,32 @@
+# Copyright (c) 2021, Dell Inc. or its subsidiaries. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+# See the LICENSE file for details.
+#
+# This file is part of NVMe STorage Appliance Services (nvme-stas).
+#
+[Unit]
+Description=STorage Appliance Connector (STAC)
+Documentation=man:stacd.service(8) man:stacd(8)
+Wants=modprobe@nvme_fabrics.service modprobe@nvme_tcp.service network.target stas-config.target
+After=modprobe@nvme_fabrics.service modprobe@nvme_tcp.service network.target stas-config.target
+
+# Check that the nvme-tcp kernel module was previously
+# loaded by checking for the presence of /dev/nvme-fabrics.
+AssertPathExists=/dev/nvme-fabrics
+
+[Service]
+Type=dbus
+BusName=@STACD_DBUS_NAME@
+SyslogIdentifier=stacd
+
+ExecStart=/usr/bin/python3 -u /usr/sbin/stacd --syslog
+ExecReload=/bin/kill -HUP $MAINPID
+
+# Run-time directory: /run/stacd
+# Cache directory: /var/cache/stacd
+RuntimeDirectory=stacd
+CacheDirectory=stacd
+RuntimeDirectoryPreserve=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/usr/lib/systemd/system/stafd.in.service b/usr/lib/systemd/system/stafd.in.service
new file mode 100644
index 0000000..01ddc2b
--- /dev/null
+++ b/usr/lib/systemd/system/stafd.in.service
@@ -0,0 +1,35 @@
+# Copyright (c) 2021, Dell Inc. or its subsidiaries. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+# See the LICENSE file for details.
+#
+# This file is part of NVMe STorage Appliance Services (nvme-stas).
+#
+
+# Note that stafd can run w/o the avahi-daemon. However, if the avahi-daemon
+# is present, stafd should start after it for proper process sequencing.
+[Unit]
+Description=STorage Appliance Finder (STAF)
+Documentation=man:stafd.service(8) man:stafd(8)
+Wants=modprobe@nvme_fabrics.service modprobe@nvme_tcp.service network.target stas-config.target
+After=modprobe@nvme_fabrics.service modprobe@nvme_tcp.service network.target stas-config.target avahi-daemon.service
+
+# Check that the nvme-tcp kernel module was previously
+# loaded by checking for the presence of /dev/nvme-fabrics.
+AssertPathExists=/dev/nvme-fabrics
+
+[Service]
+Type=dbus
+BusName=@STAFD_DBUS_NAME@
+SyslogIdentifier=stafd
+
+ExecStart=/usr/bin/python3 -u /usr/sbin/stafd --syslog
+ExecReload=/bin/kill -HUP $MAINPID
+
+# Run-time directory: /run/stafd
+# Cache directory: /var/cache/stafd
+RuntimeDirectory=stafd
+CacheDirectory=stafd
+RuntimeDirectoryPreserve=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/usr/lib/systemd/system/stas-config.target b/usr/lib/systemd/system/stas-config.target
new file mode 100644
index 0000000..af6d339
--- /dev/null
+++ b/usr/lib/systemd/system/stas-config.target
@@ -0,0 +1,13 @@
+# Copyright (c) 2022, Dell Inc. or its subsidiaries. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+# See the LICENSE file for details.
+#
+# This file is part of NVMe STorage Appliance Services (nvme-stas).
+#
+[Unit]
+Description=Configuration generator for stacd.service and stafd.service
+Documentation=man:stas-config.target(8)
+Wants=stas-config@hostnqn.service
+Wants=stas-config@hostid.service
+PartOf=stacd.service
+PartOf=stafd.service
diff --git a/usr/lib/systemd/system/stas-config@.service b/usr/lib/systemd/system/stas-config@.service
new file mode 100644
index 0000000..f070a3c
--- /dev/null
+++ b/usr/lib/systemd/system/stas-config@.service
@@ -0,0 +1,17 @@
+# Copyright (c) 2022, Dell Inc. or its subsidiaries. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+# See the LICENSE file for details.
+#
+# This file is part of NVMe STorage Appliance Services (nvme-stas).
+#
+[Unit]
+Description=nvme-stas /etc/nvme/%i auto-generation
+Documentation=man:stas-config@.service(8)
+ConditionFileNotEmpty=|!/etc/nvme/%i
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/stasadm %i -f /etc/nvme/%i
+
+[Install]
+WantedBy=stas-config.target