From 406eaf930be77133c1f58ba37171e6d5aa9489c7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 15 Jun 2010 19:47:13 +0200 Subject: service: never supervise ourselves --- src/service.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/service.c b/src/service.c index 82a18a4311..547a55567a 100644 --- a/src/service.c +++ b/src/service.c @@ -936,6 +936,9 @@ static int service_load_pid_file(Service *s) { if ((unsigned long) (pid_t) p != p) return -ERANGE; + if (p <= 1) + return -ERANGE; + if (kill((pid_t) p, 0) < 0 && errno != EPERM) { log_warning("PID %llu read from file %s does not exist. Your service or init script might be broken.", (unsigned long long) p, s->pid_file); -- cgit v1.2.3-54-g00ecf