From b094c1bff5da846044d646fd8c63954521793cad Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 26 May 2020 20:29:13 -0400 Subject: [PATCH] Only write the PID file if daemonized There's not much point in writing a PID file if the user does not want to fork. (The process executing ddclient already knows the PID, so it can save it to a file if desired.) This change is a prerequisite to using Proc::Daemon to fix the buggy daemonization logic. --- ddclient | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ddclient b/ddclient index 39291ac..df8e582 100755 --- a/ddclient +++ b/ddclient @@ -742,7 +742,7 @@ my @opt = ( [ "protocol", "=s", "-protocol type : update protocol used" ], [ "file", "=s", "-file path : load configuration information from 'path'" ], [ "cache", "=s", "-cache path : record address used in 'path'" ], - [ "pid", "=s", "-pid path : record process id in 'path'" ], + [ "pid", "=s", "-pid path : record process id in 'path' if daemonized" ], "", [ "use", "=s", "-use which : how the should IP address be obtained." ], &ip_strategies_usage(), @@ -839,10 +839,6 @@ if (opt('foreground')) { open(STDOUT, ">/dev/null"); open(STDERR, ">/dev/null"); open(STDIN, "