Date: Mon, 09 Sep 2024 09:23:13 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 238006] syslogd not starting because of missing /var/run/log Message-ID: <bug-238006-227-nms9MulXYO@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-238006-227@https.bugs.freebsd.org/bugzilla/> References: <bug-238006-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238006 --- Comment #8 from Harald Schmalzbauer <bugzilla.freebsd@omnilan.de> --- (In reply to Mark Johnston from comment #7) Thanks a lot! I was wondering how comes that your diff calls getaddrinfo() differently... and noticed that HEAD has a significant newer version, tuned by Jake Freela= nd mainly. In main f30b063ee667 =C2=BBsyslogd: Only use peerlist during flag parsing=C2=AB the check in question was moved from socksetup() to addsock() and the unconditional addpeer() was removed. So I thought it's worth giving the unmodified HEAD version a try=E2=80=A0, = especially because the commits were tagged to be MFCd after 3 weeks. And lucky I was: Only reading/understanding parts of the diff, it turns o= ut that HEAD version doesn't terminate in jails without IP/vnet assigned if '-= ss' was passed as CLI arg=20 (while (the default) '-s' still makes syslogd(8) terminate with =C2=BBpri 5= 3, flags 0, from test, msg exiting on signal 2=C2=AB in such jails). For completeness I also successfully tested the patched stable/14 version= of syslogd(8), with Mark's slightly adopted diff (same result as with HEAD version, '-ss' pased starts while '-s' terminates in jails withoutIP/vnet): (note pe->pe_name instead of name and returning with an int) --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -3825,6 +3825,14 @@ socksetup(struct peer *pe) if (pe->pe_serv =3D=3D NULL) pe->pe_serv =3D "syslog"; error =3D getaddrinfo(pe->pe_name, pe->pe_serv, &hints, &res0); + if (error =3D=3D EAI_NONAME && pe->pe_name =3D=3D NULL && SecureMod= e > 1) { + /* + * If we're in secure mode, we won't open inet sockets anyw= ay. + * This failure can arise legitimately when running in a ja= il + * without networking. + */ + return (0); + } if (error) { char *msgbuf; So I guess instead of patching, MFCing is the preferred solution after one = year in HEAD. Unfortunately I don't have any environment where I could test all the netwo= rk functionality of syslogd(8). Neither sending nor collecting via inet... Ever since I discovered 'netstat -an' as young rookie, I'm passing '-ss' to syslogd(8). How to find out if syslogd_flags=3D"-ss" (instead of =3D"-s") would be the = better default in /etc/defaults/rc.conf? But that's unrelated to this PR. =E2=80=A0although I new this would make me upset about git(666) once more..= . I lost the wrestle again, so I took the head src tar and copied usr.sbin/syslogd into = my stable/14 checkout (I _always_ end up with an unusable local git repo and n= eed to re-clone and start from scratch :-( I rarely needed much svn(1) help and never messed it up...) If somebody could tell me how I could have accomplished getting an diff bet= ween the HEAD commit as in stable/14 and head in HEAD, I'd highly appreciate. I guess I'd always need to separately clone the HEAD repo 1st, which is ridiculous imho. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-238006-227-nms9MulXYO>