From b46042254cc6b070d989dd4b473c1e788e66666c96f8e5256804de9835afbe84 Mon Sep 17 00:00:00 2001 From: Christian Wittmer Date: Fri, 18 Jun 2021 14:36:25 +0000 Subject: [PATCH] Accepting request 894078 from home:jmoellers:branches:network OBS-URL: https://build.opensuse.org/request/show/894078 OBS-URL: https://build.opensuse.org/package/show/network/ddclient?expand=0&rev=58 --- ddclient-delay-main-process-for-systemd.patch | 12 ++++++++++++ ddclient.changes | 11 +++++++++++ ddclient.spec | 4 +++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 ddclient-delay-main-process-for-systemd.patch diff --git a/ddclient-delay-main-process-for-systemd.patch b/ddclient-delay-main-process-for-systemd.patch new file mode 100644 index 0000000..498ecdc --- /dev/null +++ b/ddclient-delay-main-process-for-systemd.patch @@ -0,0 +1,12 @@ +Index: ddclient-3.9.1/ddclient +=================================================================== +--- ddclient-3.9.1.orig/ddclient ++++ ddclient-3.9.1/ddclient +@@ -847,6 +847,7 @@ if (opt('foreground') || opt('force')) { + print STDERR "${program}: can not fork ($!)\n"; + exit -1; + } elsif ($pid) { ++ sleep(1); + exit 0; + } + $SIG{'CHLD'} = 'DEFAULT'; diff --git a/ddclient.changes b/ddclient.changes index 5490ef7..52e5ae7 100644 --- a/ddclient.changes +++ b/ddclient.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue May 18 14:43:16 UTC 2021 - Josef Möllers + +- Systemd expects the PID file to exist as soon as the main process + exists. However, it takes quite a while until the pid file is + created by the daemon process, so we delay the main process + for 1 second before exit()ing. + This gets rid of an annoying warning message in "systemctl + status". + [ddclient, ddclient-delay-main-process-for-systemd.patch] + ------------------------------------------------------------------- Wed Aug 19 09:56:26 UTC 2020 - Dominique Leuenberger diff --git a/ddclient.spec b/ddclient.spec index c38d51d..90e7893 100644 --- a/ddclient.spec +++ b/ddclient.spec @@ -1,7 +1,7 @@ # # spec file for package ddclient # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,6 +28,7 @@ Source1: %{name}.service Source2: %{name}.sysconfig Source3: %{name}-tmpfiles.conf Patch0: %{name}-3.8.1-config.patch +Patch1: %{name}-delay-main-process-for-systemd.patch Requires: perl >= 5.004 Requires: perl-Data-Validate-IP Requires(pre): %fillup_prereq @@ -51,6 +52,7 @@ cron. %prep %setup -q %patch0 +%patch1 -p1 rm -f sample-etc_ddclient.conf.orig chmod a-x sample-* mkdir examples