Re: Error in the systemd scriptlet snippets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/30/2013 01:08 PM, Aurélien Bompard wrote:
Hi packagers,

I just realized there's a mistake in the ScriptletsSnippets page about
the new systemd macros:
https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Macroized_scriptlets_.28Fedora_18.2B.29

The page asks to add "Requires: systemd", but the macros are actually
expanded at build time and not at run time, thus it should simply be a
single "BuildRequires: systemd" line.

Example of the scriptlets when built without systemd:

# rpm -q --scripts mailman3
preinstall scriptlet (using /bin/sh):
[...]
postinstall scriptlet (using /bin/sh):
%systemd_post mailman3.service
preuninstall scriptlet (using /bin/sh):
%systemd_preun mailman3.service
postuninstall scriptlet (using /bin/sh):
%systemd_postun_with_restart mailman3.service

And I install time I get:

/var/tmp/rpm-tmp.FtLPUV: line 1: fg: no job control
warning: %post(mailman3-3.0.0-0.6.bzr7218.fc19.noarch) scriptlet failed,
exit status 1
Non-fatal POSTIN scriptlet failure in rpm package
mailman3-3.0.0-0.6.bzr7218.fc19.noarch

obviously because the "%" sign is interpreted as the job control command.
When built with systemd, the scriptlets look correct:

$ rpm -qp --scripts mailman3-3.0.0-0.6.bzr7220.fc19.noarch.rpm
preinstall scriptlet (using /bin/sh):
[...]
postinstall scriptlet (using /bin/sh):
if [ $1 -eq 1 ] ; then
         # Initial installation
         /usr/bin/systemctl preset mailman3.service >/dev/null 2>&1 || :
fi
preuninstall scriptlet (using /bin/sh):
[...] (expanded too)
postuninstall scriptlet (using /bin/sh):
[...] (expanded too)

This is on F19. Can you confirm that the wiki page should be fixed?
Thanks.

Aurélien

I asked systemd maintainers and the correct solution is BuildRequire systemd all the time you are using their macros. They should probably go through packages and verify it's fixed everywhere, because it changed few months ago.

I answered to myself in this ticket [1]. Sadly no-one replied to me and didn't fix it in guidelines.

[1] https://fedorahosted.org/fpc/ticket/318

Marcela
--
packaging mailing list
packaging@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/packaging





[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux