Many errors in journalctl from Tracker-miner and Pulseaudio

Actual Behaviour:

Very munch errors from Tracker-miner and Pulseaudio appear in journalctl on Ubuntu 20.04.
It seems to be caused by the user pihole linked to a home directory which doesn’t exist.

cat /etc/passwd | grep pihole
pihole:x:991:991::/home/pihole:/usr/sbin/nologin

Errors inside journalctl:

Cannot initialize database: Could not open sqlite3 database:'/home/pihole/.cache/tracker/meta.db': unable to open database file
tracker-store.service: Main process exited, code=exited, status=1/FAILURE
tracker-store.service: Failed with result 'exit-code'.

Failed to create secure directory (/home/pihole/.config/pulse): No such file or directory
Failed to start Sound Service.

In forums, it’s recommended to create a home directory (doesn’t work for me) or disable/remove tracker services.

However, for another system like mysql, ntp …, users are created without a home directory by using --no-create-home --home /nonexistent.

cat /etc/passwd | grep nobody
nobody:x:65531:65531:nobody:/nonexistent:/usr/sbin/nologin

Debug:

  1. Do you believe that it’s possible to add these same options into install script to prevent error in journalctl?
    adduser or useradd don’t seem to produce the same result.
    https://klop.solutions/linux-love-it-hate-it/

  2. For those with this problem, it’s possible to change user’s home directory to /nonexistent?
    usermod -d /nonexistent pihole

Many thanks

I've found an old bug of the user _apt, where a similar fix is apply.

usermod --home /nonexistent _apt

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808802#35

Pi-hole's user is created with a system account, so also without a home directory.

Your second grep is for the nobody pseudo-user, not for the mysql or ntp users.
Could you please provide those as well?

Indeed, I misspoke. The home directory is not created, but for user systems pihole is linked to a dummy directory.

Sorry, it's a mistake. I also added the user _apt.

mysql:x:126:133:MySQL Server,,,:/nonexistent:/bin/false
ntp:x:127:134::/nonexistent:/usr/sbin/nologin
_apt:x:105:65534::/nonexistent:/usr/sbin/nologin

It is linked to an non-existing directory, but that would also apply for /nonexistent.

Run from your Pi-hole host machine, what's the output of the following command:

sudo pwck -r /etc/passwd

You’re right. However I think it’s a special argument that seems more appropriate.

Home directory. If this field is left empty, it will be automatically created by appending the username to the home partition. The /nonexistent home directory is considered special and is understood to mean that no home directory is to be created for the user.

adduser(8)

Output of sudo pwck -r /etc/passwd :

user 'lp': directory '/var/spool/lpd' does not exist
user 'news': directory '/var/spool/news' does not exist
user 'uucp': directory '/var/spool/uucp' does not exist
user 'list': directory '/var/list' does not exist
user 'irc': directory '/var/run/ircd' does not exist
user 'gnats': directory '/var/lib/gnats' does not exist
user 'nobody': directory '/nonexistent' does not exist
pwck: no changes

As far as I can tell, /nonexistent or /var/spool/lpd are just string values.
That would suggest that the former only may gain special meaning by virtue of the software processing that value, i.e. by convention.

And indeed, it would seem that different flavours of Linux behave differently when it comes to non-existing home directories of system users, see e.g.

Pi-hole would have to consider at least the impact on behaviour for its supported OSs. I'll hand this forward to development, and they will decide how to proceed.

Thanks for the heads up. :slight_smile:

Thank you for listening. :slightly_smiling_face:

You can keep us informed of the decision, please.

Just to share, an old Debian bug report about changing nobody’s home directory to /nonexistent.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=135732

To avoid bad uses, I tried to change user home directory to /nonexistent:

usermod -d /nonexistent pihole

Nevertheless errors didn't disappear from the syslog.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.