[clug] Launch gnome-terminal to launch daemon process

Andrew Janke a.janke at gmail.com
Tue Aug 25 02:02:06 UTC 2015


Sounds like a use case of screen to me, or dirty tricks with at:

   /usr/bin/python /opt/ark/bin/hgview | at now



a

On 25 August 2015 at 11:34, 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