Re: rc script to let a service wait for db available

From: Sysadmin Lists <sysadmin.lists_at_mailfence.com>
Date: Thu, 28 Apr 2022 17:40:12 UTC
This isn't entirely true. rc scripts have a default PATH and HOME. From service(8):

ENVIRONMENT
     When used to run rc.d scripts the service command sets HOME to / and PATH
     to /sbin:/bin:/usr/sbin:/usr/bin which is how they are set in /etc/rc at
     boot time.

Something similar holds true for `cron' as well. I see a lot of unnecessary setting of
absolute paths for binaries that reside in default PATHs.

> ----------------------------------------
> From: Eugene Grosbein <eugen@grosbein.net>
> Sent: Thu Apr 28 11:53:42 CEST 2022
> To: Axel Rau <Axel.Rau@chaos1.de>, <freebsd-hackers@freebsd.org>
> Subject: Re: rc script to let a service wait for db available
> 
> 
> 28.04.2022 15:55, Axel Rau wrote:
> 
> > Ah - yes. Now it calls the script in the background, but there is still an issue.
> > It does not start the server, as it does while calling from the command line.
> 
> Generally it means bugs in the startup script: it relies on calling process environment
> like PATH, LANG etc. It must not. It must set needed variables all by itself
> starting from PATH.
> 
> 
> 


-- 
Sent with https://mailfence.com  
Secure and private email