[ndctl,RFC,2/3] ndctl: ndctl-monitor@.service: Add new unit file for multi daemon support
diff mbox series

Message ID 20200225065225.121631-3-fj5788hd@fujitsu.com
State New
Headers show
Series
  • Enable to run multiple monitor daemons as system services
Related show

Commit Message

Keisuke Sugita Feb. 25, 2020, 6:52 a.m. UTC
Users cannot run multiple monitor daemon because units name of
monitor daemon is now fixed to "ndctl-monitor.service" and users cannnot
change this name.

This patch is new unit file which reffers a single argument and change
their config file or service name. This is to run multiple monitor
daemon.

Units name can be parameterized by a single argument called the instance
name. The name of the full units is formed by inserting the instance
name between "@" and ".service", like "ndctl-moniter@foo.service".

In the unit file itself, the instance parameter may be referred to using
"%I". And each daemon reads each config file, like "monitor-foo.conf".
Same name as instance name must be used in config file between
"monitor" and ".conf".

Signed-off-by: Keisuke Sugita <fj5788hd@fujitsu.com>
---
 ndctl/ndctl-monitor@.service | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 ndctl/ndctl-monitor@.service

Patch
diff mbox series

diff --git a/ndctl/ndctl-monitor@.service b/ndctl/ndctl-monitor@.service
new file mode 100644
index 0000000..eb10702
--- /dev/null
+++ b/ndctl/ndctl-monitor@.service
@@ -0,0 +1,9 @@ 
+[Unit]
+Description=Ndctl Monitor Daemon
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/ndctl monitor --config-file=/etc/ndctl/monitor-%I.conf
+
+[Install]
+WantedBy=multi-user.target