You are not logged in.

#1 2010-04-18 18:07:04

AbeAkesson
Member
From: United States
Registered: 2010-04-18
Posts: 6

MPD User Not Getting Created During Install

I did a reinstall of Arch Linux (I am testing some stuff) and when I installed MPD, the useradd help message printed out along with two chown errors as well. I checked and the mpd user was not created. I took a look at Mpd's .INSTALL file and this is what it looks like:

post_install() {
  post_upgrade
  echo "==> mpd: Create a config under /etc/mpd.conf before using MPD (Example: /etc/mpd.conf.example)"
}

post_upgrade() {
  getent group "mpd" &>/dev/null || groupadd -r -g 45 mpd 1>/dev/null
  getent passwd "mpd" &>/dev/null || useradd -r -u 45 -g mpd -d "/var/lib/mpd" -s "/bin/true" -G "audio" 1>/dev/null
  for dir in /var/{lib,log}/mpd; do
    chown -R mpd:mpd "$dir" 1>/dev/null
  done
}

post_remove() {
  getent passwd "mpd" &>/dev/null && userdel mpd 1>/dev/null
  getent group "mpd" &>/dev/null && groupdel mpd 1>/dev/null
  [ -f etc/mpd.conf ] && mv etc/mpd.conf etc/mpd.conf.pacsave 1>/dev/null
}

Since the mpd group gets created fine, I believe the problem is the second line after post_upgrade(), specifically:

getent passwd "mpd" &>/dev/null || useradd -r -u 45 -g mpd -d "/var/lib/mpd" -s "/bin/true" -G "audio" 1>/dev/null

I think that the username is missing at the very end, before the output redirection. After trying it by hand, I believe that it should be:

getent passwd "mpd" &>/dev/null || useradd -r -u 45 -g mpd -d "/var/lib/mpd" -s "/bin/true" -G "audio" mpd 1>/dev/null

Before I contact the package maintainer, does this sound right to everyone else??

Offline

#2 2010-04-18 20:10:12

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427

Re: MPD User Not Getting Created During Install

At first sight it seems you are correct, you can just enter that command manually after the install or edit the install file.

Offline

#3 2010-04-18 21:19:15

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: MPD User Not Getting Created During Install

File a bug report to ensure it gets fixed.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#4 2010-04-19 11:54:42

AbeAkesson
Member
From: United States
Registered: 2010-04-18
Posts: 6

Re: MPD User Not Getting Created During Install

loafer wrote:

File a bug report to ensure it gets fixed.

Done.

Offline

Board footer

Powered by FluxBB