From 8740fdf54bc9f0ee3ab34f5f2143eeede773a90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Wed, 12 Oct 2016 14:29:50 +0000 Subject: [PATCH] Fix FastCGI server systemd script / RPM in trunk (#1093) --- Makefile | 2 +- fastcgi-server/systemd/llng-fastcgi-server.service | 2 ++ rpm/lemonldap-ng.spec | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7e1cb0c58..6194a297d 100644 --- a/Makefile +++ b/Makefile @@ -503,7 +503,7 @@ install_fastcgi_server: @chmod +x $(RSBINDIR)/llng-fastcgi-server @cp -f fastcgi-server/rc/llng-fastcgi-server $(RINITDIR) @cp -f fastcgi-server/default/llng-fastcgi-server $(RETCDEFAULTDIR) - @$(PERL) -pi -e 's#__SBINDIR__#$(SBINDIR)#;s#__DEFAULTDIR__#$(ETCDEFAULTDIR)#;s#__FASTCGISOCKDIR__#$(FASTCGISOCKDIR)#g;s#__USER__#$(FASTCGIUSER)#;s#__GROUP__#$(FASTCGIGROUP)#;' \ + @$(PERL) -pi -e 's#__SBINDIR__#$(SBINDIR)#;s#__DEFAULTDIR__#$(ETCDEFAULTDIR)#;s#__FASTCGISOCKDIR__#$(FASTCGISOCKDIR)#g;' \ $(RETCDEFAULTDIR)/llng-fastcgi-server \ $(RSBINDIR)/llng-fastcgi-server \ $(RINITDIR)/llng-fastcgi-server diff --git a/fastcgi-server/systemd/llng-fastcgi-server.service b/fastcgi-server/systemd/llng-fastcgi-server.service index 330a10359..6c0e429d2 100644 --- a/fastcgi-server/systemd/llng-fastcgi-server.service +++ b/fastcgi-server/systemd/llng-fastcgi-server.service @@ -6,6 +6,8 @@ After=network.target Type=forking EnvironmentFile=/etc/default/llng-fastcgi-server PIDFile=__FASTCGISOCKDIR__/llng-fastcgi-server.pid +ExecStartPre=-/bin/mkdir __FASTCGISOCKDIR__ +ExecStartPre=/bin/chown __USER__:__GROUP__ __FASTCGISOCKDIR__ ExecStart=__SBINDIR__/llng-fastcgi-server ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile ${PID} KillMode=mixed diff --git a/rpm/lemonldap-ng.spec b/rpm/lemonldap-ng.spec index 6d93f75f3..beef577b0 100644 --- a/rpm/lemonldap-ng.spec +++ b/rpm/lemonldap-ng.spec @@ -393,6 +393,8 @@ mkdir -p %{buildroot}%{_unitdir} install -m644 fastcgi-server/systemd/llng-fastcgi-server.service %{buildroot}%{_unitdir} sed -i 's:__FASTCGISOCKDIR__:/var/run/llng-fastcgi-server:' %{buildroot}%{_unitdir}/llng-fastcgi-server.service sed -i 's:__SBINDIR__:/usr/share/lemonldap-ng/sbin:' %{buildroot}%{_unitdir}/llng-fastcgi-server.service +sed -i 's:__USER__:%{lm_apacheuser}:' %{buildroot}%{_unitdir}/llng-fastcgi-server.service +sed -i 's:__GROUP__:%{lm_apachegroup}:' %{buildroot}%{_unitdir}/llng-fastcgi-server.service # Set apache user in some files (see Makefile) # Note: we do not use the APACHEUSER and APACHEGROUP in make install