UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 12th, 2005, 03:07 PM
Vilo Vilo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 Vilo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 26 sec
Reputation Power: 0
Automatic start of process after Boot-up

I have following problem:
My process "my_test" is automatically started during Boot-up of Computer. But then after 3-5 seconds, terminates without any traceback or error log. When I start this process with the same script, it runs without problems. It seems to me, they are not influence of other running processes.
Are any system restrictions or specific parameters which are different in Boot phase and in logged user's session ? (HP-UX)
The script looks :
cd /my_folder/exe
./my_test >../out/my_test.log 2>&1 &

Thanks
Vilo

Reply With Quote
  #2  
Old September 12th, 2005, 03:28 PM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,728 stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 22 h 41 m 16 sec
Reputation Power: 354
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
It would help to know a bit more about what your process does but, depending on when in the boot up sequence your process starts there may be services that it is counting on that have not started yet.

For example, maybe your process connects to another host to do something. That would require that networking was started and maybe your name service like DNS or NIS. Or maybe it connects to a database that isn't up yet.

Again, it would help to understand your process a little better to assist in debugging this. The key is that don't assume that all of the services that you have available to you in a normal multi-user run level are available during the early stages of booting.

Reply With Quote
  #3  
Old September 12th, 2005, 03:49 PM
Vilo Vilo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 Vilo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 26 sec
Reputation Power: 0
My process reads from shared memory ( always without problem), creates message queue and waits for messages from other local processes (ipc). It receives some messages and then terminates - not always in the same place ( checking my print ut in output file). Programm is a mixture of C (main, some subroutines) and Fortran (calculations) - rather big one.
Are parameters like "maxtsiz","maxdsiz" user independent ?

Reply With Quote
  #4  
Old September 15th, 2005, 07:40 PM
fpmurphy fpmurphy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: USA
Posts: 282 fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 2 h 30 m 42 sec
Reputation Power: 6
Yes, there are a number of differences

> cd /my_folder/exe
> ./my_test >../out/my_test.log 2>&1 &

Suggestions:

- Add shell i.e. "#!/bin/sh"
- Always use full path i.e. "/my_folder/exe/my_test"
- Move output to folder in or under current directory i.e.
"/myfolder/exe/my_test > /myfolder/exe/out/my_test.log"

For HP-UX look in /etc/rc.log for startup/shutdown scripts
error messages.

Reply With Quote
  #5  
Old September 19th, 2005, 03:24 PM
Vilo Vilo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 Vilo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 26 sec
Reputation Power: 0
The solution is to use command "nohup" - it works 100%.
[ nohup ./my_test >../out/my_test.log 2>&1 & ]
That's why, system administrator started my script under my user "abcd":
su - abcd /home/abcd/start_my_test.sh
When the script (start_my_test.sh) finished, then user "abcd" was logged out
and his child (my_test), although running in background, got a signal to interrupt. "Nohup" means "no hangup" - process continues to run also after its parents is dead. Such process takes then as parent "init" process (pid=1).

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Automatic start of process after Boot-up


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT