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

Allow init to delete daemorundir #2133

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

Conversation

AlessandroBono
Copy link

When a service specifies a runtime directory in its systemd service file with the RuntimeDirectory= property, systemd will take care of creating and deleting it.

From the docs[1]: "In case of RuntimeDirectory= the innermost subdirectories are removed when the unit is stopped.".

Allow init to delete such directories, otherwise the following definition is not enough:

type foo_var_run_t;
files_base_file(foo_var_run_t)
init_daemon_run_dir(foo_var_run_t, "foo")

Right now there are no issues because management permissions are granted to init via files_pid_file(foo_var_run_t) which is commonly used.

[1] https://www.freedesktop.org/software/systemd/man/255/systemd.exec.html#RuntimeDirectory=

When a service specifies a runtime directory in its systemd service
file with the `RuntimeDirectory=` property, systemd will take care of
creating and deleting it.

From the docs[1]: "In case of RuntimeDirectory= the innermost subdirectories
are removed when the unit is stopped.".

Allow init to delete such directories, otherwise the following definition
is not enough:
```
type foo_var_run_t;
files_base_file(foo_var_run_t)
init_daemon_run_dir(foo_var_run_t, "foo")
```

Right now there are no issues because management permissions are granted
to init via `files_pid_file(foo_var_run_t)` which is commonly used.

[1] https://www.freedesktop.org/software/systemd/man/255/systemd.exec.html#RuntimeDirectory=
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.

1 participant