- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Startup script not work
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
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
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
02-07-2012 02:54 AM
02-07-2012 02:54 AM
Startup script not work
hi,
This is my script
cat .syslog1.sh
cp /var/adm/syslog/syslog.log /c02/oldsyslog/syslog2.`date +%F--%T`
This is link file:--
ln -s /sbin/init.d/.syslog1.sh /sbin/rc2.d/K008.syslog1.sh
ln -s /sbin/init.d/.syslog1.sh /sbin/rc3.d/S992.syslog1.sh
but its not work on server startup.
Additional i am also make configuration file on under /etc/rc.config.d .syslog1.shconf
cat .syslog1.shconf
#!/sbin/sh
# @(#)B.11.31_LR
# syslog configuration. See syslog(1m)
#
# .syslog1.sh: Set to 1 to start .sylog1.sh daemon
#
.syslog1.sh=1
How can its works on server startup time.
Thanks
aamir uddin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 03:39 AM
02-07-2012 03:39 AM
Re: Startup script not work
>cp /var/adm/syslog/syslog.log /c02/oldsyslog/syslog2.`date +%F--%T`
Where is your: #!/sbin/sh line?
You should model it off of /sbin/init.d/template. See rc(1m).
Also, you shouldn't really name your script with a leading "." since there is no need to "hide" it.
>ln -s /sbin/init.d/.syslog1.sh /sbin/rc2.d/K008.syslog1.sh
You want to do this on shutdown too?
>.syslog1.sh=1
This is not valid. Shell variables can't have ".". Also, it doesn't appear you even use this variable in your .syslog1.sh script.
>How can it work on server startup time?
If you follow the rules in rc(1m), that should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 04:30 AM
02-07-2012 04:30 AM
Re: Startup script not work
You want to do this on shutdown too?
How can do on shutdown?
Thanks
aamir uddin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 12:49 PM
02-07-2012 12:49 PM
Re: Startup script not work
>How can do on shutdown?
By having this /sbin/rc2.d/K008.syslog1.sh symlink it will be done. But does it make sense?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 10:04 PM
02-07-2012 10:04 PM
Re: Startup script not work
Hi,
I have been done all process,but whenever server boots its not copy syslog.log file on /c02/oldsyslog folder.
and i have changed .syslog1.sh file to syslog1.sh
Please look it.
uatdata2#
uatdata2#
uatdata2#cd /sbin/init.d
uatdata2#ll syslog1.sh
-rwxrwxrwt 1 root sys 99 Feb 7 17:58 syslog1.sh
uatdata2#
uatdata2#cd /sbin/rc3.d
uatdata2#ll
total 0
lrwxr-xr-x 1 root root 23 Dec 15 2010 S100nfs.server -> /sbin/init.d/nfs.server
lrwxrwxrwx 1 bin bin 22 Dec 31 2010 S800cmcluster -> /sbin/init.d/cmcluster
lr--r--r-- 1 bin bin 24 Dec 15 2010 S823hpws_apache -> /sbin/init.d/hpws_apach e
lr--r--r-- 1 bin bin 24 Dec 15 2010 S823hpws_tomcat -> /sbin/init.d/hpws_tomca t
lr--r--r-- 1 bin bin 24 Dec 15 2010 S823hpws_webmin -> /sbin/init.d/hpws_webmi n
lr--r--r-- 1 bin bin 26 Dec 15 2010 S823hpws_webproxy -> /sbin/init.d/hpws_web proxy
lr--r--r-- 1 bin bin 26 Dec 15 2010 S823hpws_xmltools -> /sbin/init.d/hpws_xml tools
lrwxr-xr-x 1 bin bin 18 Dec 27 2010 S828kwdbd -> /sbin/init.d/kwdbd
lr-xr-xr-x 1 bin bin 25 Dec 15 2010 S829hpvmguestlib -> /sbin/init.d/hpvmguest lib
lrwxrwxrwx 1 root sys 21 Jan 5 2011 S960init.crs -> /sbin/init.d/init.crs
lr-xr--r-- 1 bin bin 23 Dec 23 2010 S990dtlogin.rc -> /sbin/init.d/dtlogin.rc
lrwxrwxrwx 1 root sys 23 Feb 7 18:07 S992syslog1.sh -> /sbin/init.d/syslog1.sh
lrwxr-xr-x 1 root sys 18 Dec 15 2010 S998amgrd -> /sbin/init.d/amgrd
lrwxr-xr-x 1 root sys 21 Dec 31 2010 S99prngd.rc -> /sbin/init.d/prngd.rc
uatdata2#cat /sbin/init.d/syslog1.sh
#!/sbin/sh
# @(#)B.11.31_LR
cp /var/adm/syslog/syslog.log /c02/oldsyslog/syslog2.`date +%F--%T`
uatdata2#
As we know hpux will move syslog.log to OLDsyslog.log after a reboot ..so we have only OLDsyslog.log and syslog.log after reboot.How to make a custom startup script that will move the syslog.log file away to a safe location each time the system reboots.
Please tell how can do that
Thanks
aamir uddin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 11:03 PM
02-07-2012 11:03 PM
Re: Startup script not work
>but whenever server boots it's not copy syslog.log file on /c02/oldsyslog folder.
Have you looked at /etc/rc.log to see if it was executed?
>HP-UX will move syslog.log to OLDsyslog.log after a reboot .. so we have only OLDsyslog.log and syslog.log after reboot.
I assume from rc.log, this is done with /sbin/rc2.d/S220syslogd and by the time your script is invoked, the file is already OLDsyslog.log.
>How to make a custom startup script that will move the syslog.log file away to a safe location each time the system reboots.
As I mentioned above, you need to copy /sbin/init.d/template and put your changes in it.
As it is, it will invoke your script for start and start_msg unless you use the template.