Operating System - HP-UX
1832275 Members
2245 Online
110041 Solutions
New Discussion

Where to place customized scripts in HP-UX

 
network_4
Advisor

Where to place customized scripts in HP-UX

Hi,

Please let me know where to place Customized scripts so that they can be executed at the time of boot in HP-UX. As in Redhat we can place those scripts in rc.local file and those scripts get executed while boot process. So please let me know.
4 REPLIES 4
Fat Scrape
Honored Contributor

Re: Where to place customized scripts in HP-UX

Hi,

place is:
1) /sbin/init.d where there is a template to create a custom start/stop script at boot

2) link files in /sbin/rc*.d control the sequencing order of the execution scripts,

3) use the configuration variables in /etc/rc.config.d to change the behavior of scripts in /sbin/init.d.

see this thread:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1140119

Regards,

Fat
Ralph Grothe
Honored Contributor

Re: Where to place customized scripts in HP-UX

rc.local, as is used by many Linux distros,
rather seems like a reverence to ole BSD style startup of services.
I think the distro packagers have taken up this from Slackware which avoids the somewhat convoluted SysV boot up and rather sticks to BSD style to make it "easier" for users to bring up their services without having to write and link a full fledged SysV init script.
But since HP-UX has a strong SysV bias, especially as the runlevel concept is concerned, you really should take a copy of the template file from /sbin/init.d and edit it to your needs, just as "Fat" recommended.
Be careful with the exit codes of your init script, for too liberal a scheme could result in an inadvertent infinite reboot loop of your machine (I think it was exit 3).
But the comments in template should mention these specifics.
Madness, thy name is system administration
karthik_in83
Frequent Advisor

Re: Where to place customized scripts in HP-UX

Hi,

if you asign your script name is "marketing",do like this...

1.Put this script in /sbin/init.d.
2.Then edit /etc/rc.config.d, make a enry like this, # vi /etc/r.config.g
marketing=1
3. Now, you should creae 2 links for start nd stop the services in /sbin/rcX.d,here X is run level.
if you want to run in run level 3,make a link in /sbin/rc3.d/s730 marketing.
If you want to stop the script in level 2,make a link in /sbin/rc2.d/k720 marketing.


by KK
MarkSyder
Honored Contributor

Re: Where to place customized scripts in HP-UX

In addition to Karthik's reply, it is worth pointing out that the numbers of the start/stop scripts should add up to 1000.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing