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

Make systemd service robust to permission issues #364

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jollyroger
Copy link

In order for facette to successfully start there are some preconditions to be met:

  • directory in /run should exist and permissions should allow to write facette user to it
  • if facette listens on UNIX socket it should not exist when starting facette service

In order for facette to successfully start there are some preconditions to be met:

 * directory in /run should exist and permissions should allow to write facette user to it
 * if facette listens on UNIX socket it should not exist when starting facette service
Copy link
Member

@vbatoufflet vbatoufflet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jollyroger,

Thanks for the PR.

I see that you enforce /run/facette creation and permissions, but retrieve the socket location from the configuration file.

What about if the .sock file is not located in /run/facette?

@jollyroger
Copy link
Author

jollyroger commented Nov 19, 2018

@vbatoufflet I tried to avoid putting additional checks and logic for these reasons:

  • /run is recreated at boot time so this is where we should really check if the directory exists and create if necessary; there is no harm in creating the directory in /run as well even if no pidfile or socket file is used;
  • in case the socket file is stored not in /run it is sufficient to create directory and set its permissions by hand during initial service configuration; creating the directory automatically in this case could do more harm then good because we cannot possibly know the exact directory permissions;
  • in either case the service won't start if socket file already exist so we should remove it beforehand

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

Successfully merging this pull request may close these issues.

None yet

2 participants