Re: We want to stop systemd from being added to docker images, because of rpm requiring systemctl.

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

 



On 04/30/2014 04:24 PM, Daniel J Walsh wrote:
> On 04/30/2014 10:05 AM, Kalev Lember wrote:
>> For example, when a package bar has a postinstall script that does:
>>
>>     systemctl enable bar.service >/dev/null 2>&1 || :
>>
>> .. but if systemctl gets installed _after_ foo in the same transaction,
>> then the systemctl command never runs and service stays disabled.
>>
>>
> Well you are never supposed to do this.  You are only supposed to do a
> systemctl reload bar in a post install.

No, pretty much all packages that install systemd unit files run either
'systemctl enable' or 'systemd preset' in %post. The latter is just
'systemd enable' wrapped in layer of indirection, that depending on
installed configuration either enables or disables the unit file.

The macro that systemd ships for postinstall and packages are supposed
to run, is %systemd_post. That expands to a 'systemctl enable' equivalent:

$ rpm -E %systemd_post

if [ $1 -eq 1 ] ; then
        # Initial installation
        /usr/bin/systemctl preset  >/dev/null 2>&1 || :
fi


> Any package that does do an enable, should require systemd, as they
> are probably not candidates to run in a container.

Right. And enable ~= %systemd_post, which is why packages that use this
macro currently have Requires(post) on systemd.

-- 
Kalev
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux