1837343 Members
4983 Online
110116 Solutions
New Discussion

Problem with /etc/rc.log

 
PUJOL Gregory
Occasional Advisor

Problem with /etc/rc.log

Hi,

We have 4 engines D220 HP-UX 10.20 with a C home-made application.
The daemons are launched from shell-scripts with nohup during the boot (links from /sbin/init.d to /etc/rc2.d)

All the logs on this application are on a /var/adm/syslog file or nohup.out files. But, on one machine, there is logs on /etc/rc.log file.

Do you have some ideas?

Thanks in advance.
7 REPLIES 7
CHRIS_ANORUO
Honored Contributor

Re: Problem with /etc/rc.log

The /etc/rc.log is the boot up/shutdown log file for all startup/shutdown scripts.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
James R. Ferguson
Acclaimed Contributor

Re: Problem with /etc/rc.log

Hi:

/etc/rc.log receives the start/stop entries for all standard rc.d scripts. /var/adm/syslog/syslog.log can be the recipient of log messages when logging is enabled, as for instance, when the ftpd daemon is initiated. See man 1M 'syslogd', man 'syslog', man 'logger', and man 'ftpd' for more information and examples.

...JRF...
Anthony deRito
Respected Contributor

Re: Problem with /etc/rc.log

There are 2 modes of notification when startup scripts run from /sbin/init.d. They are raw mode and checklist mode. If the script is using checklist mode, both stderr and stdout is redirected to /etc/rc.log. If the script is using raw mode, both stderr and stdout go to the console.

What mode the script is in is based on the exit value of the startup script. They are:

0 - no error, OK in checklist (rc.log)
1 - error, fail in checklist (rc.log)
2 - skipped, N/A in checklist (rc.log)
3 - reserved

These are the ONLY values acceptable. Any other value will appear as Skipped in checklist.

Take a look at the /sbin/init.d/template file which will explain this in more detail. All of your startup scripts should use this template for consistency.

Tony
John Palmer
Honored Contributor

Re: Problem with /etc/rc.log

The standard output and standard error of all startup scripts are directed to /etc/rc.log - see man rc.

There must be a difference in the way that you start your application on this one server or the application itself.

Are you not using nohup?


PUJOL Gregory
Occasional Advisor

Re: Problem with /etc/rc.log

Yes, we use nohup...

The main script launch differents scripts, then these scripts launch binary programs with nohup.
James R. Ferguson
Acclaimed Contributor

Re: Problem with /etc/rc.log

Hi:

On all the machines are the scripts launched at the same point? I assume that syslogd is running, when the script in question is started? Perhaps you could post the startup script that is misbehaving, too.

...JRF...
Anthony deRito
Respected Contributor

Re: Problem with /etc/rc.log

As mentioned before, raw mode will not print messages to /etc/rc.log. A variable called LIST_MODE can override the default which is to print messages to /etc/rc.log based on a valid return code of 0,1,2, or 3.

LIST_MODE has 4 options. 0 is the default. 3 is the option which puts your script in raw mode notification and prints output only to the console.

Take a look at /etc/rc.config.d/list_mode file for this info.

It is probably unlikely that you are setting the LIST_MODE variable in your script but I just wanted to clarify the issue.

Tony