Bug 30546

Summary: [PATCH] /etc/rc pedantry
Product: Base System Reporter: Tony Finch <dot>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Tony Finch 2001-09-13 03:50:00 UTC
This patch does a number of things:

(1) Since $PATH is known when running the rc scripts, running programs
via their full paths is unnecessary, and makes the daemons in a ps
listing look untidy. So this gets rid of all the /usr/bin/ nonsense.

(2) Checking that sendmail.cf exists is also redundant and may be
wrong, since (because of mailer.conf) sendmail_enable may legitimately
be YES without there being a sendmail.cf.

(3) Checking that a program is executable after checking that it is
enabled is redundant, so don't do that.

(4) There are a couple of other situations where [ -x foo ] is done
which I have removed. The dhclient invocation in pccard_ether is
a bit like a complicated version of change (3). The ldconfig
invocation is now unprotected, but apart from customized systems
it will always be present, and even if it isn't rc won't bomb just
because a program is missing.
Comment 1 dima 2001-09-13 12:24:47 UTC
Tony Finch <dot@dotat.at> wrote:
> >Description:
> This patch does a number of things:
> 
> (1) Since $PATH is known when running the rc scripts, running programs
> via their full paths is unnecessary, and makes the daemons in a ps
> listing look untidy. So this gets rid of all the /usr/bin/ nonsense.

This seems gratuitous--if it's not broken, don't fix it.  Some people
might want to see the full paths in ps (which what I think you're
calling "untidy").

The other changes look okay, although I think they would have a better
chance of going in if you'd have split them up so that, e.g., the
sendmail stuff can be assigned to the sendmail maintainer.
Comment 2 brian 2001-09-13 18:15:05 UTC
> >Number:         30546
> >Category:       bin
[.....]
> This patch does a number of things:
[.....]
> -if [ -r /etc/mail/sendmail.cf ]; then
> -	case ${sendmail_enable} in
> +case ${sendmail_enable} in
> +[Yy][Ee][Ss])
> +	echo -n ' sendmail';	sendmail ${sendmail_flags}
> +	;;
> +*)
> +	case ${sendmail_outbound_enable} in
>  	[Yy][Ee][Ss])
>  		echo -n ' sendmail'
> -		/usr/sbin/sendmail ${sendmail_flags}
> -		;;
[.....]

Be careful here.  When sendmail gets a HUP, it re-execs itself, but 
*only* if argv[0] is an absolute path.  Your patch breaks sendmail's 
ability to process HUPs.

I don't know if any other daemons behave like this.

-- 
Brian <brian@freebsd-services.com>                <brian@Awfulhak.org>
      http://www.freebsd-services.com/        <brian@[uk.]FreeBSD.org>
Don't _EVER_ lose your sense of humour !      <brian@[uk.]OpenBSD.org>
Comment 3 fanf 2001-09-14 01:17:44 UTC
On Thu, Sep 13, 2001 at 06:15:05PM +0100, Brian Somers wrote:
> 
> Be careful here.  When sendmail gets a HUP, it re-execs itself, but 
> *only* if argv[0] is an absolute path.  Your patch breaks sendmail's 
> ability to process HUPs.

Aaargh.

(exim knows where it is installed)

Tony.
Comment 4 Tony Finch freebsd_committer freebsd_triage 2002-05-15 00:20:17 UTC
State Changed
From-To: open->closed

This PR was a moderately rotten idea to start off with and has 
since suffered from a load of bit-rot (the various sendmail 
overhauls and the standardization on using full paths to start 
daemons) so it might as well be mulched.