X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mail.metadata.be (mail.metadata.be [185.77.197.116]) by lists.alpinelinux.org (Postfix) with ESMTP id BA6EAF815F5 for ; Sat, 4 May 2019 17:36:32 +0000 (UTC) Received: from mail.local.metadata.be (mail.local.metadata.be [10.0.0.20]) by mail.metadata.be (Postfix) with ESMTPS id A0F5F1FAA6 for ; Sat, 4 May 2019 19:36:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=metadata.be; s=default; t=1556991390; bh=agTJbQnzEBMcvHh7l3uaDQFpcB3+TdU1YSu1aBqKRWA=; h=From:To:Cc:Subject:Date:From; b=AkYHqet2T9CtTg5AvxUR9GwSx2JPNEmJrru/zT8iDM9NwUyKCE3YY1JDFkIV6Lh3J Op4CNrwUJBj4hOCWqhHPv2tBSSJ4ziFWcuPa/EFIUtSPHLb38T0XPxPBwEoieUs5RB HCjJnlB8c9XT6dNPB4kHPP+5FpTjbvNJdpZ31n5U= From: Rolf To: alpine-aports@lists.alpinelinux.org Cc: Rolf Subject: [alpine-aports] [PATCH] main/dovecot: fix bug #10320: requires entropy before crng init Date: Sat, 4 May 2019 19:36:25 +0200 Message-Id: <20190504173625.5601-1-rolf@metadata.be> X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Change the dovecot initscript to fix #10320. Also adds "after entropy" and checks the config before (re)start, making it a bit more robust. --- main/dovecot/dovecot.initd | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/main/dovecot/dovecot.initd b/main/dovecot/dovecot.initd index 721f131ad0..25f301f173 100644 --- a/main/dovecot/dovecot.initd +++ b/main/dovecot/dovecot.initd @@ -5,7 +5,6 @@ description="Secure POP3/IMAP server" cfgfile=/etc/dovecot/dovecot${instance:+.$instance}.conf -pidfile=$(doveconf -c $cfgfile -h base_dir 2>/dev/null)/master.pid command=/usr/sbin/dovecot command_args=${instance:+-c $cfgfile} required_files="$cfgfile" @@ -16,24 +15,39 @@ description_reopen="Reopen log files" depend() { need localmount net before mta - after bootmisc firewall ldap mysql ntp-client ntpd postgresql saslauthd slapd + after bootmisc entropy firewall ldap mysql ntp-client ntpd postgresql saslauthd slapd use logger } -start_pre() { - ebegin +checkconfig() { + ebegin "Checking $RC_SVCNAME configuration" + pidfile=$(doveconf -c $cfgfile -h base_dir 2>/dev/null)/master.pid doveconf -c $cfgfile -x >/dev/null 2>&1 && \ checkpath --directory ${pidfile%/*} eend $? } +start_pre() { + if [ "${RC_CMD}" != "restart" ]; then + checkconfig || return $? + fi +} + +stop_pre() { + if [ "${RC_CMD}" = "restart" ]; then + checkconfig || return $? + fi +} + reload() { + checkconfig || return $? ebegin "Reloading $RC_SVCNAME configs and restarting auth/login processes" - start_pre && start-stop-daemon --signal HUP --pidfile $pidfile + start-stop-daemon --signal HUP --pidfile $pidfile eend $? } reopen() { + checkconfig || return $? ebegin "Reopening $RC_SVCNAME log files" start-stop-daemon --signal USR1 --pidfile $pidfile eend $? -- 2.21.0 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---