rpm-software-management / rpmlint

Tool for checking common errors in rpm packages
GNU General Public License v2.0
129 stars 116 forks source link

E: systemd-service-without-service_del_postun triggered improperly #1188

Closed FilippoBonazziSUSE closed 5 months ago

FilippoBonazziSUSE commented 5 months ago

I have this rpmlint error in a package:

[   71s] greetd.x86_64: E: systemd-service-without-service_del_postun greetd.service
[   71s] The package contains a systemd service but doesn't contain a %postun with a
[   71s] call to service_del_postun.

However the spec file contains:

%postun
%service_del_postun_without_restart %{name}.service

So it looks to me like the error should not be triggered.

danigm commented 5 months ago

The check is looking for the systemd-update-helper mark-restart-system-units .* regex in the postun script and in this package I can see that the macro %service_del_postun_without_restart expands to '\n \n:'. It's something that we should accept in this check?

FilippoBonazziSUSE commented 5 months ago

the macro %service_del_postun_without_restart expands to '\n \n:'.

I hadn't realized that. Why does it expand to that? What does the regular %service_del_postun expand to instead?

It's something that we should accept in this check?

If using the %service_del_postun_without_restart macro in place of %service_del_postun is valid, we should accept it.

danigm commented 5 months ago

It's in the systemd-rpm-macros pacakge, so I think it's something valid. The documentation says that it's okay to use this macro:

During package update, %service_del_postun restarts units. If units are not to be restarted, %service_del_postun_without_restart should be used instead.

So as far as I know, we should allow it.

danigm commented 5 months ago

Fixed by https://github.com/rpm-software-management/rpmlint/pull/1189