Skip to contentSkip to conversation

package/syslog-ng: fix startup with systemd

PATCH New Carlos Santos 3 participants 3 messages Jan 18, 2019 – Jan 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/syslog-ng: fix startup with systemd

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.

---
 package/syslog-ng/syslog-ng.mk      | 10 ++++++++++
 package/syslog-ng/syslog-ng at default |  8 ++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 package/syslog-ng/syslog-ng at default
package/syslog-ng/syslog-ng.mk +10 -0
index ecde9e8181..0c92b091b4 100644
@@ -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 at default \
+		$(TARGET_DIR)/etc/default/syslog-ng at default
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -sf ../../../../usr/lib/systemd/system/syslog-ng at .service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/syslog-ng at 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
package/syslog-ng/syslog-ng at default new file +8 -0
new file mode 100644
index 0000000000..0fad00ebac
@@ -0,0 +1,8 @@
+#
+# /etc/default/syslog-ng at 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"
Signature · 1 line
2.14.5
#1 lore raw

PATCH 1/1 package/syslog-ng: fix startup with systemd

Quoted 8 lines · Carlos Santos

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.

Thanks

Quoted 44 lines
---
 package/syslog-ng/syslog-ng.mk      | 10 ++++++++++
 package/syslog-ng/syslog-ng at default |  8 ++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 package/syslog-ng/syslog-ng at default
package/syslog-ng/syslog-ng.mk +10 -0
index ecde9e8181..0c92b091b4 100644
@@ -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 at default \
+               $(TARGET_DIR)/etc/default/syslog-ng at default
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/syslog-ng at .service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/syslog-ng at 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
package/syslog-ng/syslog-ng at default new file +8 -1
new file mode 100644
index 0000000000..0fad00ebac
@@ -0,0 +1,8 @@
+#
+# /etc/default/syslog-ng at 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"
--

2.14.5

#2 lore raw

PATCH 1/1 package/syslog-ng: fix startup with systemd

In reply to Carlos Santos
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Carlos" == Carlos Santos <[email protected]> writes:

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.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard