Hi,

On Thu, Dec 23, 2021 at 05:31:25PM +0800, 李菲 wrote:
> Yes, this is weird.
> - When I run `dpkg-buildpackage -us -uc` using code from
> https://salsa.debian.org/debian/atop/-/tree/debian/2.6.0-1,
> atopacct service do run earlier than atop. The issue gone.
> - When I run `dpkg-buildpackage -us -uc` using code from
> https://github.com/bytedance/atop/tree/bytedance-internal-v2.6.0+byted3,
> and *revert the execution order of override_dh_installinit[1] in
> debian/rules*, atop service do run earlier than atopacct. The issue exists.

Can you compare the /var/lib/dpkg/info/atop.postinst scripts from both
compilation runs?

You will find two stanzas of "Automatically added by
dh_installinit/13.3.3" which are relevant only for systems without
systemd as PID 1, and three stanzas of "Automatically added by
dh_installsystemd/13.3.3". The last one of those is resonsible to start
the daemon after installation. The interesting line of code is

deb-systemd-invoke $_dh_action 'atop-rotate.service' 'atop-rotate.timer' 
'atop.service' 'atopacct.service

which will instruct systemd to start all those four services. I am not
sure whether it makes sense for atop to explicitly start the two
atop-rotate units, and I think that systemd decides by itself in which
order the units are started.

I will talk to Upstream whether it makes sense to specify a dependency
in the systemd units.

> I tried to compare with these two branches' compilation process[2], but not
> quite sure which command guarantees atopacct run eariler then atop. Could
> you help to confirm? Thanks.

I think that at the moment htere is no guarantee, and that the patch of
exchanging the two calls to dh_installinit is not going to change
anything since the generated code is not used on a systemd system.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

Reply via email to