Re: run_rc_command succeeds if command not executable
"Greg A. Woods" <[email protected]> Mon, 26 May 2025 15:16:49 -0700
| Newsgroups | gmane.os.netbsd.devel.userlevel |
|---|---|
| Organization | Planix, Inc. |
| Message-ID | <[email protected]> |
At Mon, 26 May 2025 16:18:38 +0200, Edgar Fuß <[email protected]> wrote: Subject: run_rc_command succeeds if command not executable > > I wondered why mdnsd didn't start on boot without any trace in rc.log. > > Now I found out it's /usr missing in critical_filesystems_local, but why > on earth does run_rc_command() do > if [ ! -x ${_chroot}${command} ]; then > return 0 > fi > so this is silently ignored? I wonder! My guess is that it is to support a simple alternative way turning off something by simply removing its execute bit. In my local copy I added a "warn" message to this and an awful lot of other similar cases where something is silently ignored or causes a silent error of some sort. I see that it has been this way right from the beginning, early 2000, when that test was added at the time the run_rc_command function itself was first added to rc.subr (1.11) (and the running of everything was moved from /etc/rc to /etc/rc.d/*). -- Greg A. Woods <[email protected]> Kelowna, BC +1 250 762-7675 RoboHack <[email protected]> Planix, Inc. <[email protected]> Avoncote Farms <[email protected]>
signature.asc
(application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRuK6dmwVAucmRxuh9mfXG3eL/0fwUCaDToUAAKCRBmfXG3eL/0 fwxDAJ9hnpZ64V+yLxZ1CdskwA+ccxb0UACfTJjY5/v5jXOJYD80AL5Y0stpgpo= =Cscb -----END PGP SIGNATURE-----