[systemd-devel] [PATCH 1/1] Ensure that /run/systemd/network exists

Lennart Poettering lennart at poettering.net
Wed May 27 09:33:29 PDT 2015


On Wed, 27.05.15 15:30, Peter Lemenkov (lemenkov at gmail.com) wrote:

> This directory is used for storing transient/generated network service
> files. Unfortunately it doesn't generated during systemd-networkd
> startup. Let's fix that.

Hmm, how did you generate these network files?

Why not make the tool you used create the dirs on its own?

> ---
>  src/network/networkd.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/network/networkd.c b/src/network/networkd.c
> index 543a4e4..a98855f 100644
> --- a/src/network/networkd.c
> +++ b/src/network/networkd.c
> @@ -67,6 +67,9 @@ int main(int argc, char *argv[]) {
>          if (r < 0)
>                  log_warning_errno(r, "Could not create runtime directory 'lldp': %m");
>  
> +        /* Create a directory for the generated transient network services */
> +        mkdir_p("/run/systemd/network", 0755);
> +
>          r = drop_privileges(uid, gid,
>                              (1ULL << CAP_NET_ADMIN) |
>                              (1ULL << CAP_NET_BIND_SERVICE) |
> -- 
> 2.4.1
> 
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list