updatedb is not running on Mageia 9

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

updatedb is not running on Mageia 9

Postby banjo » Jun 25th, '24, 01:47

On my Mageia 9 system it looks like updatedb is not running each day. I used "locate" to find a folder that I know is there, and locate came up with nothing.

So I dug down a bit to see if the database is being updated.

Code: Select all
[brian@linux8corem9 lib]$ cd /var/lib/plocate
[brian@linux8corem9 plocate]$ ll
total 15476
-rw-r--r-- 1 root root         183 Jun 10  2023 CACHEDIR.TAG
-rw-r----- 1 root plocate 15843213 Jun 13 13:22 plocate.db


Back in mid June I ran updatedb manually to force an update after changing the file structure a bit, and it looks as though the database has not been updated since then.

I have not done any configuration changes on this part of the system. Here is the systemd timer plocate-updatedb.timer in /usr/lib/systemd/system.

Code: Select all
[Unit]
Description=Update the plocate database daily

[Timer]
OnCalendar=daily
RandomizedDelaySec=12h
AccuracySec=20min
Persistent=true

[Install]
WantedBy=timers.target


What am I missing? Do I have to enable this somewhere?

Thanks
Banjo
(_)=='=~
If only the best bird sang, the forest would be a very quiet place.
User avatar
banjo
 
Posts: 476
Joined: May 4th, '11, 03:50
Location: Reading, Massachusetts

Re: updatedb is not running on Mageia 9

Postby banjo » Jun 25th, '24, 04:35

I dumped out the status of the timer.

Code: Select all
$ systemctl status plocate-updatedb.timer
○ plocate-updatedb.timer - Update the plocate database daily
     Loaded: loaded (/usr/lib/systemd/system/plocate-updatedb.timer; disabled; preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● plocate-updatedb.service


I am not sure how to read the output. Is it disabled, or enabled? What does "preset" mean?

I looked it up. Evidently "preset" means that the service is enabled on installation. However, the status output says that the timer is disabled.

So, on a whim, I enabled it.

Code: Select all
root@linux8corem9:/usr/lib/systemd/system# systemctl status plocate-updatedb.timer
○ plocate-updatedb.timer - Update the plocate database daily
     Loaded: loaded (/usr/lib/systemd/system/plocate-updatedb.timer; disabled; preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● plocate-updatedb.service
root@linux8corem9:/usr/lib/systemd/system# systemctl enable plocate-updatedb.timer
Created symlink /etc/systemd/system/timers.target.wants/plocate-updatedb.timer → /usr/lib/systemd/system/plocate-updatedb.timer.
root@linux8corem9:/usr/lib/systemd/system# systemctl status plocate-updatedb.timer
○ plocate-updatedb.timer - Update the plocate database daily
     Loaded: loaded (/usr/lib/systemd/system/plocate-updatedb.timer; enabled; preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● plocate-updatedb.service


We will see what happens tomorrow.
If only the best bird sang, the forest would be a very quiet place.
User avatar
banjo
 
Posts: 476
Joined: May 4th, '11, 03:50
Location: Reading, Massachusetts

Re: updatedb is not running on Mageia 9

Postby doktor5000 » Jun 25th, '24, 17:43

FWIW with systemd timers you want the output of
Code: Select all
systemctl list-timers
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18045
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: updatedb is not running on Mageia 9

Postby banjo » Jun 25th, '24, 21:14

Code: Select all
[brian@linux8corem9 ~]$ systemctl list-timers
NEXT                        LEFT     LAST                        PASSED       UNIT                         ACTIVATES                     
Wed 2024-06-26 06:03:15 EDT 14h left -                           -            plocate-updatedb.timer       plocate-updatedb.service
Wed 2024-06-26 11:43:51 EDT 20h left Tue 2024-06-25 11:43:51 EDT 3h 27min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service

2 timers listed.
Pass --all to see loaded but inactive timers, too.
[brian@linux8corem9 ~]$


It is now listed as active, but that is after I enabled it myself a few hours ago.

My question is why this was not enabled by default. That has always been the case in other releases.
If only the best bird sang, the forest would be a very quiet place.
User avatar
banjo
 
Posts: 476
Joined: May 4th, '11, 03:50
Location: Reading, Massachusetts

Re: updatedb is not running on Mageia 9

Postby doktor5000 » Jun 26th, '24, 00:17

Is that a fresh mga9 install or an upgrade ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18045
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: updatedb is not running on Mageia 9

Postby banjo » Jun 26th, '24, 02:23

This is a fresh installation on a new, blank disk.
If only the best bird sang, the forest would be a very quiet place.
User avatar
banjo
 
Posts: 476
Joined: May 4th, '11, 03:50
Location: Reading, Massachusetts

Re: updatedb is not running on Mageia 9

Postby banjo » Jun 26th, '24, 13:35

Interesting outcome this morning. According to my last query about the timers, plocate-updatedb.timer was supposed to run at Wed 2024-06-26 06:03:15.

After I booted this morning (and left it running for a few minutes to allow it to catch up), I checked it.

Code: Select all
[brian@linux8corem9 ~]$ systemctl list-timers
NEXT                        LEFT     LAST                        PASSED    UNIT                         ACTIVATES                     
Wed 2024-06-26 17:41:45 EDT 10h left Tue 2024-06-25 11:28:13 EDT 19h ago   plocate-updatedb.timer       plocate-updatedb.service
Thu 2024-06-27 07:03:38 EDT 23h left Wed 2024-06-26 07:03:38 EDT 11min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service

2 timers listed.
Pass --all to see loaded but inactive timers, too.
[brian@linux8corem9 ~]$ cd /var/lib/plocate
[brian@linux8corem9 plocate]$ ll
total 15476
-rw-r--r-- 1 root root         183 Jun 10  2023 CACHEDIR.TAG
-rw-r----- 1 root plocate 15843213 Jun 13 13:22 plocate.db
[brian@linux8corem9 plocate]$ systemctl status plocate-updatedb.timer
● plocate-updatedb.timer - Update the plocate database daily
     Loaded: loaded (/usr/lib/systemd/system/plocate-updatedb.timer; enabled; preset: enabled)
     Active: active (waiting) since Wed 2024-06-26 06:48:42 EDT; 29min ago
    Trigger: Wed 2024-06-26 17:41:45 EDT; 10h left
   Triggers: ● plocate-updatedb.service

Warning: some journal files were not opened due to insufficient permissions.
[brian@linux8corem9 plocate]$


According to the list-timers output, it appears that it thinks that it ran last night, and its next run is this evening.

And yet the status report says that it is waiting since Wed 2024-06-26 06:48:42 EDT; 29min ago.

However, the database has not been updated.

I must be missing something because I find this confusing.

Perhaps systemd needs to trigger this a couple of times in order to get its timestamps in order.
If only the best bird sang, the forest would be a very quiet place.
User avatar
banjo
 
Posts: 476
Joined: May 4th, '11, 03:50
Location: Reading, Massachusetts

Re: updatedb is not running on Mageia 9

Postby doktor5000 » Jun 26th, '24, 22:55

Just found this: https://bugs.mageia.org/show_bug.cgi?id=30820
So it should be enabled by default and working, have to recheck when I'm back at my mga9 box.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18045
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: updatedb is not running on Mageia 9

Postby doktor5000 » Jun 26th, '24, 23:36

This is strange, just checked on my mga9 box which is a fresh install.

Code: Select all
[doktor5000@Mageia9]─[23:27:27]─[~] sudo systemctl list-timers
NEXT                         LEFT       LAST PASSED UNIT                         ACTIVATES                     
Wed 2024-06-26 23:38:58 CEST 11min left -    -      dnf-makecache.timer          dnf-makecache.service
Wed 2024-06-26 23:40:49 CEST 13min left -    -      systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service


plocate is nowhere to be seen. Although it should be present and it's also enabled by default from the preset:

Code: Select all
/usr/lib/systemd/system-preset/90-default.preset:enable plocate-updatedb.timer


timer is disabled although I've never disabled it:

Code: Select all
[doktor5000@Mageia9]─[23:31:59]─[~] sudo systemctl status plocate-updatedb.timer
○ plocate-updatedb.timer - Update the plocate database daily
     Loaded: loaded (/usr/lib/systemd/system/plocate-updatedb.timer; disabled; preset: enabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● plocate-updatedb.service


Initial install of the package should also have started it once:

Code: Select all
[doktor5000@Mageia9]─[23:33:53]─[~] rpm -q --scripts --triggers plocate
[...]
posttrans scriptlet (using /bin/sh):
# The timer runs once per day. On new installs, let's start both the
# timer and the service immediately in the background, so that the db
# becomes populated. When people install this package onto a running
# system, it's reasonable to assume that they want to use the database.
if [ -f /var/lib/rpm-state/plocate_start_now ]; then
   rm /var/lib/rpm-state/plocate_start_now || :
   if systemctl is-enabled plocate-updatedb.timer &>/dev/null; then
      systemctl start --no-block plocate-updatedb.timer plocate-updatedb.service || :
   fi
fi
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18045
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: updatedb is not running on Mageia 9

Postby banjo » Jun 27th, '24, 02:17

After enabling the timer, my datebase did finally catch up and update itself.

Code: Select all
[brian@linux8corem9 plocate]$ pwd
/var/lib/plocate
[brian@linux8corem9 plocate]$ ll
total 20280
-rw-r--r-- 1 root root         183 Jun 10  2023 CACHEDIR.TAG
-rw-r----- 1 root plocate 20761888 Jun 26 17:42 plocate.db
[brian@linux8corem9 plocate]$ systemctl list-timers
NEXT                        LEFT     LAST                        PASSED       UNIT                         ACTIVATES                     
Thu 2024-06-27 06:03:38 EDT 9h left  Wed 2024-06-26 17:42:13 EDT 2h 32min ago plocate-updatedb.timer       plocate-updatedb.service
Thu 2024-06-27 07:03:38 EDT 10h left Wed 2024-06-26 07:03:38 EDT 13h ago      systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service

2 timers listed.
Pass --all to see loaded but inactive timers, too.
[brian@linux8corem9 plocate]$
If only the best bird sang, the forest would be a very quiet place.
User avatar
banjo
 
Posts: 476
Joined: May 4th, '11, 03:50
Location: Reading, Massachusetts


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron