- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Command execution at system 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
тАО04-30-2009 07:46 AM
тАО04-30-2009 07:46 AM
I need to execute a command which starts a license deamon,as another user on startup of my HP UX system. How can i acheive this?
#uname -a
HP-UX unix1 B.11.11 U 9000/800 3654209165 unlimited-user license
Thanks in Advance,
Din
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2009 07:53 AM
тАО04-30-2009 07:53 AM
Re: Command execution at system startup
You can setup a statup 'rc' script. The manpages for 'rc(1M') and/or this (still) applicable whitepaper provide all the details you need:
http://docs.hp.com/en/934/startup.pdf
You can copy the '/sbin/init.d/template' file appropriately to form the basis for your script.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2009 07:59 AM
тАО04-30-2009 07:59 AM
Re: Command execution at system startup
Create a traditional script with something like
PATH=...
SHLIB_PATH=...
export PATH SHLIB_PATH
start(){
su user -c command_to_start_daemon
}
...
case "$1" in
start)
start;;
stop) the function for stopping/kill
;;
*) echo $"Usage :$0 (start|stop)
exit 1
;;
esac
and put it script on rc directory.
Hope it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2009 07:59 AM
тАО04-30-2009 07:59 AM
SolutionThe easiest is to create a start/stop srcipt.
/sbin/init.d/template
Above is an example of a start/stop script, cp it your desired file name and customize the file.
You can use the "su - username -c /path/to_your_command" to execute as a specific user.
Create links to this script from the /etc/rc3.d where S is start and K is stop.
rc3 scripts will start at multiuser boot.
Hope this helps,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2009 09:24 AM
тАО04-30-2009 09:24 AM
Re: Command execution at system startup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2009 10:35 AM
тАО04-30-2009 10:35 AM
Re: Command execution at system startup
I got an idea on this issue
Regards,
Din
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2009 10:35 AM
тАО04-30-2009 10:35 AM