@@ -11,6 +11,9 @@ REC_TARGETS=build domserver install-domserver judgehost install-judgehost \
11
11
# Global Makefile definitions
12
12
include $(TOPDIR ) /Makefile.global
13
13
14
+ debpool := /etc/php/$(PHPVERSION ) /fpm/pool.d
15
+ fedpool := /etc/php-fpm.d
16
+
14
17
default :
15
18
@echo " No default target"
16
19
@echo
@@ -275,6 +278,14 @@ inplace-postinstall-permissions:
275
278
setfacl -R -m u:$(DOMJUDGE_USER ) :rwx $(CURDIR ) /webapp/var
276
279
setfacl -R -m d:m::rwx $(CURDIR ) /webapp/var
277
280
setfacl -R -m m::rwx $(CURDIR ) /webapp/var
281
+ if command -v sestatus > /dev/null 2>&1 ; then \
282
+ chcon -R -t httpd_sys_content_t $(CURDIR ) /webapp; \
283
+ chcon -R -t httpd_config_t $(CURDIR ) /etc; \
284
+ chcon -R -t httpd_log_t $(CURDIR ) /webapp/var/log; \
285
+ chcon -R -t httpd_sys_rw_content_t $(CURDIR ) /webapp/var/cache; \
286
+ chcon -R -t httpd_sys_rw_content_t $(CURDIR ) /webapp/public/images; \
287
+ chcon -t httpd_exec_t $(CURDIR ) /lib/alert; \
288
+ fi
278
289
279
290
inplace-postinstall-apache : inplace-postinstall-permissions
280
291
@if [ ! -d " /etc/apache2/conf-enabled" ]; then echo " Couldn't find directory /etc/apache2/conf-enabled. Is apache installed?" ; false ; fi
@@ -284,12 +295,23 @@ inplace-postinstall-apache: inplace-postinstall-permissions
284
295
systemctl restart apache2
285
296
286
297
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
298
+ @if [ ! -d " /etc/nginx/" ]; then echo " Couldn't find directory /etc/nginx/. Is nginx installed?" ; false ; fi
299
+ @cmd=" ln -sf $( CURDIR) /etc/nginx-conf /etc/nginx/conf.d/domjudge.conf" ; \
300
+ if [ -d " /etc/nginx/sites-enabled/" ]; then \
301
+ cmd=" ln -sf $( CURDIR) /etc/nginx-conf /etc/nginx/sites-enabled/domjudge.conf" ; \
302
+ fi ; echo $$ cmd; $$ cmd
291
303
systemctl restart nginx
292
- systemctl restart php$(PHPVERSION ) -fpm
304
+ @if [ ! -d " $( debpool) " ] && [ ! -d " $( fedpool) " ]; then \
305
+ echo " Couldn't find directory $( debpool) or $( fedpool) . Is php-fpm installed?" ; false ; \
306
+ fi
307
+ @service=" php-fpm" ; phppool=" $( fedpool) " ; \
308
+ if [ -d " $( debpool) " ]; then \
309
+ phppool=" ln -sf $( CURDIR) /etc/domjudge-fpm.conf $( debpool) /domjudge-fpm.conf" ; \
310
+ service=" php$( PHPVERSION) -fpm" ; \
311
+ fi ; \
312
+ service=" systemctl restart $$ service" ; \
313
+ ln=" ln -sf $( CURDIR) /etc/domjudge-fpm.conf $$ phppool/domjudge-fpm.conf" ; \
314
+ echo $$ ln; echo $$ service; $$ ln; $$ service
293
315
294
316
# Removes created symlinks; generated logs, submissions, etc. remain in output subdir.
295
317
inplace-uninstall-l :
0 commit comments