[clug] Launch gnome-terminal to launch daemon process
Hal Ashburner
hal.ashburner at gmail.com
Tue Aug 25 01:34:29 UTC 2015
Here's the setup.
I've got some python scripts that runs some gui stuff.
I want to write a bash script that a user can double click on, have it
launch a terminal that that then launches the python scripts with some
useful text about each launch in case something goes wrong.
I want the python scripts to keep executing when that initial launched
terminal is closed.
I can't seem to do anything to get what I'm running to outlive the terminal.
I'm /think/ I'm double forking inside the terminal, I'm also trying to
put the process in the background and disowning everything. I try
disowning the python as well.
I've tried every combination of these I can think of and I just can't
get the python to outlive the terminal.
Relevant launching script
cmd=$HOME/bin/some_command
# if st't to avoid a fork bomb if we mess it up
if [[ $cmd != ${BASH_SOURCE[0]} ]]; then
gnome-terminal --geometry=80x8+0+0 --sm-client-disable
--title="$cmd" --command "bash -c \"echo running $cmd; bash $cmd \&;
disown -a; echo done; sleep 36000\""
fi
a simple version of some_command looks like:
#!/bin/bash
/usr/bin/python /opt/ark/bin/hgview &
disown -a
Any ideas?
More information about the linux
mailing list