[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: I'm not a huge fan of systemd

Steve Litt wrote:
> Cool! I just got the same results on my system, *unless* I closed the
> terminal with the window manager's close window command (Alt+F4 on

I think there might be some confusion between SIGHUP and SIGTERM.  The
nohup command will ignore SIGHUP but not SIGTERM.  I think (not sure)
that if you close your window with Alt-F4 that it will send SIGTERM to
the foreground process group.  I don't have time to test it.

> If you close the terminal with the exit command, iceweasel stays
> resident.

I think that exiting the shell won't send any signal to background
processes.  Or if it does then it would be SIGHUP.

> I'm pretty sure this isn't the way things worked 11 years ago, when I
> made my double-fork to launch a GUI program and then terminate what
> launched it.

The last time this really changed was when the shell got job control.
When using a job control shell the semantics of sending signals to the
foreground process group changed because background jobs are run in
their own process group.  Because of this background jobs don't get
SIGHUP as they did without job control.

> I discovered this also: If I have the following junk.sh, it runs
> iceweasel with parent process 1:
> #!/bin/bash
> iceweasel &

The parent process is 1 because PID 1 inherits all processes when
their parent exits.  In the above the parent is bash.  Bash forks and
execs iceweasel.  Then bash exits.  When bash exits the init pid 1
inherits the iceweasel process.


Attachment: signature.asc
Description: Digital signature

Reply to: