Skip to content

Commit d7b8a2e

Browse files
committed
Set maintainer-install permissions for fedora installations
1 parent 089f7f8 commit d7b8a2e

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

Makefile

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ REC_TARGETS=build domserver install-domserver judgehost install-judgehost \
1111
# Global Makefile definitions
1212
include $(TOPDIR)/Makefile.global
1313

14+
debpool := "/etc/php/$(PHPVERSION)/fpm/pool.d"
15+
fedpool := "/etc/php-fpm.d"
16+
1417
default:
1518
@echo "No default target"
1619
@echo
@@ -284,12 +287,27 @@ inplace-postinstall-apache: inplace-postinstall-permissions
284287
systemctl restart apache2
285288

286289
inplace-postinstall-nginx: inplace-postinstall-permissions
287-
@if [ ! -d "/etc/nginx/sites-enabled/" ]; then echo "Couldn't find directory /etc/nginx/sites-enabled/. Is nginx installed?"; false; fi
288-
@if [ ! -d "/etc/php/$(PHPVERSION)/fpm/pool.d/" ]; then echo "Couldn't find directory /etc/php/$(PHPVERSION)/fpm/pool.d/. Is php-fpm installed?"; false; fi
289-
ln -sf $(CURDIR)/etc/nginx-conf /etc/nginx/sites-enabled/domjudge.conf
290-
ln -sf $(CURDIR)/etc/domjudge-fpm.conf /etc/php/$(PHPVERSION)/fpm/pool.d/domjudge-fpm.conf
290+
@if command -v sestatus >/dev/null 2>&1; then \
291+
chcon -R -t httpd_config_t $(CURDIR); \
292+
fi
293+
@if [ ! -d "/etc/nginx/" ]; then echo "Couldn't find directory /etc/nginx/. Is nginx installed?"; false; fi
294+
@if [ -d "/etc/nginx/sites-enabled/" ]; then \
295+
ln -sf $(CURDIR)/etc/nginx-conf /etc/nginx/sites-enabled/domjudge.conf; \
296+
else \
297+
ln -sf $(CURDIR)/etc/nginx-conf /etc/nginx/conf.d/domjudge.conf; \
298+
fi
291299
systemctl restart nginx
292-
systemctl restart php$(PHPVERSION)-fpm
300+
@if [ ! -d "$(debpool)" ] && [ ! -d "$(fedpool)" ]; then \
301+
echo "Couldn't find directory $(debpool) or $(fedpool). Is php-fpm installed?"; false; \
302+
fi
303+
@if [ -d "$(debpool)" ]; then \
304+
ln -sf $(CURDIR)/etc/domjudge-fpm.conf $(debpool)/domjudge-fpm.conf; \
305+
systemctl restart "php$(PHPVERSION)-fpm"; \
306+
fi
307+
@if [ -d "$(fedpool)" ]; then \
308+
ln -sf $(CURDIR)/etc/domjudge-fpm.conf $(fedpool)/domjudge-fpm.conf; \
309+
systemctl restart php-fpm; \
310+
fi
293311

294312
# Removes created symlinks; generated logs, submissions, etc. remain in output subdir.
295313
inplace-uninstall-l:

0 commit comments

Comments
 (0)