Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#19133 - [mpd] mpd install script is fail and hides all errors

Attached to Project: Arch Linux
Opened by Dan McGee (toofishes) - Saturday, 17 April 2010, 14:40 GMT
Last edited by Andrea Scarpino (BaSh) - Sunday, 18 April 2010, 01:10 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Andrea Scarpino (BaSh)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Did you test this package before releasing it?

(2/3) upgrading mpd [---------------------------------------------------] 100%
error: command failed to execute correctly

Wow, that is helpful. I'd start by removing the useless redirect to /dev/null and trying the post_upgrade by hand:

$ sudo chown mpd:mpd -R /var/{lib,log,run}/mpd
chown: cannot access `/var/run/mpd': No such file or directory

Ahh, actually a useful error now. It looks like the directory you added to fix some bug (commit 77691) was only a half-solution. You should fix the install script to either create the directory before trying to chown it, let it fail gracefully if it doesn't exist, or not do the chown at all. Either way your permissions are going to be jacked as the creation of it in the init.d script leaves it owned by root. Not sure if you meant to do that.
This task depends upon

Closed by  Andrea Scarpino (BaSh)
Sunday, 18 April 2010, 01:10 GMT
Reason for closing:  Fixed
Additional comments about closing:  0.15.9-4
Comment by orbisvicis (orbisvicis) - Saturday, 17 April 2010, 18:57 GMT
I disagree. If the dev hadn't forgotten the "/var/run/mpd" directory in the pkgbuild, everything would have meshed together smoothly. The pkgbuild should be fixed, not the install script having to catch every posible error.

About the other issues:
1] Let the installer see stderr but not stdout
. ex, change 'userdel mpd &>/dev/null' to 'userdel mpd 1>/dev/null'
2] simplify stdout/stderr redirect in getent
. ex, change 'getent passwd mpd >/dev/null 2>&1' to 'getent passwd mpd &>/dev/null'
3] Doesn't hurt to check with getent before adding groups/users. Also doesn't hurt to check/enforce {SYS_UID_MIN,SYS_UID_MAX} (add "-r")
. 'getent passwd "mpd" &>/dev/null || useradd -r -u 45 -g mpd -d /var/lib/mpd -s /bin/true mpd 1>/dev/null'
. 'getent group mpd &>/dev/null || groupadd -r -g 45 mpd 1>/dev/null'
. 'groups mpd | grep "\baudio\b" &>/dev/null || gpasswd -a mpd audio 1>/dev/null'
4] See #18780, but post_remove should follow pacman conventions
. '[ -f etc/mpd.conf ] && mv etc/mpd.conf etc/mpd.conf.pacsave 1>/dev/null'

5] Avoid "jacking" permissions, lol, and let user know of errors
. 'for dir in /var/{lib,log,run}/mpd; do chown -R mpd:mpd "$dir" 1>/dev/null; done'

You might also want to check that the mpd group/user exists during the post_upgrade too, perhaps by moving all the (new) getent stuff to post_upgrade(), and calling post_upgrade in post_install()
Comment by orbisvicis (orbisvicis) - Saturday, 17 April 2010, 19:32 GMT
!Not Tested!

Loading...