View Single Post
  #4  
Old April 19th, 2004, 08:27 AM

guybrush threepwood guybrush threepwood is offline
Corporal
 
Join Date: Mar 2004
Location: Copenhagen, Denmark
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
guybrush threepwood is on a distinguished road
Default Re: Redirect output of Linux Dominions server to logfile?

Just wanted to point out that

code:
 command --flags 2>&1|tee logfile  

Will put everything in the logfile, but still put it in your terminal also. I often find this quite handy.

If you want it to go in the background, then you could of course do what you already proposed, but you could also prepend the above command with "screen". You can then exit from the command running in screen by ctrl-A D, and resume by "screen -r" (or "screen -r 5432" to select process 5432 if there is more than one). "screen" is one of the most useful and overlooked programs in linux.

On the topic of killing processes in the background.
code:
killall -9 dom2

should work (or possibly replace dom2 with the name of your script).

You can also do
code:
ps -e|grep dom2

to view the process id's of running scripts. Then you can subsequently kill them with
code:
kill -9 PROCESSID

The "-9" kills the process outright, no questions asked. To be a bit more gentle you could use the commands without "-9" first and see if thats enough.

Cheers,
Thomas
Reply With Quote