busybox – start-stop-daemon syslog as non-root

I have a Yocto based embedded Linux build using busybox-1.24.1 and its sylogd and start-stop-daemon utilities.

root:~# ls -l /sbin/syslogd
lrwxrwxrwx 1 root root 19 Nov  2 17:57 /sbin/syslogd -> /bin/busybox.nosuid
root:~# ls -l /sbin/start-stop-daemon
lrwxrwxrwx 1 root root 19 Nov  2 17:57 /sbin/start-stop-daemon -> /bin/busybox.nosuid

I would like to run the syslog daemon under a non-root user. I have modified /etc/init.d/syslog sysvinit script to add a few echo $? for checking start-stop-daemon env status reporting as shown below:

        echo -n "Starting syslogd/klogd: "
        echo "as $(whoami) ..."
        start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
        echo $?
        start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
        echo $?

The start-start-daemon seems to run ok as non_root account but the syslogd is not started.

root:~# su non_root
non_root:/home/root$ /etc/init.d/syslog start
Starting syslogd/klogd: as non_root ...
non_root:/home/root$ ps aux | grep syslogd
non_root  3233  0.0  0.0   1956   420 ttyPS0   S+   20:37   0:00 grep syslogd

Is it possible to start-stop-service the syslog as non-root in the busybox build?


Read more here: Source link