You are not logged in.
Pages: 1
Hi everyone,
I was trying to launch sonata with autostart.sh in openbox, when I realized that every python application (and sonata among them) "dies" when the shell is closed (autostart.sh is a bash script), even if '&' is used to run the command in background.
So, is there a workaround to have python application backgrounded when launched from terminals or bash scripts?
Thanks!
Offline
try subshelling it, the entry for sonata in my autostart.sh is
( sleep 2 && sonata --hidden) &
Offline
Ok, now it's solved, sonata could be run simply with "sonata &", the problem I had was caused by an error I had done previously.
But still remains a doubt. Why running in a terminal emulator "(sonata &)" makes sonata backgrounded (can close the terminal), while typing "sonata &" (without brackets) simply don't?.
I didn't know of any magical power of round brackets.
Last edited by AsA (2008-11-10 20:28:21)
Offline
Most X apps should fork off the shell, like gvim for firefox.
When the shell is closed it terminates all jobs by sending SIGHUP. You can use nohup <programname> to launch a program you want to live after closing the shell.
Offline
Ok, now it's solved, sonata could be run simply with "sonata &", the problem I had was caused by an error I had done previously.
But still remains a doubt. Why running in a terminal emulator "(sonata &)" makes sonata backgrounded (can close the terminal), while typing "sonata &" (without brackets) simply don't?.
I didn't know of any magical power of round brackets.
hmm... does sonata& and sonata & react differently?
I haven't lost my mind; I have a tape back-up somewhere.
Twitter
Offline
man nohup
and (in bash)
help disown
The difference between these escapes me right now. Except it's clear they're called differently: you "nohup COMMAND &" to start the command as backgrounded and not-to-be-killed when the shell closes. You "disown -h %1" to say that (already backgrounded or interrupted) job %1 should not be killed when the shell closes. I'm not sure if there's any difference in functionality beyond these calling differences. Anyone able to clarify?
Offline
Pages: 1