Index: libexec/rc/rc.conf =================================================================== --- libexec/rc/rc.conf +++ libexec/rc/rc.conf @@ -286,7 +286,8 @@ syslogd_program="/usr/sbin/syslogd" # path to syslogd, if you want a different one. syslogd_flags="-s" # Flags to syslogd (if enabled). syslogd_oomprotect="YES" # Don't kill syslogd when swap space is exhausted. -altlog_proglist="" # List of chrooted applicatioins in /var +altlog_proglist="" # List of chrooted applications which will get a log socket in their var/run +altlog_jaillist="" # List of jails which will get log sockets in their in var/run inetd_enable="NO" # Run the network daemon dispatcher (YES/NO). inetd_program="/usr/sbin/inetd" # path to inetd, if you want a different one. inetd_flags="-wW -C 60" # Optional flags to inetd Index: libexec/rc/rc.d/syslogd =================================================================== --- libexec/rc/rc.d/syslogd +++ libexec/rc/rc.d/syslogd @@ -21,6 +21,7 @@ extra_commands="reload" sockfile="/var/run/syslogd.sockets" +privsockfile="/var/run/syslogd.privsockets" evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" syslogd_precmd() @@ -37,6 +38,7 @@ # Create default list of syslog sockets to watch # ( umask 022 ; > $sockfile ) + ( umask 022 ; > $privsockfile ) # If running named(8) or ntpd(8) chrooted, added appropriate # syslog socket to list of sockets to watch. @@ -48,6 +50,14 @@ fi done + # We can also provide logging facilities to jails + # Jails might need a log socket for priviledged applications too + for _j in $altlog_jaillist; do + _ldir=`jls -aj $_j path` + echo "${_ldir}/var/run/log" >> $sockfile + echo "${_ldir}/var/run/logpriv" >> $privsockfile + done + # If other sockets have been provided, change run_rc_command()'s # internal copy of $syslogd_flags to force use of specific # syslogd sockets. @@ -56,6 +66,10 @@ echo "/var/run/log" >> $sockfile eval $evalargs fi + if [ -s $privsockfile ]; then + echo "/var/run/logpriv" >> $privsockfile + eval $evalargs + fi return 0 } @@ -68,6 +82,9 @@ for _s in `cat $sockfile | tr '\n' ' '` ; do _socketargs="-l $_s $_socketargs" done + for _s in `cat $privsockfile | tr '\n' ' '` ; do + _socketargs="-S $_s $_socketargs" + done echo $_socketargs } load_rc_config $name Index: usr.sbin/syslogd/syslogd.8 =================================================================== --- usr.sbin/syslogd/syslogd.8 +++ usr.sbin/syslogd/syslogd.8 @@ -28,7 +28,7 @@ .\" @(#)syslogd.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 2, 2018 +.Dd November 29, 2020 .Dt SYSLOGD 8 .Os .Sh NAME @@ -413,6 +413,45 @@ This can be overridden by the .Fl T flag. +.Sh RC.CONF VARIABLES +The following variables affect the behavior of +.Nm . +They are defined in +.Pa /etc/defaults/rc.conf +and can be changed in +.Pa /etc/rc.conf . +.Bl -tag -width indent +.It Va syslogd_enable +.Pq Vt str +If set to +.Dq Li YES , +run the +.Nm +daemon at system boot time. +If set to +.Dq Li NO , +do not run a +.Nm +.It Va syslogd_program +.Pq Vt str +Path to syslogd. +Defaults to +.Dq Li /usr/sbin/syslogd , +but can be changed if you want a different one. +.It Va syslogd_flags +.Pq Vt str +Flags to syslogd. +Defaults to +.Dq Li -s . +.It Va altlog_proglist +.Pq Vt list +List of chrooted applications which will have a log socket placed in their +.Pa var/run . +.It Va altlog_jaillist +.Pq Vt list +List of jails which will have log sockets placed in their +.Pa var/run . +.El .Sh FILES .Bl -tag -width /var/run/syslog.pid -compact .It Pa /etc/syslog.conf