[systemd-devel] [PATCH] sysv-generator: Handle .sh suffixes when translating Provides:

Lennart Poettering lennart at poettering.net
Tue Jan 27 14:09:36 PST 2015


On Tue, 20.01.15 17:44, Martin Pitt (martin.pitt at ubuntu.com) wrote:

> Hey all,
> 
> the recent fix for sysv-generator's Provides: handling [1] caused, or
> rather uncovered, another bug which now creates symlinks to itself
> "foo.service -> foo.service" for any /etc/init.d/foo.sh.
> 
> The generator would output an error message like
> 
>   Failed to create unit file <path...>/foo.service: File exists
> 
> instead of creating the actual foo.service file. I. e. this completely
> breaks translating init scripts with .sh.

Hmm, we already had code that checks this in place, didn#t we?

I mean sysv_translate_facility() already filters out the case where
the service name is identical to the provided name. Hence, why do you
need a second check for this?

I think your patch tapes over a bug somewhere else.

I wonder if the simple fix could just be to change this:

        } else if (filename && streq(name, filename))

to this

        } else if (filename && streq(n, filename))

Or so, in that function?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list