Operating System - HP-UX
1833758 Members
2921 Online
110063 Solutions
New Discussion

how to recreate /etc/rc.log file

 
daelman
New Member

how to recreate /etc/rc.log file

Hello,

We suppressed, by mistake, the file /etc/rc.log. We don't arrive to recreate it.

Thanks for your help

Claire
11 REPLIES 11
Graham Cameron_1
Honored Contributor

Re: how to recreate /etc/rc.log file

/etc/rc.log is recreated at boot time.
If you have lost it, you can' t recreate it until next reboot.
You can restore from backup if you have one.
There is probably a previous copy in /etc/rc.log.old, unless you've rm'd that also.
-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Hoefnix
Honored Contributor

Re: how to recreate /etc/rc.log file

At systemboot or change of runlevel it will recreate it. To be shure it can write to the file do a "touch /etc/rc.log" as user root.

T G Manikandan
Honored Contributor

Re: how to recreate /etc/rc.log file

I think the machine again while startup should re-create that file for you.

ELse

#cd /etc
#touch rc.log
#chown root:root /etc/rc.log
#chmod 644 /etc/rc.log
Elmar P. Kolkman
Honored Contributor

Re: how to recreate /etc/rc.log file

The rc.log creation is controlled by rc.utils in /sbin, which uses for instance /etc/rc.config.d/list_mode

Take a look at those parameters. If LIST_MODE is set to off this could be the case. Otherwise it is possible the rc.log file resides in /tmp.

Hope this solves your issue.
Every problem has at least one solution. Only some solutions are harder to find.
daelman
New Member

Re: how to recreate /etc/rc.log file

In fact, we made a copy before suppress it but we don't arrive to copy the file in /etc/rc.log. The problem is that we wanted to make place in /etc. When rc.log has been moved, no space has been liberated. So now, we can't move our original file.
Graham Cameron_1
Honored Contributor

Re: how to recreate /etc/rc.log file

If you're saying that /etc is full then you have bigger problems than a missing rc.log file.
Can you post the output of:

bdf /etc
ls -ld /etc/rc*
ls -l [your rc.log backup]

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
daelman
New Member

Re: how to recreate /etc/rc.log file

The problem is that now there is no more rc.log file on /etc but space from rc.log is not liberated

Filesystem
kbytes used avail %
204800 175088 29560 86% /

ll rc.log
-rw-rw-rw- 1 root sys 47715803 Oct 22 10:48 rc.log

Graham Cameron_1
Honored Contributor

Re: how to recreate /etc/rc.log file

There is your answer.

On /etc you have only 29Mb free, which is not a huge amount, but possibly enough for normal needs.

However, your rc.log file, at 47Mb, is bigger than the free space on /etc, which is why you can't replace it.

In fact for an rc.log file, it's *HUGE*.
Here's mine:

-rw-r--r-- 1 root root 36524 Oct 5 16:34 /etc/rc.log

I can only surmise that part of your boot process creates huge amounts of log output, and I suggest this needs to be investigated and addressed. What is in that 47Mb file ??

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Elmar P. Kolkman
Honored Contributor

Re: how to recreate /etc/rc.log file

There is one more thing that is odd and perhaps the cause of your problem: some process is still writing in your rc.log.
Or have you rebooted this morning ?

Please do a fuser on your rc.log file. I think you will see that one of your processes didn't redirect its output to its own logfile and is still using it.
You could also look at the bottom lines in the file (tail is a good command for this) to see what is being written to see what needs to be fixed.
Every problem has at least one solution. Only some solutions are harder to find.
Bill Hassell
Honored Contributor

Re: how to recreate /etc/rc.log file

As mentioned, your rc.log file is VERY large and that indicates that something is VERY wrong during bootup. This file is simply a log of the bootup steps found in /sbin/init.d so one (or more) of the scripts in that directory is doing something incorrectly. Most likely, you have a custom startup script in that directory which has a link in /sbin/rc.2 (or perhaps rc.1) or you have a actual script stored in one of the /sbin/rc.* directories. That script is very likely not exiting but continues to write to the /etc/rc.log file which is why removing the file does not free any space.

When a process has a file open, it can be removed from the directory so that it does not show, but no space will be reclaimed until all processes have closed the file. Since this process is probably in your startup script, it will always be running (and making the file massively large. You'll need to move this startup script to /tmp and reboot. Then read over the details about start/stop scripts and how to handle the output from start/stop scripts. Use the 'tail' command to look at the end of the 47meg file to see what is going wrong.


Bill Hassell, sysadmin
daelman
New Member

Re: how to recreate /etc/rc.log file

There is another process which put his logs on rc.log. This is why rc.log is too big.