- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to put timestamp in /etc/rc.log
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2007 10:36 PM
тАО10-13-2007 10:36 PM
whether its possible to put timestamp in rc.log. mean whenever a rc script start executing while shutdown/bootup, it should put execution start time in rc.log.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2007 01:28 AM
тАО10-14-2007 01:28 AM
Re: How to put timestamp in /etc/rc.log
You could do this if you wanted, but why? At the beginning of the current '/etc/rc.log' is a timestamp.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2007 08:26 AM
тАО10-14-2007 08:26 AM
Re: How to put timestamp in /etc/rc.log
The rc.log file is a sequential record of the boot.
If you want more, feel free to add `date` >> /etc/rc.log to any startup script you want.
Most of the daemons started have their own logs, so if you look around, you can find the time everything started or did not start. It requires a bit more system knowledge, but its helpful in doing hte job.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2007 09:34 AM
тАО10-14-2007 09:34 AM
Re: How to put timestamp in /etc/rc.log
The requirement is in cases where server boot takes relatively longer time. If we have time stamp we can trace easily, which process/rc-script caused the delay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2007 10:39 AM
тАО10-14-2007 10:39 AM
Re: How to put timestamp in /etc/rc.log
Our colleagues already gave you the bad news :) There are no timestamps in /etc/rc.log by
current design.
To debug the boot processes, there are some simple techniques that can help (apart from changing every RC script):
a) Run the following:
# ll -ut /sbin/init.d
Assuming that no-one has opened any files in /sbin/init.d since the boot, a single "ll -ut" will show the time they were last ran.
b) Check /etc/utmp file using the fwtmp(1)
command. This will not help with startup
scripts but with the commands ran by
init(1) early in the boot before the RC scripts are started.
# /usr/sbin/acct/fwtmp < /etc/utmp
Here is an excerpt from a SuperDome nPar:
system boot 0 2 0000 0000 1190380685 Sep 21 23:18:05 2007
run-level 3 0 1 0063 0123 1190380685 Sep 21 23:18:05 2007
vxenable vxen 98 8 0000 0000 1190380685 Sep 21 23:18:05 2007
bcheckrc brc1 99 8 0000 0000 1190380704 Sep 21 23:18:24 2007
cat cprt 146 8 0000 0000 1190380704 Sep 21 23:18:24 2007
rm ems1 147 8 0000 0000 1190380704 Sep 21 23:18:24 2007
cat ems2 148 8 0000 0000 1190380704 Sep 21 23:18:24 2007
sh link 149 8 0000 0000 1190380704 Sep 21 23:18:24 2007
rc sqnc 153 8 0000 0000 1190381060 Sep 21 23:24:20 2007
old time 0 3 0000 0000 1190381018 Sep 21 23:23:38 2007
new time 0 4 0000 0000 1190381019 Sep 21 23:23:39 2007
getty cons 1938 5 0000 0000 1190381060 Sep 21 23:24:20 2007
krsd krsd 1939 5 0000 0000 1190381060 Sep 21 23:24:20 2007
sfd sfd 1940 5 0000 0000 1190381060 Sep 21 23:24:20 2007
cimserve cim1 1941 5 0000 0000 1190381060 Sep 21 23:24:20 2007
sh ems3 1942 8 0000 0000 1190381060 Sep 21 23:24:20 2007
p_client ems4 1945 5 0000 0000 1190381060 Sep 21 23:24:20 2007
Cheers,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2007 08:39 PM
тАО10-14-2007 08:39 PM
Re: How to put timestamp in /etc/rc.log
so, need to have a quick check process and thats why timestamp is required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2007 08:38 AM
тАО10-17-2007 08:38 AM
SolutionI keep a copy of the orig and local customized file.
-r--r--r-- 1 bin sys 21742 Oct 11 11:33 rc.utils
-r--r--r-- 1 bin sys 21742 Oct 11 11:33 rc.utils.local
-r--r--r-- 1 bin sys 21454 Jan 2 2004 rc.utils.orig
Here is what I did, the difference between the files.
diff rc.utils.orig rc.utils
617c617
< echo "----------------------------" >> $LOGFILE
---
> echo "---------------------------- "$(date) >> $LOGFILE
747c747
< echo "----------------------------" >> $LOGFILE
---
> echo "---------------------------- "$(date) >> $LOGFILE
Of course, you need to make sure you keep the same permissions, etc., and check when the system is patched if the rc.utils file has been changed.
I also keep more copies of the old rc.log files by expanding the "Initialize log file." section.
# Initialize log file.
if [ "$1" = "boot" ]; then
if [ -f "${LOGFILE}.old.2" ]; then
cat ${LOGFILE}.old.2 > ${LOGFILE}.old.3
fi
if [ -f "${LOGFILE}.old.1" ]; then
cat ${LOGFILE}.old.1 > ${LOGFILE}.old.2
fi
if [ -f "${LOGFILE}.old" ]; then
cat ${LOGFILE}.old > ${LOGFILE}.old.1
fi
if [ -f "${LOGFILE}" ]; then
cat ${LOGFILE} > ${LOGFILE}.old
echo "Old ${LOGFILE} moved to ${LOGFILE}.old" > ${LOGFILE}
fi
fi
Hope this is helpful.
Marlou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2007 08:53 AM
тАО10-17-2007 08:53 AM
Re: How to put timestamp in /etc/rc.log
print -s $(date) >>/etc/rc.log
at the start or end of the rc scripts...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2007 07:19 PM
тАО10-17-2007 07:19 PM
Re: How to put timestamp in /etc/rc.log
PLease correct if I am wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-18-2007 07:21 AM
тАО10-18-2007 07:21 AM
Re: How to put timestamp in /etc/rc.log
Old /etc/rc.log moved to /etc/rc.log.old
**************************************************
HP-UX Start-up in progress
Wed Oct 17 16:09:54 PDT 2007
**************************************************
Configure system crash dumps
Output from "/sbin/rc1.d/S080crashconf start":
---------------------------- Wed Oct 17 16:09:55 PDT 2007
EXIT CODE: 0
Removing old vxvm files
Output from "/sbin/rc1.d/S090sw_clean_vxvm start":
---------------------------- Wed Oct 17 16:09:56 PDT 2007
VxVM device node check
Output from "/sbin/rc1.d/S091vxvm-nodes-check start":
---------------------------- Wed Oct 17 16:09:56 PDT 2007
I've been using this on my systems for quite a while. Now if HP would put it in permanently that would be great.
Marlou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2007 07:26 AM
тАО10-19-2007 07:26 AM
Re: How to put timestamp in /etc/rc.log
Have you contacted the Response Center and filed an enhancement request?
Either you or SKSingh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2007 09:33 AM
тАО10-21-2007 09:33 AM
Re: How to put timestamp in /etc/rc.log
I am not sure, how to put enhancement request form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2007 08:53 AM
тАО10-22-2007 08:53 AM
Re: How to put timestamp in /etc/rc.log
Marlou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2007 10:07 AM
тАО10-22-2007 10:07 AM
Re: How to put timestamp in /etc/rc.log
If you have support contract, you can call the Response Center or you can use the "Support Case Manager" link on the HP-UX forum page:
http://www1.itrc.hp.com/service/mcm/homepageRequest.do?lb=on