-
-
Notifications
You must be signed in to change notification settings - Fork 144
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 options to manage file system access options to Service #445
base: master
Are you sure you want to change the base?
Conversation
Added in version 231, systemd provides options to manage file system access options to processes executed by systemd services. Adding these as valid options. See https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#ReadWritePaths= for docs.
REFERENCE.md
Outdated
@@ -2753,6 +2753,11 @@ Struct[{ | |||
Optional['ProtectHome'] => Variant[Boolean, Enum['read-only', 'tmpfs']], | |||
Optional['BindPaths'] => Variant[Stdlib::Unixpath,Pattern[/-\/.+/], Array[Variant[Stdlib::Unixpath,Pattern[/-\/.+/]],1]], | |||
Optional['BindReadOnlyPaths'] => Variant[Stdlib::Unixpath,Pattern[/-\/.+/], Array[Variant[Stdlib::Unixpath,Pattern[/-\/.+/]],1]], | |||
Optional['ReadWritePaths'] => Variant[Stdlib::Unixpath,Pattern[/-\/.+/], Array[Variant[Stdlib::Unixpath,Pattern[/-\/.+/]],1]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional['ReadWritePaths'] => Variant[Stdlib::Unixpath,Pattern[/-\/.+/], Array[Variant[Stdlib::Unixpath,Pattern[/-\/.+/]],1]], | |
Optional['ReadWritePaths'] => Variant[Stdlib::Unixpath,Pattern[/^-\/.+/], Array[Variant[Stdlib::Unixpath,Pattern[/^-\/.+/]],1]], |
and similar. The -
is always at the start.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I updated the regular expression to accommodate this (from the systemd docs):
Paths in ReadWritePaths=, ReadOnlyPaths=, InaccessiblePaths=, ExecPaths= and NoExecPaths= may be prefixed with "-", in which case they will be ignored when they do not exist. If prefixed with "+" the paths are taken relative to the root directory of the unit, as configured with RootDirectory=/RootImage=, instead of relative to the root directory of the host (see above). When combining "-" and "+" on the same path make sure to specify "-" first, and "+" second.
Tested thus: https://rubular.com/r/oATb23JSEuE0MX
Could you add a few examples and counter examples to - https://github.com/voxpupuli/puppet-systemd/blob/master/spec/type_aliases/systemd_unit_service_spec.rb |
Add options to manage file system access options to Service
Added in version 231, systemd provides options to manage file system access options to processes executed by systemd services. Adding these as valid options.
See https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#ReadWritePaths= for docs.
This Pull Request (PR) fixes the following issues
n/a