Fix: run myMPD under myMPD user

This commit is contained in:
jcorporation 2018-09-04 22:07:30 +02:00
parent d799fe1e87
commit 8490303b97
4 changed files with 17 additions and 5 deletions

View File

@ -7,6 +7,7 @@ then
fi
mkdir -p /etc/mympd/ssl/ca/certs
chmod 700 /etc/mympd/ssl
cd /etc/mympd/ssl/ca
echo '01' > serial
@ -98,3 +99,5 @@ openssl ca -in server.csr -cert ca/ca.pem -keyfile ca/ca.key -config ca/ca.cnf \
rm server.csr
rm ca/ca.cnf
rm req.cnf
chown -R mympd.mympd /etc/mympd/

View File

@ -4,13 +4,13 @@
# (c) 2018 Juergen Mang <mail@jcgames.de
Name: myMPD
Version: master
Version: devel
Release: 0
License: GPL-2.0
Group: Productivity/Multimedia/Sound/Players
Summary: Standalone webclient for mpd
Url: https://github.com/jcorporation/myMPD
Source: https://github.com/jcorporation/myMPD/archive/master.zip
Source: https://github.com/jcorporation/myMPD/archive/devel.zip
BuildRequires: gcc
BuildRequires: cmake
BuildRequires: unzip
@ -39,7 +39,12 @@ make install DESTDIR=%{buildroot}
%post
/usr/share/mympd/crcert.sh
chown nobody /var/lib/mympd
getent group mympd > /dev/null
[ "$?" == "2" ] && groupadd mympd
getent passwd mympd > /dev/null
[ "$?" == "2" ] && useradd mympd -g mympd
chown -R mympd /var/lib/mympd
%files
%defattr(-,root,root,-)

View File

@ -15,7 +15,7 @@ sslcert = /etc/mympd/ssl/server.pem
sslkey = /etc/mympd/ssl/server.key
#myMPD user
user = nobody
user = mympd
#Port for mpd http stream
streamport = 8000

View File

@ -50,7 +50,11 @@ sudo make install
cd ..
echo "Fixing ownership of /var/lib/mympd"
sudo chown nobody /var/lib/mympd
getent group mympd > /dev/null
[ "$?" == "2" ] && sudo groupadd mympd
getent passwd mympd > /dev/null
[ "$?" == "2" ] && sudo useradd mympd -g mympd
sudo chown -R mympd.mympd /var/lib/mympd
echo "Trying to link musicdir to library"
if [ -f /etc/mpd.conf ]