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 privileged 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: share/man/man5/rc.conf.5 =================================================================== --- share/man/man5/rc.conf.5 +++ share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Sep 21, 2020 +.Dd December 2, 2020 .Dt RC.CONF 5 .Os .Sh NAME @@ -1377,7 +1377,7 @@ It also supports CIDR notation. .Pp If the -.Pa /etc/start_if. Ns Aq Ar interface +.Pa /etc/start_if . Ns Aq Ar interface file is present, it is read and executed by the .Xr sh 1 interpreter @@ -1503,7 +1503,7 @@ Finally, you can add .Xr ifconfig 8 options in this variable, in addition to the -.Pa /etc/start_if. Ns Aq Ar interface +.Pa /etc/start_if . Ns Aq Ar interface file. For instance, to configure an .Xr ath 4 @@ -1873,16 +1873,16 @@ tunnel using the .Cm tunnel option to -.Xr ifconfig . +.Xr ifconfig 8 . Additionally, this option ensures that each listed interface is created via the .Cm create option to -.Xr ifconfig +.Xr ifconfig 8 before attempting to configure it. .Pp For example, configure two -.Xr gif +.Xr gif 4 interfaces with: .Bd -literal gif_interfaces="gif0 gif1" @@ -2155,6 +2155,7 @@ .Pq Ql \&: . Extending the default list in this way is only necessary when third party file system types are used. +.\" ----- syslogd setting ----------------------------------- .It Va syslogd_enable .Pq Vt bool If set to @@ -2176,6 +2177,17 @@ .Dq Li YES , these are the flags to pass to .Xr syslogd 8 . +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 . +.\" ----- inetd setting ----------------------------------- .It Va inetd_enable .Pq Vt bool If set to @@ -3896,7 +3908,7 @@ when per-jail configuration variables are defined, .Xr jail 8 configuration files are created as -.Pa /var/run/jail. Ns Ao Ar jname Ac Ns Pa .conf +.Pa /var/run/jail . Ns Ao Ar jname Ac Ns Pa .conf and used. .Pp The following per-jail parameters are handled by @@ -4593,7 +4605,7 @@ .Xr gdb 1 , .Xr info 1 , .Xr kbdcontrol 1 , -.Xr makewhatis 1 , +.Xr makewhatis 8 , .Xr sh 1 , .Xr vi 1 , .Xr vidcontrol 1 , 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 December 2, 2020 .Dt SYSLOGD 8 .Os .Sh NAME @@ -434,7 +434,8 @@ .Xr syslog 3 , .Xr services 5 , .Xr syslog.conf 5 , -.Xr newsyslog 8 +.Xr newsyslog 8 , +.Xr rc.conf 5 .Sh HISTORY The .Nm