sway/swaybar
Ludvig Michaelsson f627cd77d6 swaybar: signal status command's process group
Make the status command a process group leader and change the kill(2)
calls to target the new process group. Signals sent by swaybar will then
be received by both the status command and its children, if any. While
here, check the result of fork(2).

Without this, children spawned by the status command may not receive the
signals sent by swaybar. As a result, these children may be orphaned on
reload.

The issue could be shown by setting the bar to

    bar {
        status_command i3status | tee /tmp/i3status.out
    }

which would leave orphaned processes for each reload of sway

    $ ps o pid,ppid,cmd | grep i3status | grep -v grep
    43633   43624 sh -c i3status | tee /tmp/i3status.out
    43634   43633 i3status
    43635   43633 tee /tmp/i3status.out

    $ swaymsg reload

    $ ps o pid,ppid,cmd | grep i3status | grep -v grep
    43634       1 i3status
    43635       1 tee /tmp/i3status.out
    43801   43788 sh -c i3status | tee /tmp/i3status.out
    43802   43801 i3status
    43803   43801 tee /tmp/i3status.out

This fixes #5584.
2021-11-25 12:09:12 +01:00
..
tray cairo: Replace <cairo/cairo.h> by <cairo.h> 2021-05-10 10:28:32 +02:00
bar.c swaybar: signal status command's process group 2021-11-25 12:09:12 +01:00
config.c Add support for workspace_min_width bar option. 2020-10-11 19:12:42 +02:00
i3bar.c swaybar: properly draw blocks with transparent black border 2021-09-20 09:53:32 +02:00
input.c Simplify swaybar/swaynag scaling code 2021-09-12 09:05:12 +02:00
ipc.c refactor: use JSON_MAX_DEPTH everywhere 2021-10-25 10:18:40 +02:00
main.c Make command line option lists const 2021-02-04 09:49:06 +01:00
meson.build build: introduce sd-bus-provider option 2020-12-09 17:39:20 -05:00
render.c swaybar: fix cairo_font_options leak 2021-10-08 09:33:03 +02:00
status_line.c swaybar: signal status command's process group 2021-11-25 12:09:12 +01:00
swaybar-protocol.7.scd man: update maintainer 2021-01-08 09:33:51 +01:00