diff mbox series

[v4,11/13] package/syslog-ng: implement default using DefaultInstance

Message ID 20191212075400.1499536-12-jeremy.rosen@smile.fr
State Superseded
Headers show
Series use host-systemd to enable units | expand

Commit Message

Jérémy ROSEN Dec. 12, 2019, 7:53 a.m. UTC
Instead of using a manual symlink we use add a DefaultInstance= to the
config file

This is how upstream wants us to do it and allows systemctl preset to
correctly restore it if needed

Signed-off-by: Jérémy Rosen <jeremy.rosen@smile.fr>
---
 package/syslog-ng/syslog-ng.mk | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/package/syslog-ng/syslog-ng.mk b/package/syslog-ng/syslog-ng.mk
index fc44777d16..98b5a38deb 100644
--- a/package/syslog-ng/syslog-ng.mk
+++ b/package/syslog-ng/syslog-ng.mk
@@ -105,11 +105,8 @@  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
+	mkdir $(TARGET_DIR)/usr/lib/systemd/system/syslog-ng@.service.d;\
+	printf '[Install]\nDefaultInstance=default\n' > $(TARGET_DIR)/usr/lib/systemd/system/syslog-ng@.service.d/buildroot-default-instance.conf;
 endef
 
 # By default syslog-ng installs a number of sample configuration