- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script problem
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
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
тАО05-16-2002 05:44 AM
тАО05-16-2002 05:44 AM
I have made a script to run a software at boot.
I have linked it in /sbin/rc3.d, I have created the config file in /etc/rc.config.d
But ......
if I try to run it in a shell, it work.
If i try to run it in crontab, it work
If I reboot the server, start and ( I can see it with a ps -ef in a loop) and stop without an error or log.
Someone know why???
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 05:47 AM
тАО05-16-2002 05:47 AM
Re: script problem
It's probably an environment issue. ALL commands in scripts should have the FULL path. Never assume that the system has a PATH variable set correctly, ie:
instead of
lsof | grep TCP
should be
/usr/local/bin/lsof | grep TCP
or better yet
/usr/local/bin/lsof | /usr/bin/grep TCP
How about posting the script?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 05:51 AM
тАО05-16-2002 05:51 AM
Re: script problem
No it isn't a PATH problem.
If I try to run it in a crontab, it work.
And I have write all PATH in all command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 05:53 AM
тАО05-16-2002 05:53 AM
Re: script problem
Put set -x in the second line
When you run it all commands are sent to standard out as they are executed
Then you can see what it is doing.
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 05:53 AM
тАО05-16-2002 05:53 AM
Re: script problem
Does it show that it started correctly in the /etc/rc.log file?
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 05:55 AM
тАО05-16-2002 05:55 AM
Re: script problem
if it's too big for that, add a -x to the first line (either #!/bin/ksh -x or #!/bin/sh -x depending on which shell you are using) and then add this line to route standard error to a log file:
exec 2>/tmp/errorlog.txt
and then boot your box and see what you get in the error log file. You should be able to tell which line the script is stopping on and what the error is.
HTH
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 05:58 AM
тАО05-16-2002 05:58 AM
Re: script problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 06:00 AM
тАО05-16-2002 06:00 AM
Re: script problem
If you want the script to execute during system shutdown, there should be another link in /sbin/rc2.d whose name starts with Kyyy,
where xxx + yyy = 1000
(this determines the opposite order of execution during system shutdown.).
During system startup the system will execute:
1)
2)
During system shutdown, the system will execute
3)
4)
Therefore your script should be able to handle the parameters:
start_msg
start
stop_msg
stop
HTH,
Mladen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 06:02 AM
тАО05-16-2002 06:02 AM
Re: script problem
All work correctly, with -x, with path, with all
but at boot time no!! Sigh Sigh
Whyyyyyy!!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2002 06:08 AM
тАО05-16-2002 06:08 AM
Re: script problem
I have used the template
I had check with
/sbin/rc3.d/S101nrpe start
ok
/sbin/rc3.d/S101nrpe stop
ok
/sbin/rc3.d/S101nrpe start_msg
ok
/sbin/rc3.d/S101nrpe stop_msg
ok
but at the boot time no it doesn't work!!!!!