Hi,

On Thu, Nov 25, 2021 at 3:32 AM Marc Haber <mh+debian-packa...@zugschlus.de>
wrote:

> Hi,
>
> On Thu, Nov 11, 2021 at 06:56:33PM +0800, 李菲 wrote:
> > wrote:
> > I guess the below 'Reproduce' can tell this :) That is, if atop starts
> > before
> > atopacctd, it will read from /var/cache/atop.d/atop.acct. Instead, if
> > atopacctd
> > starts earlier, atop will read from /run/pacct_shadow.d/0000000000.paf
> > which is generated by atopacctd.
>
> Is this a race condition that only occurs once in a while? I tried it
> three times now on a test system and all three times it ended up with
> atop reading from the .paf file right after reboot.
>
You mean reboot the machine? I am wondering why rebooting
is needed after installing atop.  I did the following check just
after installing atop without rebooting the machine. :)
As for the reboot, I am inclined to the problem is corrected
after rebooting, mainly due to the "Before=atop.service"
in atopacct.service file.

>
> Example output:
> [2/4438]mh@testsid85:~ $ pgrep '^atop$'; pgrep '^atopacctd$'; sudo ls -la
> /proc/{$(pgrep '^atop$'),$(pgrep '^atopacctd$')}/fd
> 348
> 334
> /proc/334/fd:
> total 0
> dr-x------ 2 root root  0 Nov 24 20:12 .
> dr-xr-xr-x 9 root root  0 Nov 24 20:12 ..
> lr-x------ 1 root root 64 Nov 24 20:12 0 -> /run/pacct_source
> l-wx------ 1 root root 64 Nov 24 20:12 1 ->
> /run/pacct_shadow.d/0000000000.paf
> lrwx------ 1 root root 64 Nov 24 20:12 2 -> 'socket:[12382]'
> l-wx------ 1 root root 64 Nov 24 20:12 3 -> /run/pacct_shadow.d/current
> lrwx------ 1 root root 64 Nov 24 20:12 4 -> 'socket:[12399]'
> lrwx------ 1 root root 64 Nov 24 20:12 5 -> 'socket:[12400]'
>
> /proc/348/fd:
> total 0
> dr-x------ 2 root root  0 Nov 24 20:12 .
> dr-xr-xr-x 9 root root  0 Nov 24 20:12 ..
> lr-x------ 1 root root 64 Nov 24 20:12 0 -> /dev/null
> lrwx------ 1 root root 64 Nov 24 20:12 1 -> 'socket:[12463]'
> lrwx------ 1 root root 64 Nov 24 20:12 2 -> 'socket:[12463]'
> lr-x------ 1 root root 64 Nov 24 20:12 3 ->
> /run/pacct_shadow.d/0000000000.paf
> lrwx------ 1 root root 64 Nov 24 20:12 4 -> 'socket:[12504]'
> lrwx------ 1 root root 64 Nov 24 20:12 5 -> /var/log/atop/atop_20211124
> [3/4439]mh@testsid85:~ $
>
> What am I doing wrong here?
>
> > > > 2nd. Load atop.default file into the package to make it take effect
> > >
> > > The 2.6.0-2 package in sid and bullseye do install a file to
> > > /etc/default/atop. This file is different from the atop.default in the
> > > upstream tarball. Debian does set the -R by default.
> > >
> > > Please explain why you think the packaging does things wrong.
> > >
> > Sorry that I didn't make it clear just now. I'd mean if modifying the
> > atop.default file under the source code, the updates will not be synced
> > into debian/atop.default under debian/ directory during building.
>
> I would still think this is intended behavior. This originates from the
> fact that the support for /etc/default/atop was merged into Upstream
> from a series of Debian patches which the Upstream author kindly
> accepted (PR #28). We had the defaults file for longer than Upstream had
> it, therefore we had our own file.
>
> I see your point though, the next version will take upstream's file,
> apply a patch to make Debian's default file from there and install that
> to the package. That way, Upstream changes are going to be notice, and
> one more patch file doesn't make things any more complex. I have
> committed that change to git.
>
> Greetings
> Marc
>
> Sure, thanks for that. :)

Have a nice day, thanks
Fei

Reply via email to