s->main_pid = 0;
}
+static void service_unwatch_pid_file(Service *s) {
+ if (!s->pid_file_pathspec)
+ return;
+
+ log_debug("Stopping watch for %s's PID file %s", UNIT(s)->id, s->pid_file_pathspec->path);
+ path_spec_unwatch(s->pid_file_pathspec, UNIT(s));
+ path_spec_done(s->pid_file_pathspec);
+ free(s->pid_file_pathspec);
+ s->pid_file_pathspec = NULL;
+}
+
static int service_set_main_pid(Service *s, pid_t pid) {
pid_t ppid;
* our resources */
service_unwatch_main_pid(s);
service_unwatch_control_pid(s);
+ service_unwatch_pid_file(s);
if (s->bus_name) {
unit_unwatch_bus_name(u, s->bus_name);
return;
}
-static void service_unwatch_pid_file(Service *s) {
- if (!s->pid_file_pathspec)
- return;
-
- log_debug("Stopping watch for %s's PID file %s", UNIT(s)->id, s->pid_file_pathspec->path);
- path_spec_unwatch(s->pid_file_pathspec, UNIT(s));
- path_spec_done(s->pid_file_pathspec);
- free(s->pid_file_pathspec);
- s->pid_file_pathspec = NULL;
-}
-
static void service_set_state(Service *s, ServiceState state) {
ServiceState old_state;
assert(s);