Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add systemd service file #12

Closed
wants to merge 1 commit into from
Closed

Add systemd service file #12

wants to merge 1 commit into from

Conversation

Marenz
Copy link
Contributor

@Marenz Marenz commented Jun 3, 2016

Adds systemd service file to start up foswiki automatically.

Note that the user still has to replace the value for 'WorkingDirectory' as that setting does not support variable substitution.
A work around could be that we start a script that starts foswiki.fcgi in the right working directory.

Adds systemd service file to start up foswiki automatically. 

Note that the user still has to replace the value for 'WorkingDirectory' as that setting does not support variable substitution.
A work around could be that we start a script that starts foswiki.fcgi in the right working directory.
@gac410
Copy link
Member

gac410 commented Jun 5, 2016

Thanks. Your example file has been added to FastCGIEngineContrib.

@gac410 gac410 closed this Jun 5, 2016
@mabes
Copy link

mabes commented Mar 17, 2017

The provided systemd service file runs the foswiki FastCGI process as root which is very bad from a security standpoint. A vulnerability in Foswiki could compromize the whole system. Can you add (parametrized) User= and Group= directives to the example service file ? I can make a separate PR for this

@gac410
Copy link
Member

gac410 commented Mar 18, 2017

Hi, good find, thanks. I tried adding the parameterized User & Group directives, but the parameters appear to be ignored. At least on Ubuntu 16.04, I could only change the user/group by hardcoding them into the service file.

I'm also having a bit of trouble with the PIDFile. The service doesn't create one, where as the traditional init script does. As the traditional foswiki init script appears to work fine on systemd systems, I'm wondering if it might be better to just drop this file.

@mabes
Copy link

mabes commented Mar 20, 2017

Indeed, it looks like User= and Group= cannot take parameters, my bad. The PIDfile issue probably comes from the fact that you don't have write permissions to /var/run as a non-privileged user. The initscript works because it creates and chowns the file as root before dropping privileges.
I can think of two solutions :

  • use /var/run/foswiki/foswiki.pid instead, the user would need to create /var/run/foswiki/ and chown it to the user running the foswiki service. Most non privileged services already do something like this
  • use /var/www/foswiki/working/foswiki.pid, as this folder necessarily has write permission from the foswiki user

@gac410
Copy link
Member

gac410 commented Mar 20, 2017 via email

@gac410
Copy link
Member

gac410 commented Mar 21, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants