package/syslog-ng: fix startup with systemd
authorCarlos Santos <casantos@datacom.com.br>
Fri, 18 Jan 2019 18:46:25 +0000 (16:46 -0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sat, 19 Jan 2019 15:34:02 +0000 (16:34 +0100)
By default syslog-ng installs a .service that requires a config file at
/etc/default, so provide one with the default values.

It's also necessary to enable the service by means of a symlink created
at /etc/systemd/system/multi-user.target.wants.

Signed-off-by: Carlos Santos <casantos@datacom.com.br>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/syslog-ng/syslog-ng.mk
package/syslog-ng/syslog-ng@default [new file with mode: 0644]

index ecde9e8181dea4bf049a06048da19b431afc1c08..0c92b091b47347ae969ac2f1db4b69bec5bbdc45 100644 (file)
@@ -97,6 +97,16 @@ define SYSLOG_NG_INSTALL_INIT_SYSV
                $(TARGET_DIR)/etc/init.d/S01syslog-ng
 endef
 
+# By default syslog-ng installs a .service that requires a config file at
+# /etc/default, so provide one with the default values.
+define SYSLOG_NG_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -m 0644 -D package/syslog-ng/syslog-ng@default \
+               $(TARGET_DIR)/etc/default/syslog-ng@default
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/syslog-ng@.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/syslog-ng@default.service
+endef
+
 # By default syslog-ng installs a number of sample configuration
 # files. Some of these rely on optional features being
 # enabled. Because of this buildroot uninstalls the shipped config
diff --git a/package/syslog-ng/syslog-ng@default b/package/syslog-ng/syslog-ng@default
new file mode 100644 (file)
index 0000000..0fad00e
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# /etc/default/syslog-ng@default
+#
+CONFIG_FILE=/etc/syslog-ng.conf
+PERSIST_FILE=/var/run/syslog-ng.persist
+CONTROL_FILE=/var/run/syslog-ng.ctl
+PID_FILE=/var/run/syslog-ng.pid
+OTHER_OPTIONS="--enable-core"