- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Starting and Stopping a Program with a Startup/Shu...
Operating System - HP-UX
1820643
Members
2030
Online
109626
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
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
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
тАО04-03-2003 10:23 AM
тАО04-03-2003 10:23 AM
Starting and Stopping a Program with a Startup/Shutdown Script
Hi there,
I have a third-party client program, Nagios NRPE client, running as a standalone daemon on an HP-UX 10.20 machine. I am trying to get it to run automatically on bootup and do an automatic shutdown.
The easiest solution has been for me to create a single-line startup script which invokes the client. The full command is
/opt/nrpe/bin/nrpe -c /opt/nrpe/nrpe.cfg --daemon
The client is started via an S script in the /sbin/rc2.d directory. There are two problems with this approach.
First, when the system does boot up, and lists the services as being started, the client is started but the listing for the client shows a blank space while the other daemons names are mentioned.
Second, when shutting down the workstation, there is no way to know if the nrpe daemon is being successfully turned off.
The altenative option is to clone an existing startup script and modify that to suit the nrpe client. I have done that and manually ran the script to test it. Although the script can start the nrpe client, it is unable to stop it. I have included the script in this message.
The question is, what is the correct syntax for stopping the nrpe client via the startup script?
I have a third-party client program, Nagios NRPE client, running as a standalone daemon on an HP-UX 10.20 machine. I am trying to get it to run automatically on bootup and do an automatic shutdown.
The easiest solution has been for me to create a single-line startup script which invokes the client. The full command is
/opt/nrpe/bin/nrpe -c /opt/nrpe/nrpe.cfg --daemon
The client is started via an S script in the /sbin/rc2.d directory. There are two problems with this approach.
First, when the system does boot up, and lists the services as being started, the client is started but the listing for the client shows a blank space while the other daemons names are mentioned.
Second, when shutting down the workstation, there is no way to know if the nrpe daemon is being successfully turned off.
The altenative option is to clone an existing startup script and modify that to suit the nrpe client. I have done that and manually ran the script to test it. Although the script can start the nrpe client, it is unable to stop it. I have included the script in this message.
The question is, what is the correct syntax for stopping the nrpe client via the startup script?
A Journey In The Quest Of Knowledge
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2003 10:26 AM
тАО04-03-2003 10:26 AM
Re: Starting and Stopping a Program with a Startup/Shutdown Script
It would be stopped by a kill, or K, script in /sbin/rc1.d (the next lower level).
Pete
Pete
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2003 10:41 AM
тАО04-03-2003 10:41 AM
Re: Starting and Stopping a Program with a Startup/Shutdown Script
Eventhough you are able to start the daemon manully that may not be enough to start/stop using rc. Make sure all PATHS and any other needed env vars are set and exported in your scripts - remember .profile is not sourced.
After you have installed your script in /sbin/init.d/ e.g/ /sbin/init.d/nrpe and made it executable then you need to symbolically link it to entries in the rcN.d directories. The script is manually invoked as /sbin/init.d/nrpe start (or stop).
Let's assume that you want to start at run level 3. Generally, you want to stop it at one lower run-level, i.e. 2.
You would link like this:
ln -s /sbin/init.d/nrpe /sbin/rc3.d/S900nrpe
and
ln -s /sbin/init.d/nrpe /sbin/rc.d/K100nrpe.
By convention the "S" numbers plus the "K" numbers = 1000. That tends toi order the sequence correctly.
After you have installed your script in /sbin/init.d/ e.g/ /sbin/init.d/nrpe and made it executable then you need to symbolically link it to entries in the rcN.d directories. The script is manually invoked as /sbin/init.d/nrpe start (or stop).
Let's assume that you want to start at run level 3. Generally, you want to stop it at one lower run-level, i.e. 2.
You would link like this:
ln -s /sbin/init.d/nrpe /sbin/rc3.d/S900nrpe
and
ln -s /sbin/init.d/nrpe /sbin/rc.d/K100nrpe.
By convention the "S" numbers plus the "K" numbers = 1000. That tends toi order the sequence correctly.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-03-2003 10:50 AM
тАО04-03-2003 10:50 AM
Re: Starting and Stopping a Program with a Startup/Shutdown Script
Any environment variable can mess things up. Though counter to logic, some startups require a TERM variable. Probably not this one.
You can use /sbin/init.d/template as a template for that script.
Just make a copy, don't mess with the original.
SEP
You can use /sbin/init.d/template as a template for that script.
Just make a copy, don't mess with the original.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
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.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP