On 2022/04/18 03:13, Clint Pachl wrote: > On Fri, 15 Apr 2022 22:00:35 +0100 > Stuart Henderson <s...@spacehopper.org> wrote: > > > jturner had a problem with this, here's a diff on top of what was > > committed. > > > > - I think the first line is superfluous as /etc/rc.d/rc.subr has some > > special case for this (and I think this maybe responsible for a > > problem which jturner ran into) > > You're right, the same spamlogd start conditions are checked in both > _rc_quirks() in rc.d/rc.subr and rc_pre() in rc.d/spamlogd. > > However, isn't it better to have this spamlogd quirk in rc.d/spamlogd > and remove it from rc.d/rc.subr?
Default config is: $ grep spam /etc/rc.conf spamd_flags=NO # also see spamd_black below spamlogd_flags= # use eg. "-i interface" and see spamlogd(8) spamd_black=NO # set to YES to run spamd without greylisting So with that change it will show spamlogd(failed) for people with default config (we could change the default spamlogd_flags to NO to avoid that but then spamd users will need to change config. I prefer to just fix the problem and return to forgetting that spamd exists again (I haven't used it for probably 10 years when I worked out that it causes me more problems than it solves - I now use more selective greylisting, only on high-spam-scoring mail). > The _rc_quirks() function (including the spamlogd pre-start checks) was > added to rc.d/rc.subr,v1.73 (2014). I'm guessing it was to fix spamlogd > because it was broken since the error introduced in rc.d/spamlogd,v1.2 > (2011), where the start conditions were no longer checked properly > in rc_pre(). I think the fix went in the wrong file back then, unless > I'm mistaken as to how the rc system functions. > > > > > > - look for the pflog interface passed in flags and init that > > This is an improvement. > > In fact, this change could be applied to rc.d/pflogd too. For example, > if pflog1 is specified in pflogd_flags, it will not be created via > rc_pre(), which only creates pflog0 (see -i in pflogd(8)). That probably makes sense. > Again, if my thinking is correct, it seems the "special care" for > pflogd startup in _rc_quirks() (i.e. check if pf is enabled) should be > moved to rc_pre() in rc.d/pflogd. Correct? I think this has the same issue with printing "(failed)", this time if PF is disabled, though at least that's not in default config.