- 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
Forums
Discussions
Discussions
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
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-25-2003 12:52 AM
04-25-2003 12:52 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
if I try to run it in a shell, it work.
but ...
if I reboot the server, start and ( I can see it with a ps -ef starting up) and stop without an error or log.
Can you check the script and give some comments.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2003 01:00 AM
04-25-2003 01:00 AM
Re: script problem
I believe you wish to run these with su command. avoid the '-' sign after the su call.
call it in this manner -
su sc ...
instead of
su - sc ...
'-' runs a shell with the environment settings of the particular user. the script will never return until that shell is exited.
A similar question last night... the same problem...
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x127d38dfa974d711abdc0090277a778c,00.html
HTH.
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2003 01:11 AM
04-25-2003 01:11 AM
Re: script problem
I'm sorry but I think that it should work. with 'su - sc' you will set the environment, execute the command and logout. I Think that your problem is perhaps related to some differences in env variables settings (see man su), or some variables not set (like DISPLAY) because when you run it at boot time your process is not attached to any terminal (you can easily find some tests in most .profile files). Try finally to redirect nohup output rather than rc script output (use "nohup $SC_BINPATH/xscmanmx > /tmp/whatishappening 2>&1).
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2003 01:47 AM
04-25-2003 01:47 AM
SolutionGood comment to user the redirect of stout to stderr. This makes your output more complete.
I also have an issue with the folowing line :
/usr/bin/su - sc -c "nohup $SC_BINPATH/xscmanmx" & > /dev/null 2>&1
This should be :
/usr/bin/su - sc -c "nohup $SC_BINPATH/xscmanmx >/dev/null 2>&1" &
Whenever su - generates an error, you want to see it !! Whenever your program xscmanx generates one, I assume you don't want to see it.
I would recommend you keep the su -, as in this case your user profile gets loaded which might important path-variables and $home settings.
Good luck.
Regs David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2003 02:23 AM
04-25-2003 02:23 AM
Re: script problem
looks better now.
What do you think, do I still need the trap command?
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2003 02:25 AM
04-25-2003 02:25 AM
Re: script problem
- ramd.