supervisor: systemd support
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:14:18 +0000 (13:14 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 13 Jul 2015 20:43:39 +0000 (22:43 +0200)
Running supervisord under systemd sounds wrong, but it is possible
and probably makes sense in some cases.

[Thomas: use relative symbolic link instead of an absolute symbolic
link.]

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/supervisor/supervisor.mk
package/supervisor/supervisord.service [new file with mode: 0644]

index 6bd64a9a21ecb18817acee939f22cbe10ce59502..a6a4731c860b331ad93393e469e7ef275f314d53 100644 (file)
@@ -22,4 +22,12 @@ define SUPERVISOR_INSTALL_INIT_SYSV
                $(TARGET_DIR)/etc/init.d/S99supervisord
 endef
 
+define SUPERVISOR_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/supervisor/supervisord.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/supervisord.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/supervisord.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/supervisord.service
+endef
+
 $(eval $(python-package))
diff --git a/package/supervisor/supervisord.service b/package/supervisor/supervisord.service
new file mode 100644 (file)
index 0000000..92c38c7
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Process Control System
+After=syslog.target
+
+[Service]
+ExecStart=/usr/bin/supervisord -n
+Restart=always
+
+[Install]
+WantedBy=multi-user.target