Bug 1086804 - fonts-config warns about ninitialized HOME in posttrans
fonts-config warns about ninitialized HOME in posttrans
Status: NEW
: 1124118 (view as bug list)
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Simon Lees
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-26 08:35 UTC by Thorsten Kukuk
Modified: 2019-03-16 20:53 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thorsten Kukuk 2018-03-26 08:35:39 UTC
After the last update I saw the following error message in the log files:

# 2018-03-24 01:14:52 Output of fonts-config-20160921-3.1.noarch.rpm %posttrans script:
#     Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at /usr/sbin/fonts-config line 391.


And yes, HOME was of course not set.
Comment 1 Marguerite Su 2019-02-07 16:33:49 UTC
*** Bug 1124118 has been marked as a duplicate of this bug. ***
Comment 2 Marguerite Su 2019-02-23 04:43:13 UTC
Hi, Thorsten,

can you please tell which package triggered this error?

I installed latest fonts-config in a clean environment, and I can't reproduce this error.

Marguerite
Comment 3 Thorsten Kukuk 2019-02-27 08:41:42 UTC
(In reply to Marguerite Su from comment #2)
> Hi, Thorsten,
> 
> can you please tell which package triggered this error?
> 
> I installed latest fonts-config in a clean environment, and I can't
> reproduce this error.

Most likely you had an HOME variable set? Which is the default if you run it from a shell, but not if the run was triggered by something like a systemd service.

To reproduce, unset the HOME environment variable, that should be the easiest way. Else write a systemd service, which updates or runs fonts-config.
Comment 4 Marguerite Su 2019-03-16 03:13:51 UTC
Hi, Thorsten,

Yes, I have HOME env set.

I mean, if HOME is set under all cases that triggering fonts-config user config, it can be safely ignored. 

HOME is used to run fonts-config user config. user config means there has to be a user. if there's a user, there's a HOME.

I am curious how we can have a user without HOME. 

The error message you provided is of course not fake. So I want to examine the service (maybe) to make sure we do have a user without HOME in some situations.
Comment 5 Thorsten Kukuk 2019-03-16 06:20:47 UTC
(In reply to Marguerite Su from comment #4)

> The error message you provided is of course not fake. So I want to examine
> the service (maybe) to make sure we do have a user without HOME in some
> situations.

This usual happens, if you do automatic updates from a systemd service, e.g. a timer.
systemd service is calling directly zypper up/dup, which installs the RPM, which runs fontsäconfig in the post-install.
Or systemd service is calling a script, which calls zypper, ...

Or something like salt is calling zypper.

Or you boot by DVD to update the system with YaST.

So every time zypper is not called by an user/admin on the commandline, there is no HOME set.
Comment 6 Marguerite Su 2019-03-16 11:09:29 UTC
(In reply to Thorsten Kukuk from comment #5)
> (In reply to Marguerite Su from comment #4)
> This usual happens, if you do automatic updates from a systemd service, e.g.
> a timer.
> systemd service is calling directly zypper up/dup, which installs the RPM,
> which runs fontsäconfig in the post-install.
> Or systemd service is calling a script, which calls zypper, ...
> 
> Or something like salt is calling zypper.
> 
> Or you boot by DVD to update the system with YaST.
> 
> So every time zypper is not called by an user/admin on the commandline,
> there is no HOME set.

Ha,

I understand zypper can be called by anything, but zypper and fonts-config
are tied up via fontpackages’s %reconfigure_fonts macro, which calls 
“fonts-config -quiet”, that is system mode not user mode, HOME stuff shouldn’t 
be called at all.
Comment 7 Thorsten Kukuk 2019-03-16 20:53:40 UTC
(In reply to Marguerite Su from comment #6)

> I understand zypper can be called by anything, but zypper and fonts-config
> are tied up via fontpackages’s %reconfigure_fonts macro, which calls 
> “fonts-config -quiet”, that is system mode not user mode, HOME stuff
> shouldn’t 
> be called at all.

As you can see on the log entries from zypper, it reports an error.