chiark / gitweb /
service: add missing pid file unwatch in the destructor
authorMichal Schmidt <mschmidt@redhat.com>
Thu, 19 Jan 2012 22:58:07 +0000 (23:58 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Thu, 19 Jan 2012 23:51:56 +0000 (00:51 +0100)
commit3e52541ef51b1004357fbcd4bf863fb955ab83e9
tree62056f0ef2e5014efbc6607fc1ad568046bb99cc
parenta3f914b2a21decb0c4bd7a763ddd3ace215091cb
service: add missing pid file unwatch in the destructor

The pid file watch could outlive the service unit if a daemon-reload
request came at the right time. The inotify event would then be
delivered to who knows where.

Fix it by unwatching in the service destructor.

Further changes will be needed to preserve the state of the pid file
watch across daemon-reload. For now let's just fix the crash observed
by Jóhann Guðmundsson:
Assertion 's->state == SERVICE_START || s->state == SERVICE_START_POST'
failed at src/service.c:2609, function service_fd_event().  Aborting

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=783118
src/service.c