summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2013-08-28 19:27:44 +0200
committerLennart Poettering <lennart@poettering.net>2013-09-10 16:58:04 +0200
commit9285c9ff263d90439810735ddca074b4b4193f05 (patch)
treee6de930b637dd9d09b1c841030461ebc349ee6e5 /src/core
parent5ca8c5d9775e1d81f087fba71fc3d4690e103bbf (diff)
service: remove pidfile after exit of a service
Diffstat (limited to 'src/core')
-rw-r--r--src/core/service.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 4070fd741b..34dde7963e 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1957,6 +1957,12 @@ static void service_enter_dead(Service *s, ServiceResult f, bool allow_restart)
/* we want fresh tmpdirs in case service is started again immediately */
exec_context_tmp_dirs_done(&s->exec_context);
+ /* Try to delete the pid file. At this point it will be
+ * out-of-date, and some software might be confused by it, so
+ * let's remove it. */
+ if (s->pid_file)
+ unlink_noerrno(s->pid_file);
+
return;
fail: