1758362 Members
2464 Online
108868 Solutions
New Discussion юеВ

Re: HP-UX differences

 
SOLVED
Go to solution
Heironimus
Honored Contributor

Re: HP-UX differences

Some HP init scripts source in the specific file they need under /etc/rc.config.d, but others source in all the files under /etc/rc.config.d. Since "foo.orig" sorts after "foo" any script that just sources everything in would get the values set in the backup file foo.orig instead of the new values in foo.
James R. Ferguson
Acclaimed Contributor

Re: HP-UX differences

Hi (again):

Insofar as HP's startup paradigm, the manpages for 'rc(1M)' offer a very good overview and discussion of the requirements.

The original 10.x whitepaper below still applies today when you add the documentation for the return code of >= 4.

As for placing backup copies of files in '/etc/rc.config.d', this *IS* *ALLOWED* *IF* you follow a simple guideline documented in '/etc/rc.config':

That is, filenames containing [.,~#] are not sourced. Rather, they are possible names of
backup files such as file.bak, file.OLD, ~file, file~, file,v, #file, etc.

Simple be very careful to follow this rule. DO NOT create a backup copy of (for example) the '/etc/rc.config.d/netconf' file by naming it 'oldnetconf' or 'netconfold'. A copy like that WILL BE sourced AFTER the real 'netconf' is found and thus its variable values will override the previous settings which are probably the current ones!

Regards!

...JRF...
Matti_Kurkela
Honored Contributor

Re: HP-UX differences

Yes, I actually know that /etc/rc.config won't source any scripts containing [.,~#] in their names. But has anyone seen this documented anywhere _other than_ the /etc/rc.config script itself?

If it isn't documented, can you trust it won't change without notice in the next HP-UX version? Or that it was exactly like that in some old HP-UX version you might still need to maintain - including 10.20 or earlier?

From the rc.config(4) manpage, HP-UX 11.23:

----------
/etc/rc.config

The file /etc/rc.config is a script that sources all of the /etc/rc.config.d/* scripts[...]
----------

The man page definitely says "all of the /etc/rc.config.d/* scripts". The fact that /etc/rc.config is actually a bit more selective is not mentioned, and I'm forced to conclude that it's an extra feature that is "subject to change without notice". So I won't rely on it, and certainly won't urge less experienced people to do so.

I was on a HP-UX sysadmin course and the instructor recommended a simple policy of not leaving any unnecessary files to /etc/rc.config.d. That was his opinion, and you're free to disagree - but I find it a sensible policy. Doing otherwise allows the chance to experience Murphy's Law in action.

MK
MK
James R. Ferguson
Acclaimed Contributor

Re: HP-UX differences

Hi (again):

> Matti: Yes, I actually know that /etc/rc.config won't source any scripts containing [.,~#] in their names. But has anyone seen this documented anywhere _other than_ the /etc/rc.config script itself?

No, I can't say that I have.

> Matti: If it isn't documented, can you trust it won't change without notice in the next HP-UX version? Or that it was exactly like that in some old HP-UX version you might still need to maintain - including 10.20 or earlier?

I can't say I always trust the documention, either. There is no substitute for reading the code.

> Matti: From the rc.config(4) manpage, HP-UX 11.23...says "all of the /etc/rc.config.d/* scripts". The fact that /etc/rc.config is actually a bit more selective is not mentioned, and I'm forced to conclude that it's an extra feature that is "subject to change without notice". So I won't rely on it, and certainly won't urge less experienced people to do so.

You are certainly free to hold that advice. Please note that I said that you *CAN* get into trouble if you disregard the rules enforced by the aforementioned script. Otherwise, you *CAN* keep backup files in the directory.

I guess I would agree with you insofaras for the inexperienced, don't do it.

Regards!

...JRF...