X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 155E6DC0FF2 for ; Wed, 23 Dec 2015 06:50:22 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 79CD8DC00E1 for ; Wed, 23 Dec 2015 06:50:20 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id l133so141092660lfd.2 for ; Tue, 22 Dec 2015 22:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=G5Rkuen/ngG9NdZYZW6Z+rf9OR4s3hL7LGCDRWLGk6I=; b=PMgB9vJ972lX2iVkaptA9Q1b2Nll8SyVCkU4yhcJPJbI2KNcUqo7OpotzPqfWe4J1c uEajOzLCYSNUtgL8diEmfClUereekI+N0PH9CLHkxgtDcDB3Vy7XatkkoUQHiByzOjNH XxMdxgSb0tYUT+JRHSz7/xsBUtEeM1BchuU9HreKaTnqDrxtEGIDtpYoP3gYuSUnvXG8 1mp+GY5aKQzIj1mr48oFigM8imImYkAwLKRm8f2OhcknWtit2RHTvBu7xuo9Sb/iChBJ K5fT+husmLNAteG/xWoC/35ByYxof1DWuVdJLY7KNHRlfHZSlKZQKZLWn8rk42+rSUKO L3Gw== X-Received: by 10.25.209.80 with SMTP id i77mr2732716lfg.33.1450853418833; Tue, 22 Dec 2015 22:50:18 -0800 (PST) Received: from vostro ([2001:1bc8:101:f402:21a:9fff:fe0c:4022]) by smtp.gmail.com with ESMTPSA id 34sm229906lfs.25.2015.12.22.22.50.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Dec 2015 22:50:18 -0800 (PST) Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= Date: Wed, 23 Dec 2015 08:50:16 +0200 From: Timo Teras To: Valery Kartel Cc: alpine-aports@lists.alpinelinux.org Subject: Re: [alpine-aports] [PATCH] main/dovecot: new init-script with dovecot.instances support Message-ID: <20151223085016.278e3a92@vostro> In-Reply-To: <1450823874-24248-1-git-send-email-valery.kartel@gmail.com> References: <1450823874-24248-1-git-send-email-valery.kartel@gmail.com> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; x86_64-alpine-linux-musl) X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 23 Dec 2015 00:37:54 +0200 Valery Kartel wrote: > --- > main/dovecot/dovecot.initd | 49 > +++++++++++----------------------------------- 1 file changed, 11 > insertions(+), 38 deletions(-) > > diff --git a/main/dovecot/dovecot.initd b/main/dovecot/dovecot.initd > index 880a39f..944ff87 100644 > --- a/main/dovecot/dovecot.initd > +++ b/main/dovecot/dovecot.initd > @@ -1,9 +1,12 @@ > #!/sbin/openrc-run > > description="Secure POP3/IMAP server" > -description_reload="Reload configuration" > - > +cfgfile=/etc/dovecot/${SVCNAME}.conf This is not equivalent to what it used to be: DOVECOT_CONF=/etc/dovecot/dovecot.${DOVECOT_INSTANCE}.conf or DOVECOT_CONF=/etc/dovecot/dovecot.conf I wonder if this is acceptable. Otherwise it looks good to me. But should probably also be flattened to the dovecot upgrade commit. Thanks. > +pidfile=$(/usr/bin/doveconf -c $cfgfile -h base_dir > 2>/dev/null)/master.pid +command=/usr/sbin/dovecot > +required_files=$cfgfile > extra_started_commands="reload" > +description_reload="Reload configuration" > > depend() { > need localmount net > @@ -12,46 +15,16 @@ depend() { > use logger > } > > -checkconfig() { > - DOVECOT_INSTANCE=${SVCNAME##*.} > - if [ -n "${DOVECOT_INSTANCE}" -a "${SVCNAME}" != "dovecot" > ]; then > - > DOVECOT_CONF=/etc/dovecot/dovecot.${DOVECOT_INSTANCE}.conf > - else > - DOVECOT_CONF=/etc/dovecot/dovecot.conf > - fi > - if [ ! -e ${DOVECOT_CONF} ]; then > - eerror "You will need an ${DOVECOT_CONF} first" > - return 1 > - fi > - if [ -x /usr/sbin/dovecot ]; then > - DOVECOT_BASEDIR=$(/usr/sbin/dovecot -c > ${DOVECOT_CONF} -a | grep '^base_dir = ' | sed 's/^base_dir = //') > - else > - eerror "dovecot not executable" > - return 1 > - fi > - DOVECOT_BASEDIR=${DOVECOT_BASEDIR:-/run/dovecot} > - DOVECOT_PIDFILE=${DOVECOT_BASEDIR}/master.pid > - checkpath --directory --owner dovecot:dovecot --mode 0755 \ > - ${DOVECOT_BASEDIR} > -} > - > -start() { > - checkconfig || return 1 > - ebegin "Starting ${SVCNAME}" > - start-stop-daemon --start --exec /usr/sbin/dovecot --pidfile > "${DOVECOT_PIDFILE}" -- -c "${DOVECOT_CONF}" > - eend $? > -} > - > -stop() { > - checkconfig || return 1 > - ebegin "Stopping ${SVCNAME}" > - start-stop-daemon --stop --exec /usr/sbin/dovecot --pidfile > "${DOVECOT_PIDFILE}" +start_pre() { > + ebegin > + [ "$cfgfile" = "/etc/dovecot/dovecot.conf" ] || > command_args="-c $cfgfile" > + checkpath --directory ${pidfile%/*} > + $command $command_args -a > /dev/null > eend $? > } > > reload() { > - checkconfig || return 1 > ebegin "Reloading ${SVCNAME} configs and restarting > auth/login processes" > - start-stop-daemon --signal HUP --exec /usr/sbin/dovecot > --pidfile "${DOVECOT_PIDFILE}" > + start_pre && start-stop-daemon --signal HUP --exec $command > --pidfile $pidfile eend $? > } --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---