Skip to content

Child process redshift is not terminated properly if redshift-gtk receives a signal #263

@unode

Description

@unode

This looks like a bug in the way redshift-gtk communicates and passes signals to the child process (redshift). Possibly related to #253 and #218.

If a signal other than SIGUSR1 is sent to the parent process (redshift-gtk), the children process (redshift -v) may be left running while the parent exits.

Steps to reproduce:

1) During a night period start "redshift-gtk" and wait enough time to let the screen tone stabilize
2) Monitor all processes called redshift or redshift-gtk
3) Run "pkill -TERM redshift-gtk"
4) The screen remains in night tone and "redshift -v" should still be visible in the process list while redshift-gtk exited cleanly.

If the signal is sent during the tone change (gradient) phase redshift -v will exit but only due to a broken pipe error caused by producing output to a parent that is no longer there.
This can be confirmed by running the same steps above that lead to an orphan redshift -v process and then run:

5) pkill -TERM redshift

This would normally transition to the "normal" state before exiting. However in this case the process dies immediately and leaves the screen in night tone.

If redshift-gtk is modified to run the child process as redshift instead of redshift -v the broken pipe problem is no longer visible and step 5) will perform the transition to "normal" tone.
However this change is not sufficient to solve the initial problem of the orphaned redshift process.

The best solution would be for redshift-gtk to wait for the child process to finish before exiting, much like the Quit menu action does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions