Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | MPD: Update installer #2381

Merged
merged 14 commits into from
Jan 4, 2019
Merged

DietPi-Software | MPD: Update installer #2381

merged 14 commits into from
Jan 4, 2019

Conversation

MichaIng
Copy link
Owner

@MichaIng MichaIng commented Dec 30, 2018

Status: Ready

  • [ ] Install and use (?) mpd.socket €: Handle as separate request
  • Update deb packages with current version, enabled NFS+SMB plugins and hardcoded default config path?
  • Changelog

Testing:

  • Jessie
  • Stretch
  • Buster
  • YMPD connect

Reference: https://github.com/Fourdee/DietPi/issues/2378

Commit list/description:

  • DietPi-Software | MPD: Use "mpd" user again
  • DietPi-Software | MPD/YMPD/myMPD: useradd "((m)y)mpd" if non-existent, otherwise usermod according to our needs
  • DietPi-Software | MPD: Update systemd unit to match current upstream/Debian package, which also addresses non-root permissions/capabilities; Remove unsupported settings on Jessie
  • DietPi-Software | MPD: Preserve existing log and cache files; Move from /var/lib/mpd, if those are not yet symlinks
  • DietPi-Software | MPD: "apt-mark unhold" not required for "dpkg -i", which will even remove the "hold" tag
  • DietPi-Software | YMPD: Install Stretch binary on Buster, until we have build a Buster binary
  • DietPi-Software | YMPD: Install required libssl1.1 from Stretch repo on Jessie
  • DietPi-Software | YMPD/Shairport-Sync: On Jessie+ARMv6, install armhf libssl1.1 binary, TESTING required!
  • DietPi-Software | YMPD/myMPD: Within systemd units on Buster, comments in same line after User= is not allowed
  • DietPi-Software | Remove User=root entries from all systemd units, which is default anyway
  • DietPi-Software | MPD: On Stretch (custom build), symlink /etc/mpd.conf to /usr/local/etc/mpd.conf, where /usr/local/bin/mpd by default searches

+ DietPi-Software | MPD: "apt-mark unhold" not required for "dpkg -i", which will even remove the "hold" tag
+ DietPi-Software | MPD: Re-use "mpd" user, create or modify it according to our needs
+ DietPi-Software | MPD: Preserve existing log and cache files; Move from /var/lib/mpd, if those are not yet symlinks, 
+ DietPi-Software | MPD: Update systemd unit to match current upstream/Debian package; Remove unsupported settings on Jessie
@MichaIng MichaIng added this to the v6.20 milestone Dec 30, 2018
@MichaIng MichaIng self-assigned this Dec 30, 2018
- DietPi-Software | MPD: Update "mpd.conf" to use "mpd" user
+ DietPi-Set_Software | MPD: Update permissions to use "mpd" user
@MichaIng
Copy link
Owner Author

@Fourdee
Default Debian + upstream setup is to listen to unix socket instead of TCP port. Makes sense, if we by default anyway bind to localhost. Quite easy to enable, mpd.socket can be controlled via systemd: https://github.com/MusicPlayerDaemon/MPD/blob/master/systemd/system/mpd.socket
Only thing I am not sure about, is if our MPD frontends require adjustment then as well.

Using "mpd" user should work just fine. Not sure why we still use/reverted to root?

Two other issues that might be related to compile options:

@Fourdee
Copy link
Collaborator

Fourdee commented Dec 31, 2018

@MichaIng

Strange, cant see any compile options to change default config path.

Also https://www.systutorials.com/docs/linux/man/5-mpd.conf/

mpd.conf is the configuration file for mpd(1). If not specified on the command line, MPD first searches for it at $XDG_CONFIG_HOME/mpd/mpd.conf then at ~/.mpdconf then at ~/.mpd/mpd.conf and then in /etc/mpd.conf.

@MichaIng
Copy link
Owner Author

MichaIng commented Dec 31, 2018

@Fourdee
Strange that it doesn't find it then in /etc/mpd.conf 🤔. Can't be a permissions issue since it must read the file as root before forking as configured run user. Or does it reread the config file then?
However it already failed with configured root user. Very strange then... Last test could be to apply owner:group for /etc/mpd.conf exactly as configured. Although it does not make sense if this is required.

I mean at least it is no deal breaker. One can always give the config via command argument and one needs to run the mpd command manually very rarely with active service?


About TCP port vs unix socket we need to be very careful with existing installs, as all MPD "clients" need reconfiguration then. It is for sure safer and faster then TCP but only works on local system, not local network. What we could do is:

  • Put a by default commented setting into dietpi.txt to choose between TCP (port) or socket.
  • If setting not chosen, ask user during install (and/or during selection from dietpi-software menu) and pass setting to dietpi.txt and mpd.conf of course. If cancelled (or non-interactive) leave default TCP 6600 port, to assure existing installs will never change without user knowledge.
  • Add info about that to our online docs.

@MichaIng
Copy link
Owner Author

MichaIng commented Jan 3, 2019

@Fourdee

mpd_0.19.21_arm64.deb -> mpd_0.20.18-1_armv7.deb

ARMv8 binary does not work for ARMv8 on Jessie, but ARMv7 does?
Want to update the links, but want to be sure about that first 😉.

+ DietPi-Software | MPD: Simplify download links based on $G_HW_ARCH_DESCRIPTION and resolve Jessie + ARMv8 symlink
+ DietPi-Software | MPD: Move "mpd" user home to real new cache dir in dietpi_userdata to place potential .config/.cache/.something data from 3rd party libs
@MichaIng MichaIng requested a review from Fourdee January 3, 2019 20:44
+ CHANGELOG | Run MPD as "mpd" user and further installer updates
+ DietPi-Software | MPD: Whoopsie, add forgotten ".deb" ending
+ DietPi-Software | MPD: Do not try to move non-existent files/from non-existent dirs; Do not overwrite existing files
@MichaIng
Copy link
Owner Author

MichaIng commented Jan 3, 2019

🈴 Non-related Jessie YMPD error:
ympd: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

  • libssl1.1 required. We can easily fix by downloading from dietpi.com which we do already in other cases.
  • Create separate software ID for it? No worth the effort anymore, since support for Jessie is fading out anyway... 🈯️ Fixed

🈴 YMPD binaries for Buster are missing. Trying the ones for Stretch. 🈯️ Working well, besides comment after User=name in same line not allowed (on Buster).

+ DietPi-Software | YMPD: Install Stretch binary on Buster, until we have build a Buster binary
+ DietPi-Software | YMPD: Install required libssl1.1 from Stretch repo on Jessie
+ DietPi-Software | YMPD/Shairport-Sync: On Jessie+ARMv6, install armhf libssl1.1 binary, TESTING required!
+ DietPi-Software | YMPD/myMPD: Within systemd units on Buster, comments in same line after User= is not allowed
+ DietPi-Software | myMPD: useradd "mympd" if non-existent, otherwise usermod according to our needs
+ DietPi-Software | Remove User=root entries from all systemd units, which is default anyway
+ DietPi-Software | YMPD: Create "ympd" user only, if non-existent, otherwise use "usermod" to assure group "dietpi" and "nologin" shell
+ DietPi-Software | MPD: On Stretch (custom build), symlink /etc/mpd.conf to /usr/local/etc/mpd.conf, where /usr/local/bin/mpd by default searches
+ CHANGELOG | Resolved MPD config file issue on Stretch
+ DietPi-Software | MPD: Remove config files on uninstall; Especially required on Stretch, where due to custom build non is created/removed with the deb package
@Fourdee
Copy link
Collaborator

Fourdee commented Jan 4, 2019

@MichaIng

mpd_0.19.21_arm64.deb -> mpd_0.20.18-1_armv7.deb

Yep, this is incorrect. In theory should not work unless all pre-reqs are installed as :armhf.

@Fourdee
Copy link
Collaborator

Fourdee commented Jan 4, 2019

@MichaIng

Many thanks, looks good, will merge 👍

@Fourdee Fourdee merged commit 2c4bd00 into dev Jan 4, 2019
@MichaIng MichaIng deleted the mpd branch January 4, 2019 18:33
@MichaIng
Copy link
Owner Author

MichaIng commented Jan 4, 2019

@Fourdee

Yep, this is incorrect. In theory should not work unless all pre-reqs are installed as :armhf.

Currently:

lrwxrwxrwx 1 www-data www-data        23 Aug  3 16:14 mpd_0.19.21_arm64.deb -> mpd_0.20.18-1_armv7.deb
lrwxrwxrwx 1 www-data www-data        23 Aug  3 16:13 mpd_0.20.11-1_amd64.deb -> mpd_0.20.18-1_amd64.deb
lrwxrwxrwx 1 www-data www-data        23 Aug  3 16:13 mpd_0.20.11-1_armv6.deb -> mpd_0.20.18-1_armv6.deb
lrwxrwxrwx 1 www-data www-data        23 Aug  3 16:13 mpd_0.20.11-1_armv7.deb -> mpd_0.20.18-1_armv7.deb
lrwxrwxrwx 1 www-data www-data        23 Aug  3 16:14 mpd_0.20.11-1_armv8.deb -> mpd_0.20.18-1_armv7.deb
-rwxrwxr-x 1 www-data www-data    353068 Mar 25  2018 mpd_0.20.18-1_amd64.deb
-rwxrwxr-x 1 www-data www-data    273636 Mar 25  2018 mpd_0.20.18-1_armv6.deb
-rwxrwxr-x 1 www-data www-data    273150 Mar 25  2018 mpd_0.20.18-1_armv7.deb
-rwxrwxr-x 1 www-data www-data    318962 Mar 25  2018 mpd_0.20.18-1_armv8.deb
-rw-r--r-- 1 root     root        359430 Aug 24 00:06 mpd_0.20.21-1_amd64.deb
-rw-r--r-- 1 root     root        279242 Aug 24 01:24 mpd_0.20.21-1_armv6.deb
-rw-r--r-- 1 root     root        296952 Aug 23 21:46 mpd_0.20.21-1_armv7.deb
-rw-r--r-- 1 root     root        324796 Aug 23 21:46 mpd_0.20.21-1_armv8.deb
-rw-r--r-- 1 root     root        344412 Jan  2 22:02 mpd_0.20.23-1_aarch64.deb
-rw-r--r-- 1 root     root        295826 Jan  2 23:16 mpd_0.20.23-1_armv6l.deb
-rw-r--r-- 1 root     root        316304 Jan  2 22:02 mpd_0.20.23-1_armv7l.deb
-rw-r--r-- 1 root     root        381000 Jan  2 22:02 mpd_0.20.23-1_x86_64.deb

So until v0.20.11 all armv8 are linked to armv7. Still in use is only the fixed Jessie version (besides users with outdated DietPi). Shall we link all to v0.20.23 now + armv8 to correct aarch64? Or are the dependencies anyway not available there (because of Jessie and/or armv8)? Otherwise disable install option for this combo. We anyway don't offer Jessie armv8 images since longer.

@MichaIng
Copy link
Owner Author

MichaIng commented Jan 7, 2019

@Fourdee
How about the above:

  • Link old mpd armv8 packages to new (at least v0.20.18-1) armv8 now? But should be tested, perhaps there was some reason to link it to armv7?

@Fourdee
Copy link
Collaborator

Fourdee commented Jan 7, 2019

@MichaIng

Link old mpd armv8 packages to new (at least v0.20.18-1) armv8 now?

Yep should be fine. Let me test install.

@Fourdee
Copy link
Collaborator

Fourdee commented Jan 7, 2019

🈯️ Fine

root@DietPi:~# dpkg -i mpd_0.20.18-1_armv8.deb
dpkg: warning: downgrading mpd from 0.20.23-1 to 0.20.18-1
(Reading database ... 15004 files and directories currently installed.)
Preparing to unpack mpd_0.20.18-1_armv8.deb ...
Unpacking mpd (0.20.18-1) over (0.20.23-1) ...
Setting up mpd (0.20.18-1) ...
root@DietPi:~# dietpi-services restart

root@DietPi:~# systemctl status mpd
● mpd.service - Music Player Daemon (DietPi)
   Loaded: loaded (/lib/systemd/system/mpd.service; disabled; vendor preset: ena
bled)
   Active: active (running) since Mon 2019-01-07 20:07:44 GMT; 3s ago

@MichaIng
Copy link
Owner Author

MichaIng commented Jan 7, 2019

@Fourdee
Did you try on Jessie, since this is the case where armv7 links were used. However I will update the links now. It is anyway nearly impossible anyone runs into this, according to missing ARMv8 Jessie image 😉.

Updated URL in dietpi-software and links on server:

root@DietPi:/var/www/downloads/binaries/all# ls -al | grep mpd
lrwxrwxrwx 1 root root        23 Jan  7 21:26 mpd_0.19.21_arm64.deb -> mpd_0.20.18-1_armv8.deb
lrwxrwxrwx 1 root root        23 Aug  3 16:13 mpd_0.20.11-1_amd64.deb -> mpd_0.20.18-1_amd64.deb
lrwxrwxrwx 1 root root        23 Aug  3 16:13 mpd_0.20.11-1_armv6.deb -> mpd_0.20.18-1_armv6.deb
lrwxrwxrwx 1 root root        23 Aug  3 16:13 mpd_0.20.11-1_armv7.deb -> mpd_0.20.18-1_armv7.deb
lrwxrwxrwx 1 root root        23 Jan  7 21:26 mpd_0.20.11-1_armv8.deb -> mpd_0.20.18-1_armv8.deb
-rw-r--r-- 1 root root    353068 Mar 25  2018 mpd_0.20.18-1_amd64.deb
-rw-r--r-- 1 root root    273636 Mar 25  2018 mpd_0.20.18-1_armv6.deb
-rw-r--r-- 1 root root    273150 Mar 25  2018 mpd_0.20.18-1_armv7.deb
-rw-r--r-- 1 root root    318962 Mar 25  2018 mpd_0.20.18-1_armv8.deb

@Fourdee
Copy link
Collaborator

Fourdee commented Jan 10, 2019

@MichaIng

Did you try on Jessie, since this is the case where armv7 links were used. However I will update the links now. It is anyway nearly impossible anyone runs into this, according to missing ARMv8 Jessie image

Not tried it on Jessie, all our images excluding Odroid C1 are now Stretch.

Updated URL in dietpi-software and links on server:

Legend, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants