Skip to content

Shouldn't ReadWritePaths= in drop-in be ReadOnlyPaths=? #988

Description

@zwets

As an example, the redis-server.service has the following directives (I have elided the irrelevant ones):

ReadOnlyDirectories=/
ReadWriteDirectories=-/opt/data/redis
ProtectSystem=true

This correctly makes /opt/data/redis writable for the service outside LXC.

However, in LXC the zzz-lxc-service.conf drop-in clears ReadWritePaths=. As a consequence /opt/data/redis is now subject to ReadOnlyDirectories=/, hence not writable.

This appears to be the inverse of what the drop-in is intended to do. Whereas it overrides all Protect* directives, thus defaulting to writable paths, it clears (i.e. makes read-only) the paths that the service explicitly needs to be writable.

Changing line 109 in lxc.generator to:

        [ "${SYSTEMD}" -ge 231 ] && echo "ReadWritePaths=" && echo "ReadOnlyPaths=";

... fixes the issue, but:

        [ "${SYSTEMD}" -ge 231 ] && echo "ReadOnlyPaths=";

... is perhaps closer to the actual intention?

Cheers
Marco

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions