summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-04-18 19:49:48 +0200
committerChristian Breunig <christian@breunig.cc>2025-04-18 19:54:12 +0200
commit50d1e137a5fdad0c253fe9882f86030b7abc6b2b (patch)
tree3567c3ecbe3c8d17098011c3a0e6ad9e1d65e219 /src
parent9e47c2153be7cc0e5ed21ca8a976336d4bf872d8 (diff)
downloadvyos-1x-50d1e137a5fdad0c253fe9882f86030b7abc6b2b.tar.gz
vyos-1x-50d1e137a5fdad0c253fe9882f86030b7abc6b2b.zip
syslog: T7367: ensure rsyslog is registered as default systemd syslog service
Systemd states: The default syslog implementation should make syslog.service a symlink to itself, so that this socket activates the right actual syslog service.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/init/vyos-router8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/init/vyos-router b/src/init/vyos-router
index 081adf214..8584234b3 100755
--- a/src/init/vyos-router
+++ b/src/init/vyos-router
@@ -460,6 +460,14 @@ start ()
nfct helper add tns inet6 tcp
nft --file /usr/share/vyos/vyos-firewall-init.conf || log_failure_msg "could not initiate firewall rules"
+ # Ensure rsyslog is the default syslog daemon
+ SYSTEMD_SYSLOG="/etc/systemd/system/syslog.service"
+ SYSTEMD_RSYSLOG="/lib/systemd/system/rsyslog.service"
+ if [ ! -L ${SYSTEMD_SYSLOG} ] || [ "$(readlink -f ${SYSTEMD_SYSLOG})" != "${SYSTEMD_RSYSLOG}" ]; then
+ ln -sf ${SYSTEMD_RSYSLOG} ${SYSTEMD_SYSLOG}
+ systemctl daemon-reload
+ fi
+
# As VyOS does not execute commands that are not present in the CLI we call
# the script by hand to have a single source for the login banner and MOTD
${vyos_conf_scripts_dir}/system_syslog.py || log_failure_msg "could not reset syslog"