rpm pkg - change ownership of php session files

This commit is contained in:
Andy Bauer 2018-11-18 11:16:46 -06:00
parent 05c4f586c2
commit 5e2935b81d
1 changed files with 7 additions and 1 deletions

View File

@ -128,7 +128,7 @@ Requires: zip
%{systemd_requires}
Requires(post): %{_bindir}/gpasswd
Requires(post): %{_bindir}/less
Requires(post): %{_bindir}/chown
%description common
ZoneMinder is a set of applications which is intended to provide a complete
@ -250,6 +250,9 @@ echo -e "\nVERY IMPORTANT: Before starting ZoneMinder, you must read the README
echo -e "\nThe README file is located here: %{_pkgdocdir}-common/README\n"
%post httpd
# For the case of changing from nginx <-> httpd, existing php session files must change ownership
%{_bindir}/chown -R %{zmuid_final}:%{zmgid_final} %{_sharedstatedir}/php/session/ >/dev/null 2>&1 || :
ln -sf %{_sysconfdir}/zm/www/com.zoneminder.systemctl.rules.httpd %{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules
# backwards compatibility
ln -sf %{_sysconfdir}/zm/www/zoneminder.httpd.conf %{_sysconfdir}/zm/www/zoneminder.conf
@ -264,6 +267,9 @@ ln -sf %{_sysconfdir}/zm/www/zoneminder.httpd.conf %{_sysconfdir}/zm/www/zonemin
# We could override the folder permission, but adding nginx to the apache group works better
%{_bindir}/gpasswd -a nginx apache >/dev/null 2>&1 || :
# For the case of changing from httpd <-> nginx, existing php session files must change ownership
%{_bindir}/chown -R nginx:nginx %{_sharedstatedir}/php/session/ >/dev/null 2>&1 || :
ln -sf %{_sysconfdir}/zm/www/com.zoneminder.systemctl.rules.nginx %{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules
# backwards compatibility
ln -sf %{_sysconfdir}/zm/www/zoneminder.nginx.conf %{_sysconfdir}/zm/www/zoneminder.conf