
On Thu, 6 Sep 2007 21:23:54 -0400 Brett Goulder wrote:
Attached is a patch to remove the lines which start syslogd and klogd from /etc/rc and move this function to /etc/rc.d/sysklogd, the patch applies to the rc ports directory. Additionally, I've attached a tarball of the sysklogd ports directory with a /etc/rc.d/sysklogd init script, complete with modified Pkgfile and updated md5sums/footprint.
Okay, as a follow up, I've redone this patch in a way that I think is much better than the first method I tried. First, the major difference is the introduction of a new variable to rc.conf, SYSLOG, which controls which system logger to start based on the name of the script in /etc/rc.d (e.g. SYSLOG=sysklogd starts sysklogd). This simplifies the handling of the single-user mode case, as we simply do the same thing we do for starting sysklogd in multi-user mode, which is: if [ -f /etc/rc.d/$SYSLOG -a -x /etc/rc.d/$SYSLOG ]; then echo -n " $SYSLOG" /etc/rc.d/$SYSLOG &> /dev/null || echo -n "[ERROR]" fi Which is essentially what is done in the services loop to start a service, but separated from that loop and with the syslog bits being removed, this is done right before entering the services loop in rc.multi. In rc.single, the echo bits are removed, to maintain similar operation to the original rc.single. This method requires a bit more code, but it doesn't need any symlinks in the system, removes the useless logger bits from starting syslog (as that would result in nothing being logged) and winds up being a better overall solution, in my opinion. A patch against rc is attached, which implements this. -- ~predatorfreak GnuPG Public key: http://pred.dcaf-security.org/dcafsec-pub-gpgkey.asc