You are not logged in.

#1 2021-04-02 12:43:02

arnuld
Member
From: INDIA
Registered: 2005-12-19
Posts: 212
Website

[SOLVED] How To Use "pkgstats"

I saw that on List of Applications wiki page that installing pkgstats and sending weekly reports can help Arch Linux developers. So, I just installed the package but when I enable it, I get this message:

[root@arch64 ~]# systemctl status pkgstats.timer
○ pkgstats.timer - Weekly pkgstats submission
     Loaded: loaded (/usr/lib/systemd/system/pkgstats.timer; static)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● pkgstats.service
[root@arch64 ~]# systemctl enable pkgstats.timer
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.
 
Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.

Same message is displayed if I use pkgstats.service. I see this:

[root@arch64 ~]# systemctl list-timers --all
NEXT                        LEFT     LAST                        PASSED       UNIT                         ACTIVATES                     
Sat 2021-04-03 00:00:00 IST 6h left  Fri 2021-04-02 07:08:44 IST 10h ago      man-db.timer                 man-db.service
Sat 2021-04-03 00:00:00 IST 6h left  Fri 2021-04-02 07:08:44 IST 10h ago      shadow.timer                 shadow.service
Sat 2021-04-03 15:10:16 IST 21h left Fri 2021-04-02 15:10:16 IST 2h 46min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
n/a                         n/a      n/a                         n/a          pkgstats.timer               pkgstats.service

4 timers listed.

So what I did is, I edited the file as mentioned systemd/Timers wiki page:

[root@arch64 system]# cat pkgstats.timer
[Unit]
Description=Weekly pkgstats submission

[Timer]
OnCalendar=weekly
AccuracySec=1d
RandomizedDelaySec=3d
Persistent=true

[Install]
WantedBy=timers.target
[root@arch64 system]# 

and now I get this:

[root@arch64 ~]# systemctl list-timers
NEXT                        LEFT          LAST                        PASSED       UNIT                         ACTIVATES                     
Sat 2021-04-03 00:00:00 IST 5h 50min left Fri 2021-04-02 07:08:44 IST 11h ago      man-db.timer                 man-db.service
Sat 2021-04-03 00:00:00 IST 5h 50min left Fri 2021-04-02 07:08:44 IST 11h ago      shadow.timer                 shadow.service
Sat 2021-04-03 15:10:16 IST 21h left      Fri 2021-04-02 15:10:16 IST 2h 59min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Tue 2021-04-06 17:31:28 IST 3 days left   n/a                         n/a          pkgstats.timer               pkgstats.service

4 timers listed.

....

Is this the correct way?

Last edited by arnuld (2021-04-06 16:45:18)

Offline

#2 2021-04-02 13:00:33

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] How To Use "pkgstats"

https://wiki.archlinux.org/index.php/Pkgstats wrote:

pkgstats is set up to automatically run every week using systemd/Timers. Once installed, it will be activated after the next reboot.

If you look at the files inside the package, you'll notice it lists usr/lib/systemd/system/timers.target.wants/pkgstats.timer .
That file is what takes care of the automatic starting to avoid users having to enable it themselves .

The judgment whether that is a good or a bad thing is left to the reader.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2021-04-02 13:54:12

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: [SOLVED] How To Use "pkgstats"

Lone_Wolf wrote:

The judgment whether that is a good or a bad thing is left to the reader.

It has raised an eyebrow more than once, that some packages on Arch now activate timers (and services?) automatically. Something something Arch Way, something something full control. The only hint that this happens is a "(1/2) Reloading system manager configuration...". I'd probably prefer to have a more verbose output, but I haven't put much thought into it so far and I'm not certain if it's worth the effort to convince people.

Offline

#4 2021-04-03 06:06:06

arnuld
Member
From: INDIA
Registered: 2005-12-19
Posts: 212
Website

Re: [SOLVED] How To Use "pkgstats"

Lone_Wolf wrote:

If you look at the files inside the package, you'll notice it lists usr/lib/systemd/system/timers.target.wants/pkgstats.timer .
That file is what takes care of the automatic starting to avoid users having to enable it themselves .

The judgment whether that is a good or a bad thing is left to the reader.


Hmm... then I will remove the lines I added and let it run on its own. Will check the output of systemctl list-timers for a few days.

UPDATE: After checking it for 4 days, it's all working fine. Thanks Lone_Wolf

Last edited by arnuld (2021-04-06 16:45:03)

Offline

#5 2021-04-07 05:13:49

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] How To Use "pkgstats"

Awebb wrote:
Lone_Wolf wrote:

The judgment whether that is a good or a bad thing is left to the reader.

It has raised an eyebrow more than once, that some packages on Arch now activate timers (and services?) automatically. Something something Arch Way, something something full control. The only hint that this happens is a "(1/2) Reloading system manager configuration...". I'd probably prefer to have a more verbose output, but I haven't put much thought into it so far and I'm not certain if it's worth the effort to convince people.

https://bugs.archlinux.org/task/51510


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#6 2021-04-07 11:11:38

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] How To Use "pkgstats"

Thank you for finding and reopening the bug, eschwartz.
I'm watching that bug now and also voted for it.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2021-04-07 20:54:21

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: [SOLVED] How To Use "pkgstats"

Great! I'll watch the bug report then.

Offline

Board footer

Powered by FluxBB