Skip to content

Commit

Permalink
v6.26 (#3110)
Browse files Browse the repository at this point in the history
+ 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
  • Loading branch information
MichaIng authored Sep 15, 2019
1 parent 6dd9b17 commit 5db4a33
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 32 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Changes / Improvements / Optimisations:
- DietPi-Software | Gogs: On ARMv7 and x86_64 now the latest version from GitHub is installed. Reinstalls will upgrade the version while preserving existing settings. Many thanks to @LazyLama for doing this suggestion: https://github.com/MichaIng/DietPi/issues/2999
- DietPi-Software | Webmin: Install is now done via official APT repository to allow easier updates. To apply this to all systems, it is reinstalled on DietPi-Update to v6.26. Additionally the dependency on rsyslog has been removed. The Webmin logging panel still depends on rsyslog, but the overhead shall not be applied to all systems by default. Instead users can now decide themselves, whether they need to see system logs on Webmin, or not, and in case apply custom logging settings as well.
- DietPi-Software | Amiberry: Enabled support for RPi4 and Odroid XU4. Thanks to @midwan for providing the binaries: https://github.com/MichaIng/DietPi/issues/3104
- DietPi-Software | myMPD: Updated install steps to avoid deprecations of the current upstream version. As well the service will not run as primary group "dietpi" anymore, which is only required for software that creates media files. Many thanks to @jcorporation (developer of myMPD) for providing this information as well as a smooth build script that updates old instances gracefully: https://github.com/MichaIng/DietPi/issues/3097

Bug Fixes:
- General | Removed an obsolete OpenMediaVault cron job and binary that was leftover on at least one of our images (NanoPi NEO2) and is not part of the current OMV packages, thus save to remove in every case. Many thanks to @kt1024 for reporting this issue: https://github.com/MichaIng/DietPi/issues/2994
Expand Down
47 changes: 15 additions & 32 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -2867,7 +2867,7 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
# Download file
if [[ $DEPS_LIST ]]; then

# - Download as background thread if dependencies are to be installed
# Download as background thread if dependencies are to be installed
G_THREAD_START wget "$url" -O $file
G_AGI $DEPS_LIST
DEPS_LIST=''
Expand All @@ -2882,16 +2882,16 @@ Package: *php7.3*\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/di
# Process downloaded file
if [[ $type == dps_index ]]; then

# - Pre-create dir
# Pre-create dir
local fp_dir=${target%/*}
[[ -d $fp_dir ]] || G_RUN_CMD mkdir -p "$fp_dir"

[[ -f $target ]] && G_WHIP_MSG "[ INFO ] Updating file: $target"
[[ -f $target ]] && G_DIETPI-NOTIFY 2 "Updating file: $target"
G_RUN_CMD mv $file "$target"

elif [[ $type == 'deb' ]]; then

# - Allow error on first attempt, giving APT fix a change to resolve e.g. dependencies
# Allow error on first attempt, giving APT fix a change to resolve e.g. dependencies
G_INTERACTIVE=0 G_ERROR_HANDLER_INFO_ONLY=1 G_RUN_CMD dpkg --force-hold,confdef,confold -i $file
(( $G_ERROR_HANDLER_EXITCODE_RETURN )) && G_DIETPI-NOTIFY 2 'Trying automated APT fix' && G_AGF

Expand Down Expand Up @@ -3556,12 +3556,11 @@ _EOF_
Banner_Installing

# Sourcebuild pre-reqs: https://github.com/jcorporation/myMPD#dependencies
DEPS_LIST='libmpdclient2 cmake cppcheck pkg-config libmpdclient-dev libssl-dev libmediainfo-dev'

DEPS_LIST='libmpdclient2 libmediainfo0v5 cmake cppcheck pkg-config libmpdclient-dev libssl-dev libmediainfo-dev'
Download_Install 'https://github.com/jcorporation/myMPD/archive/master.zip'

cd myMPD-master
G_RUN_CMD ./mkrelease.sh
G_RUN_CMD ./build.sh releaseinstall
cd /tmp/$G_PROGRAM_NAME
rm -R myMPD-master

Expand Down Expand Up @@ -8006,34 +8005,19 @@ _EOF_
Banner_Configuration

# Add user to "dietpi" group
usermod -a -G dietpi mympd
# - Add to new "render" group on Buster
(( $G_DISTRO > 4 )) && usermod -a -G render mympd

# Run service as "dietpi" group
mkdir -p /etc/systemd/systemd/mympd.service.d
echo -e '[Service]\nGroup=dietpi' > /etc/systemd/systemd/mympd.service.d/dietpi-group.conf
usermod -aG dietpi mympd
# Add to new "render" group on Buster
(( $G_DISTRO > 4 )) && usermod -aG render mympd

# Adjust config file on fresh install
# - On reinstall /etc/mympd/mympd.conf.dist will be created, so use its existence as reinstall flag
if [[ ! -f '/etc/mympd/mympd.conf.dist' ]]; then
if [[ ! -f '/etc/mympd.conf.dist' ]]; then

G_CONFIG_INJECT 'webport[[:blank:]]*=' 'webport = 1333' /etc/mympd/mympd.conf
G_CONFIG_INJECT 'ssl[[:blank:]]*=' 'ssl = false' /etc/mympd/mympd.conf
G_CONFIG_INJECT 'webport[[:blank:]]*=' 'webport = 1333' /etc/mympd.conf
G_CONFIG_INJECT 'ssl[[:blank:]]*=' 'ssl = false' /etc/mympd.conf

fi

# Symlink music/libary dir to DietPi music dir
if [[ $(readlink /usr/share/mympd/htdocs/library) != $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC ]]; then

rm -Rf /usr/share/mympd/htdocs/library
ln -sf $G_FP_DIETPI_USERDATA/$FOLDER_MUSIC /usr/share/mympd/htdocs/library

fi

# Permissions
chown -R mympd:dietpi /var/lib/mympd

fi

software_id=121 # Roon Bridge
Expand Down Expand Up @@ -12466,14 +12450,13 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == -1 )); then

#apt-mark auto libmpdclient2 cmake cppcheck pkg-config libmpdclient-dev libssl-dev libmediainfo-dev
if [[ -f '/usr/lib/systemd/system/mympd.service' ]]; then
if [[ -f '/lib/systemd/system/mympd.service' ]]; then

systemctl unmask mympd
systemctl disable mympd
rm /usr/lib/systemd/system/mympd.service
systemctl disable --now mympd
rm /lib/systemd/system/mympd.service

fi
[[ -d '/etc/systemd/system/mympd.service.d' ]] && rm -R /etc/systemd/system/mympd.service.d
getent passwd mympd &> /dev/null && userdel -rf mympd
command -v mympd &> /dev/null && rm $(command -v mympd)
rm -Rf /{etc,var/lib,usr/share}/mympd
Expand Down
14 changes: 14 additions & 0 deletions dietpi/patch_file
Original file line number Diff line number Diff line change
Expand Up @@ -2235,6 +2235,20 @@ Do you want to keep PulseAudio installed?' || apt-mark auto pulseaudio
G_AGA
G_AGI --reinstall aml-libs-odroid mali450-odroid libump-odroid xf86-video-fbturbo-odroid

fi
# myMPD: https://github.com/MichaIng/DietPi/pull/3110
if grep -q '^aSOFTWARE_INSTALL_STATE\[148\]=2' /DietPi/dietpi/.installed; then

# NB: On Debian Buster by default /lib is a symlink to /usr/lib, thus the below fails as both files are the same. However it does not hurt and assures no obsolete service file will be left (after uninstall).
if [[ -f '/usr/lib/systemd/system/mympd.service' ]]; then

mv /usr/lib/systemd/system/mympd.service /lib/systemd/system/mympd.service 2> /dev/null
systemctl daemon-reload

fi
[[ -f '/etc/systemd/systemd/mympd.service.d/dietpi-group.conf' ]] && rm /etc/systemd/systemd/mympd.service.d/dietpi-group.conf
[[ -d '/etc/systemd/systemd/mympd.service.d' ]] && rmdir --ignore-fail-on-non-empty /etc/systemd/systemd/mympd.service.d

fi
# Webmin: https://github.com/MichaIng/DietPi/commit/ec55d49a488fd9cb1dbb18cbfa067b5d1d1a974e
/DietPi/dietpi/dietpi-software reinstall 115
Expand Down

0 comments on commit 5db4a33

Please sign in to comment.