[clug] Launch gnome-terminal to launch daemon process

Sam Couter sam at couter.id.au
Tue Aug 25 21:28:40 UTC 2015

If you want the Python GUI program to live on after the terminal, why not
have it start the terminal instead of the other way around?
On 25/08/2015 11:37 am, "Hal Ashburner" <hal.ashburner at gmail.com> wrote:

> 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?
> --
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux

More information about the linux mailing list