[systemd-commits] TODO src/core
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Sep 10 07:58:23 PDT 2013
TODO | 2 --
src/core/service.c | 6 ++++++
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 9285c9ff263d90439810735ddca074b4b4193f05
Author: Lukas Nykryn <lnykryn at redhat.com>
Date: Wed Aug 28 19:27:44 2013 +0200
service: remove pidfile after exit of a service
diff --git a/TODO b/TODO
index b83fd67..59e0f97 100644
--- a/TODO
+++ b/TODO
@@ -60,8 +60,6 @@ Features:
* better error message if you run systemctl without systemd running
-* unlink PID files of units after exit
-
* tiny tool that saves/restores backlight
* systemctl status output should should include list of triggering units and their status
diff --git a/src/core/service.c b/src/core/service.c
index 4070fd7..34dde79 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:
More information about the systemd-commits
mailing list