Hi Marc,

Sorry for the late reply.

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.

[1]

*--- a/debian/rules*

*+++ b/debian/rules*

@@ -9,8 +9,8 @@ override_dh_auto_clean:

        rm -f atop atopsar



 override_dh_installinit:

-       dh_installinit --name=atopacct

        dh_installinit --name=atop

+       dh_installinit --name=atopacct

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.

[2] Some segments of the diff of these two branches' compilation process
(log-from-bytedance-branch v.s. log-from-debian-branch)
  make[2]: Leaving directory '/root/fei-gitcode/atop'
                |  make[2]: Leaving directory '/root/fei-gitcode/
*debian-atop-github/*atop'

  cp atop.service debian/atop.service
                |  cp atop.service debian/atop.service


  cp atop.default debian/atop.default
                |
-----------------------------------------------------------------------------------------

  cp atopacct.service debian/atopacct.service
                |  cp atopacct.service debian/atopacct.service


  cp atop.init debian/atop.init
                |  cp atop.init debian/atop.init


  cp atopacct.init debian/atopacct.init
                |  cp atopacct.init debian/atopacct.init


  make[1]: Leaving directory '/root/fei-gitcode/atop'
                |  make[1]: Leaving directory '/root/fei-gitcode/
*debian-atop-github/*atop'

     dh_install
                |     dh_install


     dh_installdocs
                |     dh_installdocs


     dh_installchangelogs
                |     dh_installchangelogs


     dh_installman
                |     dh_installman


     dh_*systemd_enable*
                  |     dh_*installcron*


     debian/rules override_dh_installinit
                |     debian/rules override_dh_installinit


  make[1]: Entering directory '/root/fei-gitcode/atop'
                |  make[1]: Entering directory '/root/fei-gitcode/
*debian-atop-github/*atop'

  dh_installinit --name=atop
                |  dh_installinit --name=atop


  dh_installinit --name=atopacct
                |  dh_installinit --name=atopacct


  make[1]: Leaving directory '/root/fei-gitcode/atop'
                |  make[1]: Leaving directory '/root/fei-gitcode/
*debian-atop-github/*atop'

     dh_*systemd_start*
                  |     dh_*installsystemd*


     dh_perl
                |     dh_perl


     dh_link
                |     dh_link


     dh_strip_nondeterminism
                |     dh_strip_nondeterminism


     dh_compress
                |     dh_compress


     dh_fixperms
                |     dh_fixperms


     dh_missing
                |     dh_missing



-----------------------------------------------------------------------------------------
|     dh_dwz


     dh_strip
                |     dh_strip


     dh_makeshlibs
                |     dh_makeshlibs


     dh_shlibdeps
                |     dh_shlibdeps


     dh_installdeb
                |     dh_installdeb


     dh_gencontrol
                |     dh_gencontrol


     dh_md5sums
                |     dh_md5sums


     dh_builddeb
                |     dh_builddeb


  dpkg-deb: building package 'atop' in '../atop_2.6.0*+byted3*_amd64.deb'.
                |  dpkg-deb: building package 'atop' in
'../atop_2.6.0*-1*_amd64.deb'.


  dpkg-deb: building package 'atop-dbgsym' in
'../atop-dbgsym_2.6.0*+byted3*_amd64.deb'.
    |  dpkg-deb: building package 'atop-dbgsym' in
'../atop-dbgsym_2.6.0*-1*_amd64.deb'.


   dpkg-genbuildinfo
                |   dpkg-genbuildinfo


   dpkg-genchanges  >../atop_2.6.0*+byted3*_amd64.changes
                  |   dpkg-genchanges  >../atop_2.6.0*-1*_amd64.changes


  dpkg-genchanges: info: including full source code in upload
                |  dpkg-genchanges: info: including full source code in
upload

   dpkg-source --after-build .
                |   dpkg-source --after-build .



-----------------------------------------------------------------------------------------
|  dpkg-source: info: using options from atop/debian/source/local-options:
--unapply-patches


-----------------------------------------------------------------------------------------
|  dpkg-source: warning: --unapply-patches is not a valid option for
Dpkg::Source::Package::

  dpkg-buildpackage: info: full upload; Debian-native package (full source
is included)    |  dpkg-buildpackage: info: full upload; Debian-native
package (full source is included)

log-bytedance
                        *log-debian
                                         *


Have a nice day, thanks
Fei


On Mon, Dec 20, 2021 at 4:03 AM Marc Haber <mh+debian-packa...@zugschlus.de>
wrote:

> On Sun, Nov 28, 2021 at 09:44:11PM +0100, Marc Haber wrote:
> > I apologize, but I don't see the problem here:
> >
> > [15/4605]mh@testsid85:~ $ sudo apt install atop
> > Reading package lists... Done
> > Building dependency tree... Done
> > Reading state information... Done
> > The following NEW packages will be installed:
> >   atop
> > 0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
> > Need to get 201 kB of archives.
> > After this operation, 511 kB of additional disk space will be used.
> > Get:1 http://debian.debian.zugschlus.de/debian sid/main amd64 atop
> amd64 2.6.0-2 [201 kB]
> > Fetched 201 kB in 0s (1.836 kB/s)
> > Selecting previously unselected package atop.
> > (Reading database ... 32406 files and directories currently installed.)
> > Preparing to unpack .../atop_2.6.0-2_amd64.deb ...
> > Unpacking atop (2.6.0-2) ...
> > Setting up atop (2.6.0-2) ...
> > Created symlink
> /etc/systemd/system/timers.target.wants/atop-rotate.timer →
> /lib/systemd/system/atop-rotate.timer.
> > Created symlink /etc/systemd/system/multi-user.target.wants/atop.service
> → /lib/systemd/system/atop.service.
> > Created symlink
> /etc/systemd/system/multi-user.target.wants/atopacct.service →
> /lib/systemd/system/atopacct.service.
> > atop-rotate.service is a disabled or a static unit, not starting it.
> > Processing triggers for man-db (2.9.4-2) ...
> > [16/4606]mh@testsid85:~ $ sudo ls -la /proc/$(pgrep '^atop$')/fd
> /proc/$(pgrep '^atopacctd$')/fd
> > /proc/43189/fd:
> > total 0
> > dr-x------ 2 root root  0 Nov 28 21:40 .
> > dr-xr-xr-x 9 root root  0 Nov 28 21:40 ..
> > lr-x------ 1 root root 64 Nov 28 21:40 0 -> /run/pacct_source
> > l-wx------ 1 root root 64 Nov 28 21:40 1 ->
> /run/pacct_shadow.d/0000000000.paf
> > lrwx------ 1 root root 64 Nov 28 21:40 2 -> 'socket:[219557]'
> > l-wx------ 1 root root 64 Nov 28 21:40 3 -> /run/pacct_shadow.d/current
> > lrwx------ 1 root root 64 Nov 28 21:40 4 -> 'socket:[219561]'
> > lrwx------ 1 root root 64 Nov 28 21:40 5 -> 'socket:[219562]'
> >
> > /proc/43192/fd:
> > total 0
> > dr-x------ 2 root root  0 Nov 28 21:40 .
> > dr-xr-xr-x 9 root root  0 Nov 28 21:40 ..
> > lr-x------ 1 root root 64 Nov 28 21:40 0 -> /dev/null
> > lrwx------ 1 root root 64 Nov 28 21:40 1 -> 'socket:[219563]'
> > lrwx------ 1 root root 64 Nov 28 21:40 2 -> 'socket:[219563]'
> > lr-x------ 1 root root 64 Nov 28 21:40 3 ->
> /run/pacct_shadow.d/0000000000.paf
> > lrwx------ 1 root root 64 Nov 28 21:40 4 -> 'socket:[218991]'
> > l-wx------ 1 root root 64 Nov 28 21:40 5 -> /var/log/atop/atop_20211128
> > [17/4607]mh@testsid85:~ $
> >
> > I see that on my system fds 1 and 2 are a socket while yours are files,
> > and that fd3 is correctly the /run/pacct_shadow.d file.
> >
> > Am I still doing things wrong here?
>
> I still need help to reproduce this part of the issue. If I cannot
> reproduce this by the end of January 2022, I will close this bug.
>
> Greetings
> Marc
>
>
>

Reply via email to