Skip to content

Commit

Permalink
Merge pull request #87 from JohanSaaw/public/9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelherger authored Feb 2, 2025
2 parents 0f5a562 + 7e343db commit 8e1aabe
Showing 1 changed file with 3 additions and 46 deletions.
49 changes: 3 additions & 46 deletions redhat/lyrionmusicserver.spec
Original file line number Diff line number Diff line change
Expand Up @@ -328,25 +328,6 @@ function parseSysconfigSqueezeboxserver {
fi
}

function setSelinux {

test -f /tmp/squeezerpmdebug && set -x

MYSQLPORT=9092
CACHEDIR=%{_var}/lib/%{shortname}/cache

# Add SELinux contexts
# We need this irrespective of whether it is a systemd or SYSV server.
if [ -x /usr/sbin/selinuxenabled ] ; then
if /usr/sbin/selinuxenabled ; then
[ -x /usr/sbin/semanage ] && /usr/sbin/semanage port -a -t mysqld_port_t -p tcp ${MYSQLPORT} > /dev/null 2>&1
[ -x /usr/sbin/semanage ] && /usr/sbin/semanage fcontext -a -t mysqld_db_t "${CACHEDIR}(/.*)?" > /dev/null 2>&1
[ -x /usr/sbin/semanage ] && /usr/sbin/semanage fcontext -a -t mysqld_var_run_t "${CACHEDIR}/%{shortname}-mysql.sock" > /dev/null 2>&1
/sbin/restorecon -R ${CACHEDIR} > /dev/null 2>&1
fi
fi
}

function setSYSV {

test -f /tmp/squeezerpmdebug && set -x
Expand Down Expand Up @@ -494,11 +475,6 @@ if [ -e /etc/init.d/%{shortname} -a -x /usr/bin/systemctl ] ; then
migrate=true
fi

# If CentOS/RedHat/Fedora, handle selinux
if [ -f /etc/redhat-release -o -n "$(echo \"$ID_LIKE $ID\" | /usr/bin/perl -ne '/(fedora|centos|rhel|redhat|rocky|alma)/i and print')" ] ; then
setSelinux
fi

# Check if we need to migrate a squeezeboxserver config to lyrion music server

if [ -f /var/tmp/migrateSqueezeboxserverConfig ]; then
Expand Down Expand Up @@ -526,21 +502,6 @@ echo "Point your web browser to http://$HOSTNAME:$PORT/ to configure Lyrion Musi

%preun
test -f /tmp/squeezerpmdebug && set -x
function unsetSelinux {

# Remove SELinux contexts
MYSQLPORT=9092
CACHEDIR=%{_var}/lib/%{shortname}/cache
if [ -x /usr/sbin/selinuxenabled ] ; then
if /usr/sbin/selinuxenabled; then
[ -x /usr/sbin/semanage ] && /usr/sbin/semanage port -d -t mysqld_port_t -p tcp ${MYSQLPORT}
[ -x /usr/sbin/semanage ] && /usr/sbin/semanage fcontext -d -t mysqld_db_t "${CACHEDIR}(/.*)?"
[ -x /usr/sbin/semanage ] && /usr/sbin/semanage fcontext -d -t mysqld_var_run_t "${CACHEDIR}/%{shortname}-mysql.sock"
/sbin/restorecon -R ${CACHEDIR}
fi
fi

}

function unsetSYSV {

Expand Down Expand Up @@ -584,13 +545,6 @@ if [ "$1" -eq "0" ] ; then

fi

# If CentOS/Fedora/RedHat, remove selinux settings
if [ -f /etc/redhat-release -o -n "$(echo \"$ID_LIKE $ID\" | /usr/bin/perl -ne '/(fedora|centos|rhel|redhat|rocky|alma)/i and print')" ] ; then

unsetSelinux

fi

fi


Expand Down Expand Up @@ -651,6 +605,9 @@ fi


%changelog
* Sat Feb 01 2025 Johan Saaw
- Removed selinux config support for mySQL/MariaDB databases as they are no
longer officially supported for LMS
* Sat Aug 24 2024 Johan Saaw
- Simplified the logic around detecting whether a migration from
squeezeboxserver config to lyrionmusicserver configuration is needed.
Expand Down

0 comments on commit 8e1aabe

Please sign in to comment.