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

Dimitri John Ledkov dimitri.j.ledkov at intel.com
Wed Jan 21 01:47:23 PST 2015


On 21 January 2015 at 07:27, Martin Pitt <martin.pitt at ubuntu.com> wrote:
> Martin Pitt [2015-01-20 17:44 +0100]:
>> 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.
>
> Reworked the patch to apply to current master (where the
> sysv-generator test suite now landed), drop the log_debug() leftover,
> and clean up the tests.
>
> Note that Michael points out some more problems with the Provides:
> alias handling ([1], [2]); I'll work on those next, but this is
> already a self-contained and urgent fix, so I think it's good to push.
>

I've also been bitten by generators defaulting to "do not override
file with same name" when writing out actual unit with contents.
There should not be any masked units inside generator/ generator.late/
directories and thus if a file already exists and is empty / broken
symlink it should be force overwritten.
no?

-- 
Regards,

Dimitri.

Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.


More information about the systemd-devel mailing list