X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 70700DD2462 for ; Sat, 14 Mar 2015 17:41:53 +0000 (UTC) Received: by igbue6 with SMTP id ue6so11008514igb.1 for ; Sat, 14 Mar 2015 10:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=pSaYKCzxT27nM+aijy4pzdpXgdOvCpi9oKlOUIcYN0A=; b=o17Bhu0IRNmS0AFan8ZhzXDmx3k83BLhRl3T4csOUgmJ+IXaSzi4egoJQmxC43arXT UZq0hCsjPnnv3xG/B5oEJ1RnEMpsgmWG3f4R0Y7KbZNgXFMgCYQGeoZzhwRny7kbudwG IBIVmbp9EHlezLXKk1VafRYrXAcHTsuew4sptxrBRPvT/eGxLxJLQefoeK+18meTxsIO /HE7UXhw4CftyQf1oITdMt1HXW8YJhgcqxmFUUDWV83JL5akfmSPXbcn+KyURRsZWbG9 nRWnyj+xjABMjczrcjh67rrGBTdKsxPCE0v1Glsupgnxm119PjucyRe4WkXKPPsKq2UO qD5g== X-Received: by 10.50.87.42 with SMTP id u10mr88155891igz.31.1426354912717; Sat, 14 Mar 2015 10:41:52 -0700 (PDT) Received: from localhost.localdomain (97-90-234-80.dhcp.eucl.wi.charter.com. [97.90.234.80]) by mx.google.com with ESMTPSA id 130sm3572042ioz.10.2015.03.14.10.41.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 14 Mar 2015 10:41:51 -0700 (PDT) From: Peter Bui To: alpine-devel@lists.alpinelinux.org Cc: Peter Bui Subject: [alpine-devel] [PATCH] main/mpd: fix pidfile, change to system user Date: Sat, 14 Mar 2015 12:41:38 -0500 Message-Id: <1426354898-15858-1-git-send-email-pnutzh4x0r@gmail.com> X-Mailer: git-send-email 2.3.2 X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: 1. Fix handling of pidfile (parsing and creation of directory on start) 2. Make mpd a system user (similar to minidlna) --- main/mpd/mpd.initd | 7 ++++--- main/mpd/mpd.pre-install | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main/mpd/mpd.initd b/main/mpd/mpd.initd index f18708b..a026d72 100644 --- a/main/mpd/mpd.initd +++ b/main/mpd/mpd.initd @@ -19,16 +19,18 @@ checkconfig() { } get_pidfile() { - pidfile=$(awk '$1 == "pid_file" { print $2 }' "$CONF") + pidfile=$(awk '$1 == "pid_file" { print $2 }' "$CONF" | sed 's/"//') pidfile=${pidfile:-/var/run/mpd/$NAME.pid} } start() { checkconfig || return 1 get_pidfile + checkpath --owner ${M_USER:-mpd}:${M_GROUP:-audio} \ + --directory ${pidfile%/*} + ebegin "Starting ${NAME}" start-stop-daemon --start --quiet \ - --pidfile $pidfile\ --exec ${DAEMON} -- ${MPD_OPTS} eend $? } @@ -39,4 +41,3 @@ stop() { mpd --kill eend $? } - diff --git a/main/mpd/mpd.pre-install b/main/mpd/mpd.pre-install index cb1b8d3..70bddb2 100644 --- a/main/mpd/mpd.pre-install +++ b/main/mpd/mpd.pre-install @@ -1,4 +1,3 @@ #!/bin/sh -adduser -h /var/lib/mpd -s /sbin/nologin -G audio -D mpd 2>/dev/null || true - +adduser -S -h /var/lib/mpd -s /sbin/nologin -G audio -D mpd 2>/dev/null || true -- 2.3.2 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---