diff --git a/distros/redhat/zoneminder.spec b/distros/redhat/zoneminder.spec index 9e4fd2951..fa188bf28 100644 --- a/distros/redhat/zoneminder.spec +++ b/distros/redhat/zoneminder.spec @@ -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