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 | myMPD: Update install steps to avoid deprecations #3097

Closed
jcorporation opened this issue Sep 3, 2019 · 6 comments
Closed

Comments

@jcorporation
Copy link

jcorporation commented Sep 3, 2019

Hi,
I am the developer of myMPD and I plan to release a new myMPD release which will break your source build in the future.

The mkrelease.sh script is deprecated in my devel branch.
Please consider replacing ./mkrelease.sh with ./build.sh releaseinstall. For now I added a ./mkrelease.sh wrapper in devel and a ./build.sh wrapper in master to prevent breakage of your source build.

I see also, that you change the group of the mympd user to dietpi in your systemd service. Why is this needed and is it not better to change the primary usergroup to dietpi? Changing usermod -a -G dietpi mympd to usermod -g dietpi mympd should have the same effect?
In the new version myMPD creates the directory /var/lib/mympd ans it subdirs on startup with a umask of 0007.

The symlink to music/libary is no more needed. myMPD handles this internally.

Best regards and many thanks for this great software.

In the new version the configuration file is now /etc/mympd.conf no more /etc/mympd/mympd.conf. The syscmds directory is replaced with a section within mympd.conf.

@MichaIng MichaIng added this to the v6.27 milestone Sep 4, 2019
@MichaIng
Copy link
Owner

MichaIng commented Sep 4, 2019

@jcorporation
Many thanks for your info! Since it is still compatible, I will apply the changes with v6.27. We need to get v6.26 released soon.

About user/group:

  • Are you aware of any downsides when applying dietpi group via systemd unit only? It is a failsafe method, that avoids to touch additional groups, the user was added to, so e.g. on reinstall, if the "user" changed permissions or group memberships for some reason, those are not overwritten. Also we can do this as a general method for all software installs, where required, without needing to check and perserve explicitely existing memberships.
  • Btw we use dietpi group with all software titles, that write files to media or download dirs, so other media and download software can access those files without any additional configuration needed, and this with all downloaders/sonarr/radarr/../media players etc we offer. But actually myMPD does not write media files, does it? It should be sufficient to add dietpi group as additional group only (so it has read access to media files), but it can still run as mympd group?
  • I will have a look at config directories and symlinks. When do you expect release where these changes need to be done?

@jcorporation
Copy link
Author

myMPD don't write files to media or download dirs. It writes only internal states to /var/lib/mympd. So it should be sufficient to add dietpi group as additional group only.

The revised install script now detects old installations and run following actions:

  • removes the /usr/share/mympd directory entirely (assets are now embedded in the binary)
  • moves /etc/mympd/mympd.conf to /etc/mympd.conf
  • removes /etc/mympd directory
  • removes /var/lib/mympd/tmp directory
  • moves the systemd unit from /usr/lib/systemd/system to /lib/systemd/system (right place according to lintian)

I hope this changes enables a smooth change for the dietpi users. Feel free to propose changes to the installation / upgrade workflow for myMPD.

The new version of myMPD should be released in this month.

@MichaIng
Copy link
Owner

Great, I will implement the change to not run myMPD as dietpi group. Probably we can manage it to align DietPi release with myMPD ones so that there will be no installer incompatibilities, otherwise adjust it for this version to support both based on upstream version string.

@jcorporation
Copy link
Author

myMPD 5.6.0 is now released. It should not break your source build.

@MichaIng MichaIng modified the milestones: v6.27, v6.26 Sep 14, 2019
MichaIng added a commit that referenced this issue Sep 15, 2019
+ DietPi-Software | myMPD: Update install steps to match current version: #3097
+ DietPi-Software | myMPD: Do not run service as "dietpi" group. Since it only reads but not writes media files, it is sufficient with "dietpi" as supplementary group.
@MichaIng
Copy link
Owner

@jcorporation
Okay I updated our installer as well: #3110

Btw I saw: https://github.com/jcorporation/myMPD/blob/master/build.sh#L184-L188
rmdir has the option --ignore-fail-on-non-empty which allows it to omit and succeed on non-empty dirs silently.

MichaIng added a commit that referenced this issue Sep 15, 2019
+ DietPi-Patch | myMPD: Move systemd unit to new location (matching current release) and do not start as "dietpi" group anymore, which is only required for software titles that write media files: #3097
MichaIng added a commit that referenced this issue Sep 15, 2019
+ DietPi-Software | myMPD: Update install steps to match current version: #3097
+ DietPi-Software | myMPD: Do not run service as "dietpi" group. Since it only reads but not writes media files, it is sufficient with "dietpi" as supplementary group.
+ DietPi-Software | myMPD: Add libmediainfo0v5 to pre-reqs. It is pulled with libmediainfo-dev, but same as with libmpdclient-dev and libmpdclient2 we need to have the library stay installed if user uninstalls -dev packages, e.g. via DietPi-Cleaner.
+ DietPi-Software | Do not prompt via G_WHIP when Download_Install() updates a config file, but print via G_DIETPI-NOTIFY() only instead. If it is a config file where custom user changes are expected, we create a G_BACKUP_FP() anyway which as well prints related info.
+ DietPi-Patch | myMPD: Move systemd unit to new location (matching current release) and do not start as "dietpi" group anymore, which is only required for software titles that write media files: #3097
@jcorporation
Copy link
Author

thanks for the hint with rmdir

@MichaIng MichaIng changed the title myMPD source build DietPi-Software | myMPD: Update install steps to avoid deprecations Sep 16, 2019
@MichaIng MichaIng mentioned this issue Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants