[systemd-devel] [PATCH] install: Assume *.wants symlinks have the same name as their target for scalability.

Andrey Borzenkov arvidjaar at gmail.com
Wed Dec 11 20:36:23 PST 2013


В Wed, 11 Dec 2013 15:54:39 -0800
david at davidstrauss.net пишет:

> From: David Strauss <david at davidstrauss.net>
> 
> ---
>  src/shared/install.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/shared/install.c b/src/shared/install.c
> index 17e8a75..14c0f4b 100644
> --- a/src/shared/install.c
> +++ b/src/shared/install.c
> @@ -423,6 +423,11 @@ static int find_symlinks_fd(
>                          bool found_path, found_dest, b = false;
>                          int q;
>  
> +                        /* Skip symlinks with a different basename than
> +                         * the target unit */
> +                        if (!streq(basename(de->d_name), name))
> +                                continue;
> +

This completely changes semantic of what it does. In this case no
symlink is needed in the first place - just
"touch .../unit.wants/other.unit" would be enough, as long as we assume
units can only be located in standard config paths.

>                          /* Acquire symlink name */
>                          p = path_make_absolute(de->d_name, path);
>                          if (!p)



More information about the systemd-devel mailing list