- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Start a script with another script at boot
Operating System - HP-UX
1752257
Members
5497
Online
108785
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО08-25-2008 01:28 PM
тАО08-25-2008 01:28 PM
I've written a system monitoring script that I want to initiate at boot. This script needs to continue running indefinitely.
I've placed a start/stop script for it in /sbin/init.d and setup the link in rc3.d.
I can tell it tried to run when the system boots, but for some reason doesn't keep running.
If in a normal login and su'd to root I go to /sbin/init.d and type './mymonitor start' the monitoring script starts and keeps running just fine.
The line in the /sbin/init.d/mymonitor script that starts the monitoring script looks like this:
/usr/bin/nohup /somepath/monitor.sh >/somepath/monitor.log 2>&1 &
After booting the monitor.log file is created but contains 0 bytes. Similarly there is no indication of any trouble in /etc/rc.log.
Any ideas...? TIA.
I've placed a start/stop script for it in /sbin/init.d and setup the link in rc3.d.
I can tell it tried to run when the system boots, but for some reason doesn't keep running.
If in a normal login and su'd to root I go to /sbin/init.d and type './mymonitor start' the monitoring script starts and keeps running just fine.
The line in the /sbin/init.d/mymonitor script that starts the monitoring script looks like this:
/usr/bin/nohup /somepath/monitor.sh >/somepath/monitor.log 2>&1 &
After booting the monitor.log file is created but contains 0 bytes. Similarly there is no indication of any trouble in /etc/rc.log.
Any ideas...? TIA.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2008 01:40 PM
тАО08-25-2008 01:40 PM
Solution
Is your mymonitor script perhaps dependent on some environment variable that may be set when you are logged in, but not set when the script runs at boot time?
Remember that the environment that gets used when starting the system is VERY limited. If there are any variables that are needed they should be set in the start script and dependent on anything external.
Remember that the environment that gets used when starting the system is VERY limited. If there are any variables that are needed they should be set in the start script and dependent on anything external.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2008 01:53 PM
тАО08-25-2008 01:53 PM
Re: Start a script with another script at boot
I've thought about that, but if something wasn't working due to missing path, etc., there should be something recorded in rc.log or monitor_start.log. It's as thoough the process is just terminated as soon it starts.
I don't get to reboot the system very much to test this, but I will later today so I'll add something to the monitor.sh to write to the monitor_start.log file and try to see how far it gets.
I don't get to reboot the system very much to test this, but I will later today so I'll add something to the monitor.sh to write to the monitor_start.log file and try to see how far it gets.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2008 04:34 PM
тАО08-25-2008 04:34 PM
Re: Start a script with another script at boot
Well Patrick, you were correct, but I can't explain why my previous run at this didn't produce anything in the log file. This time the log file had a bunch of 'does not exist' errors for ping, grep, cut, sleep, etc. It would seem I needed to write *something* to the 1> file before it would pickup all the 2>&1 information. Strange.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP