Skip to content

cgroupify: Fix lifetime of inotify event source

Benjamin Berg requested to merge benzea/fix-inotify-event-destrunction into master

systemd has the concept of floating event sources which will only be destroyed with the mainloop. Also, disabling an inotify event source seems to just prevent it from being fired but will not unregister it from the kernel. This appears to possibly cause a loop where the kernel keeps notifying about changes and nothing happening in the application.

Fix this by taking a non-floating reference to the source, and using sd_event_source_disable_unref in order to properly destroy the event and unregister it from the kernel.

Merge request reports