nohup ./program-name &
The & at the end runs the program in the background, so that it
doesn't block your terminal. The "nohup" bit makes the program "safe"
when your terminal hangs-up - i.e it carries on running - by default
the output of the program gets put into a file "nohup.out".
If a program should do this by itself, you might need to daemonize it,
although I've not looked into how this might be done in Go.
- Huin
nohup ./program-name &
You could use
nice 19 ./program-name &
The nice change the priority of the program, so running "nice 19 <you
command here>" will put your process with a very low priority.
This is good because if your program starts an infinite loop, it will
no hang the entire system.
--
André Moraes
http://andredevchannel.blogspot.com/
You'll have to learn a few commands, like ps or kill or chmod.
You may be interested by this script I use on my server to kill, clean
and launch my program (whose name is gogo) :
rm -f _go_.6
rm -f _go_.8
killall -q gogo
gomake
mv gogo.out gogo.out-old
mv gogo.err gogo.err-old
nohup ./gogo > gogo.out 2> gogo.err < /dev/null &
(I put all this in a .sh file)
When I want to see the output of my program (a web server) I simply
type this :
tail -f gogo.out
nice 19 ./goproxy &
Now I want to stop it
ps aux | grep goproxy
This will print all the commands that have the "goproxy" string in the name.
The first column that have a number on it represents the process ID
(PID) of the process.
To kill (stop the process) you just type
kill <put here the PID>
And remove the <> from the comand.
Also, you can search more information about those commands by typing
man kill
man grep
man ps
You can use the "top" command too. This command shows a list of all
running process with lots of information.
It's a little confuse at first, but later you get used to it.
Again, you can use
man top
To get more infor on the command.
Hope it helps
The following links are a good source of information about linux for beginners
http://www.linuxquestions.org/questions/linux-newbie-8/
http://kernelnewbies.org/IRC
echo "mutt -s \"today's report\" $userlist < /tmp/todays_report" | at 0800