diff mbox series

[meta-selinux,dunfell,3/4] sysklogd: set correct security context for /var/log in initscript

Message ID 20230727180748.107196-4-akuster808@gmail.com
State New
Headers show
Series Selinux failed to enable do to errors. | expand

Commit Message

akuster808 July 27, 2023, 6:07 p.m. UTC
From: Yi Zhao <yi.zhao@windriver.com>

We don't need to set security context for /dev/log after syslogd daemon
startup because it is already set by udev. We just need to set the
correct security context for symbolic link /var/log before syslogd
startup.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
(cherry picked from commit 7d3b1347ae949c7208482694fd773e4bc3f321b4)
Signed-off-by: Armin Kuster <akuster@mvista.com>
---
 recipes-extended/sysklogd/files/sysklogd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/recipes-extended/sysklogd/files/sysklogd b/recipes-extended/sysklogd/files/sysklogd
index e49c2da..7943b1d 100644
--- a/recipes-extended/sysklogd/files/sysklogd
+++ b/recipes-extended/sysklogd/files/sysklogd
@@ -108,8 +108,8 @@  case "$1" in
   start)
     log_begin_msg "Starting system log daemon..."
     create_xconsole
+    test ! -x /sbin/restorecon || /sbin/restorecon -F /var/log
     start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD
-    test ! -x /sbin/restorecon || /sbin/restorecon -RF /dev/log /var/log/
     log_end_msg $?
     ;;
   stop)