Operating System - HP-UX
1845811 Members
4446 Online
110250 Solutions
New Discussion

environnement during boot

 
dioubiban
New Member

environnement during boot

Hello,
I got a some new servers running hpux11.23. Some third-party rc boot scripts use the current environnement for starting their products unlike HP's rc scripts which almost redefines the PATH variable which is fine.

root runs /sbin/sh ans in an interactive sessio theer is no PATh pbs with 3rd rc scripts, but as the machine boots i can see PATH pb in rc.log.

How can i find the "core" environnement when rc scripts begin ?

Thanks A lot
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: environnement during boot

Hi:

The PATH under which the 'rc' scripts run is '/sbin'.

# cat /sbin/rc

Your customized 'rc' scripts should use absolute paths to execute your applications and/or set any environmental variables they need.

Regards!

...JRF...
Eric SAUBIGNAC
Honored Contributor

Re: environnement during boot

Hi "Dieu vivant",

to customize your 3rd party scripts have a look at /sbin/init.d/template : PATH variable is redefined in a such a way that it satisfies most environements.

And in general, 3rd party scripts do not follow the rules defined for rc scripts : paramaters and returned values. So it is a good example for doing some re-design.

Hope this will help

Regards
Eric
Steven E. Protter
Exalted Contributor

Re: environnement during boot

shalom,

Sounds like the third party product is not in compliance with standards.

rc scripts are supposed to provide their own environment and not impact other script operations.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor

Re: environnement during boot

Good script writing dictates that *EVER* script redefines PATH amd everything else that is needed. To hope that a specific machine has the correct environment is just asking for a lot sysadmin work. Each script, whether an rc start/stop script, cron job or batch file should stand on it's own with no help from the environment. Yes, you could look at the /sbin/rc start/stop control script and modify it. Now you have a non-standard system that will break sometime in the future when a patch wipes out your customization. And of course you have to port these changes to other systems when needed.

Fix the start/stopr script scripts. I have never seen an acceptable vendor application rc script -- they all need help. Everything from the environment, to not handling the 4 standard params, to not handling start when not needed and not stopping an app if the control variable=0. And the worst is the very unstable methods using ps and grep to find the application. Most vendors will tell you that they are trying to standardize but the results are just mediocre to poor in most aspects.


Bill Hassell, sysadmin
dioubiban
New Member

Re: environnement during boot

Thanks a lot for yours answers, i look at /etc/inittab but the line sqnc::wait:sbin/rc was not so explicit as in solaris where it is moer explit to my sense
s2:2:wait:/sbin/rc2 ( no troll, please ;-)

Thanks again

Francis
dioubiban
New Member

Re: environnement during boot

Hello All,

Thanks a lot for yours answers, i looked at /etc/inittab but the line sqnc::wait:sbin/rc was not so explicit as in solaris where it looks like

2:2:wait:/sbin/rc2 ( no troll, please ;-)

I agree with the fact that scripts ( and especially boot scripts ) should set their own environnement as you can be sure of waht it does.

Thanks again

Francis