- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script on startup
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
тАО01-25-2011 03:49 AM
тАО01-25-2011 03:49 AM
I have the below scripts that I would like to run on start up on hp-ux 11i v2 but the routes are not being added automatically.
#!/sbin/sh
/usr/sbin/route add net 10.1.136.0 netmask 255.255.255.0 10.1.156.36 1
/usr/sbin/route add net 10.1.16.0 netmask 255.255.255.0 10.1.156.36 1
I have added the script under /sbin/rc3.d/
and the permission are 744.
my runlevel is 3 :
#who -r
. run-level 3 Jan 23 20:34 3 0 S
Can anyone advise what could be the issue ?
thanks a lot for your usual support.
Jean
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2011 04:12 AM
тАО01-25-2011 04:12 AM
Re: Script on startup
What is the name of the script?
All rc(1m) scripts should be under /sbin/init.d/. Then you should symlink them under the appropriate run level:
ln -s /sbin/rc3.d/nice-name /sbin/rc3.d/S###nice-name
$ ll /sbin/rc3.d/
S100nfs.server@ -> /sbin/init.d/nfs.server
Anything in /etc/rc.log?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2011 04:19 AM
тАО01-25-2011 04:19 AM
SolutionHave you tested them manually (from prompt) to ensure that are reachable?
After this you must create in /sbin/init.d a file with the following content:
#!/sbin/sh
RVAL=0
case $1 in
start_msg)
echo "Adding extra routes"
;;
'start')
/usr/sbin/route add net 10.1.136.0 netmask 255.255.255.0 10.1.156.36 1
/usr/sbin/route add net 10.1.16.0 netmask 255.255.255.0 10.1.156.36 1
;;
'stop')
/usr/sbin/route delete net 10.1.136.0 netmask 255.255.255.0 10.1.156.36
/usr/sbin/route delete net 10.1.16.0 netmask 255.255.255.0 10.1.156.36
;;
*)
echo "usage: $0 {start|stop}"
RVAL=1
;;
esac
exit $RVAL
And finally, from /sbin/rc3.d you must create a symbolic link name with "S" prefix that aims to /sbin/init.d/
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2011 04:32 AM
тАО01-25-2011 04:32 AM
Re: Script on startup
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2011 04:32 AM
тАО01-25-2011 04:32 AM
Re: Script on startup
You might want to review the 'rc(1M)' manpages which document the requirements for start/kill scripts.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2011 07:10 PM
тАО01-25-2011 07:10 PM
Re: Script on startup
If you do not provide the start_msg and stop_msg, then your system shutdown screen will be filled up with dots .............
However, using an rc (start/stop) script is definitely the wrong way to set a permanent route. As mentioned before, you edit the netconf file in /etc/rc.config.d to add routes.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2011 11:42 PM
тАО01-25-2011 11:42 PM