[clug] Launch gnome-terminal to launch daemon process

Hal Ashburner hal.ashburner at gmail.com
Tue Aug 25 04:01:01 UTC 2015


Looks to me like SIGHUP is sent to all grandchildren of the terminal
command specified with -e or -x but not if the command typed into the
terminal when you kill the terminal.

The more you know.

Good trick there to automagically unmount a temporariliy mounted
network filesystem. Command in a terminal -x/-e

close the terminal and it unmounts.


gnome-terminal --geometry=42x2+0+0 --sm-client-disable --title="mount
remote_home" --command "sh -c \"mount /remote_home && echo remote_home
mounted - close this to unmount && sleep 36000\""




On 25 August 2015 at 13:32, Hal Ashburner <hal.ashburner at gmail.com> wrote:
> Runs fine if you just run it from a terminal. No different in input or
> output so I'd agree that's unlikely to be a cause.
>
> This:
>
> trap "date > /tmp/signal-test" INT HUP QUIT TERM
> cmd="exec /usr/bin/python /opt/ark/bin/hgview &"
> eval $cmd
>
> also didn't make any difference which makes sense to me as the scrip
> will exit very quickly after launching the python so won't be around
> to trap the signals.
>
>
>
>
> On 25 August 2015 at 13:18, David Deaves <David.Deaves at dd.id.au> wrote:
>>
>>
>> Most likely method causing your python to exit when the shell does is it
>> receiving a SIGHUP when the terminal exits.  You should be able to handle this
>> by adding this command before the python command
>>
>> trap '' 1
>>
>> may even want to ignore SIGINT also so
>>
>> trap '' 1 2
>>
>>
>> Another possibility is some IO to the pseudo terminal now failing when it
>> goes away - this is less likely to be your issue and normally has the opposite
>> effect, calling programs don't exit/carry on until the child program exits.
>>
>> exec <&-   #  Will close STDIN
>> exec >&- 2>&-  # Will close STDOUT - though as you want to see errors from python you probably don't want this
>>
>>
>> Dave !
>>
>>
>>
>>
>>



More information about the linux mailing list