Skip to main content
added 31 characters in body
Source Link
user313992
user313992

I expected vimiv to start as a background job in the current terminal and then receive a sighup when the terminal is closed and also exits.

No, that's not what happens. vimiv would only get a SIGHUP signal (from the kernel) if it was a foreground job, or if it was a stopped background job. But it's neither: it's a running background job.

Or if bash (bash in particular, not any shell in general) had itself received a SIGHUP signal and has resent it to all its non-disowned jobs. But in your example the shells exits normally via exit, not because it was signaled by SIGHUP [1].

For example, if I execute vimiv & followed by another exit command, vimiv will close

That may be something special to that vimiv & program -- if I enter xclock & and then exit on a separate line in a terminal, xclock will not terminate. It will however terminate if I close the terminal from the X button, because in that case bash will receive a SIGHUP signal and will resend it to xclock.

[1] bash can also send a SIGHUP when exiting normally, but only with shopt -s huponexit, which is not the default.

I expected vimiv to start as a background job in the current terminal and then receive a sighup when the terminal is closed and also exits.

No, that's not what happens. vimiv would only get a SIGHUP signal (from the kernel) if it was a foreground job, or if it was a stopped background job. But it's neither: it's a running background job.

Or if bash (bash in particular, not any shell in general) had itself received a SIGHUP signal and has resent it to all its non-disowned jobs. But in your example the shells exits normally via exit, not because it was signaled by SIGHUP [1].

For example, if I execute vimiv & followed by another exit command, vimiv will close

That may be something special to that vimiv & program -- if I enter xclock & and then exit on a separate line in a terminal, xclock will not terminate. It will however terminate if I close the terminal from the X button, because in that case bash will receive a SIGHUP signal.

[1] bash can also send a SIGHUP when exiting normally, but only with shopt -s huponexit, which is not the default.

I expected vimiv to start as a background job in the current terminal and then receive a sighup when the terminal is closed and also exits.

No, that's not what happens. vimiv would only get a SIGHUP signal (from the kernel) if it was a foreground job, or if it was a stopped background job. But it's neither: it's a running background job.

Or if bash (bash in particular, not any shell in general) had itself received a SIGHUP signal and has resent it to all its non-disowned jobs. But in your example the shells exits normally via exit, not because it was signaled by SIGHUP [1].

For example, if I execute vimiv & followed by another exit command, vimiv will close

That may be something special to that vimiv & program -- if I enter xclock & and then exit on a separate line in a terminal, xclock will not terminate. It will however terminate if I close the terminal from the X button, because in that case bash will receive a SIGHUP signal and will resend it to xclock.

[1] bash can also send a SIGHUP when exiting normally, but only with shopt -s huponexit, which is not the default.

Source Link
user313992
user313992

I expected vimiv to start as a background job in the current terminal and then receive a sighup when the terminal is closed and also exits.

No, that's not what happens. vimiv would only get a SIGHUP signal (from the kernel) if it was a foreground job, or if it was a stopped background job. But it's neither: it's a running background job.

Or if bash (bash in particular, not any shell in general) had itself received a SIGHUP signal and has resent it to all its non-disowned jobs. But in your example the shells exits normally via exit, not because it was signaled by SIGHUP [1].

For example, if I execute vimiv & followed by another exit command, vimiv will close

That may be something special to that vimiv & program -- if I enter xclock & and then exit on a separate line in a terminal, xclock will not terminate. It will however terminate if I close the terminal from the X button, because in that case bash will receive a SIGHUP signal.

[1] bash can also send a SIGHUP when exiting normally, but only with shopt -s huponexit, which is not the default.