* [Buildroot] [PATCH] rsyslog: Fix systemd service creation
@ 2015-07-14 14:38 Maxime Hadjinlian
2015-07-14 21:59 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Maxime Hadjinlian @ 2015-07-14 14:38 UTC (permalink / raw)
To: buildroot
The rsyslog.service is installed by rsyslog, but the link is not created
so the service is not enabled.
In order to install the service file, use the correct configure flag.
So the INSTALL_INIT_SYSTEMD will create the link, it will also create
another link which is due to the fact that the rsyslog.service contains
an Alias=
If we were to use systemctl enable to enable the service, it would
create both,so we mimic that.
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
---
package/rsyslog/rsyslog.mk | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/package/rsyslog/rsyslog.mk b/package/rsyslog/rsyslog.mk
index 261f59d..5b30d28 100644
--- a/package/rsyslog/rsyslog.mk
+++ b/package/rsyslog/rsyslog.mk
@@ -57,17 +57,32 @@ else
RSYSLOG_CONF_OPTS += --disable-uuid
endif
+ifeq ($(BR2_INIT_SYSTEMD),y)
+RSYSLOG_CONF_OPTS += \
+ --enable-systemd \
+ --with-systemdsystemunitdir=/usr/lib/systemd/system
+RSYSLOG_DEPENDENCIES += systemd
+else
+RSYSLOG_CONF_OPTS += --disable-systemd
+endif
+
define RSYSLOG_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D package/rsyslog/S01logging \
$(TARGET_DIR)/etc/init.d/S01logging
endef
+# The rsyslog.service is installed by rsyslog, but the link is not created
+# so the service is not enabled.
+# We need to create another link which is due to the fact that the
+# rsyslog.service contains an Alias=
+# If we were to use systemctl enable to enable the service, it would
+# create both,so we mimic that.
define RSYSLOG_INSTALL_INIT_SYSTEMD
- ln -sf /lib/systemd/system/rsyslog.service \
- $(TARGET_DIR)/etc/systemd/system/syslog.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
- ln -sf ../syslog.service \
- $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/syslog.service
+ ln -sf ../../../../usr/lib/systemd/system/rsyslog.service \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/rsyslog.service
+ ln -sf ../../../../usr/lib/systemd/system/rsyslog.service \
+ $(TARGET_DIR)/etc/systemd/system/syslog.service
endef
define RSYSLOG_INSTALL_CONF
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] rsyslog: Fix systemd service creation
2015-07-14 14:38 [Buildroot] [PATCH] rsyslog: Fix systemd service creation Maxime Hadjinlian
@ 2015-07-14 21:59 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2015-07-14 21:59 UTC (permalink / raw)
To: buildroot
Dear Maxime Hadjinlian,
On Tue, 14 Jul 2015 16:38:20 +0200, Maxime Hadjinlian wrote:
> The rsyslog.service is installed by rsyslog, but the link is not created
> so the service is not enabled.
> In order to install the service file, use the correct configure flag.
>
> So the INSTALL_INIT_SYSTEMD will create the link, it will also create
> another link which is due to the fact that the rsyslog.service contains
> an Alias=
>
> If we were to use systemctl enable to enable the service, it would
> create both,so we mimic that.
>
> Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
> ---
> package/rsyslog/rsyslog.mk | 23 +++++++++++++++++++----
> 1 file changed, 19 insertions(+), 4 deletions(-)
Applied, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-14 21:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-14 14:38 [Buildroot] [PATCH] rsyslog: Fix systemd service creation Maxime Hadjinlian
2015-07-14 21:59 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox