LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-12-2007, 06:15 PM   #1
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Unhappy a process being killed for un-known reasons


Hi,
the gist here is i have my own bash script loop that is constantly running in the background and it does a few things for me thats not important, the weird thing is recently as in just started today, the process seems to kill itself or at least disappear and not work anymore if i "killall startkde" now this should only kill kde but something seems to be happening to my other process now, called something completely different. It never used to be killed as well when i killed kde so i can't understand why now its started to happen. Does anybody have any ideas as to why its started to be killed.

i have to admit i've changed the script slightly and the permissions but the permissions are just locking down the script even more and the file shouldn't be able to exit the loop as i run it with a "while true; do" so its always supposed to run. There are no exit commands so it should be fine, whats the problem???
Thanks in advanced
Mark
 
Old 02-12-2007, 06:26 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Are you starting the script from within your KDE session? If so your going to have to nohup it... as when KDE dies it is going to trigger a hangup to any process started within it.
 
Old 02-12-2007, 06:38 PM   #3
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
hi and thanks for your reply, no its starts from /etc/rc.local
it should be working fine its just weird that it used to work fine and now it doesn't, i've also got a very similar scrip on another server that does something slightly different but same idea applied and that one still works fine when i kill kde. That why i'm so confused hehe
 
Old 02-12-2007, 07:18 PM   #4
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
Question

ahh well actually thanks for your reply i've realised my error now, I initially was starting it from /etc/rc.local,but I recently added in a new feature which would allow the process to be killed and then it was started remotely via ssh command. This has been the reason the process was killed I expect, but if a kde session wasn’t running and I ran the normal ssh command would it then still be considered for hangup?? Plus it seems to work great if I use “nohup /target &”. That’s fine I can edit my current program scripts no problem to fix the current problems but is there an option that will make nohup run without needing to write the ongoing outputs of my process to /$home/nohup.out

due to the huge length of time the server is running for in other words as long as its got no errors its running and never turned off, there would be a huge amount of text to build up in that file and over such a huge period it would create a large file and you could say it would either need a limit to the amount that can be written to it, or to not have it writing the output to the file at all is what I’d prefer if possible?
 
Old 02-12-2007, 07:24 PM   #5
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
nohup CMD &>/dev/null &


Change CMD to your script and away you go.
 
Old 02-12-2007, 07:34 PM   #6
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
Thumbs up

Quote:
nohup CMD &>/dev/null &
is it really supposed to have the & on the end there, i can understand why you've got it "nohup CMD &" in that part but why here as well or was that just a mistake?? ">/dev/null &"

i see btw yes good idea just send output to null hehe doh! i should have seen that.

Thanks for your help its been most useful
 
Old 02-12-2007, 07:37 PM   #7
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
The last & sends it to the background to execute.....
 
Old 02-12-2007, 07:41 PM   #8
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
ahh actually yeah sorry got twisted, it should be then
nohup CMD > /dev/null &

sorry yeah i'll get there eventually
 
Old 02-13-2007, 01:33 PM   #9
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
Question

Actually now i have a different problem, if i "ssh user@serverIP nohup command > /dev/null". then when i shutdown the system that i ran the command on so it would remotely execute the process i'd started was killed as well, can i stop this.

eg:
s = server
s1 ssh command sent to s2
ssh root@s2 nohup thingy
then i shutdown s1 and the process i'd started to execute on s2 killed itself i guess its got something to do with the shutdown of s1 but i used the nohup command so why is it being killed and i need to stop it.

Thanks anybody
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why a process is Killed by OS ?? How To know the reason? shmulito Linux - Kernel 2 01-02-2007 01:06 AM
Out of Memory: Killed process maenho Linux - Software 3 10-16-2005 05:06 AM
how to prevent process from being killed? iclinux Linux - Newbie 7 01-14-2005 10:43 PM
Killed Process Problem chr Slackware 2 05-06-2003 01:33 AM
process is getting killed automatically chens_83 Linux - General 2 09-16-2002 03:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration