Bug 1079842 - Error during installation of openSUSE-release without recommends
Error during installation of openSUSE-release without recommends
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Dominique Leuenberger
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-02-07 14:10 UTC by Fabian Vogt
Modified: 2018-02-07 18:10 UTC (History)
1 user (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 Fabian Vogt 2018-02-07 14:10:20 UTC
zypper --root [...] in --no-recommends openSUSE-release

results in 

    /var/adm/update-scripts/posttransMqyNdD/openSUSE-release-20180205-1.2.x86_64.rpmhs09zO: line 4: /usr/bin/systemd-tmpfiles: No such file or directory

This is caused by the %posttrans section.
Comment 1 Dominique Leuenberger 2018-02-07 14:22:24 UTC
I see a couple options to work this out:

a) require systemd (which contains /usr/bin/systemd-tmpfiles)
b) check for the presence of systemd-tmpfiles before attempting to run it, skipping it in case of absence (which is what the systemd macro would be doing)

c) As a further option, one could even go as far and claim that openSUSE-release should not 'care' for the tmpfiles entry at all, since the installation of issue-generator already triggers the same (in this case though, ignoring the absence of systemd-tmpfiles, resulting in the action not being performed); removing the tmpfiles call here directly; this could lead to a missing /etc/issue file though

d) Or we simply reimplement the functionality of it as

[ ! -e /etc/issue ] && ln -s ../run/issue /etc/issue
Comment 2 Dominique Leuenberger 2018-02-07 14:24:07 UTC
for the case of installing with zypper --root, my preference would be b; that would be least destructive
Comment 3 Fabian Vogt 2018-02-07 14:27:06 UTC
(In reply to Dominique Leuenberger from comment #2)
> for the case of installing with zypper --root, my preference would be b;
> that would be least destructive

I agree - alternatively redirect stderr, but that might hide actual errors.
Comment 4 Thorsten Kukuk 2018-02-07 14:28:28 UTC
(In reply to Dominique Leuenberger from comment #2)
> for the case of installing with zypper --root, my preference would be b;
> that would be least destructive

In the container we don't have systemd and don't need /etc/issue, there is nothing which could display it. So b) is in my opinion the best solution, too.
Comment 5 Dominique Leuenberger 2018-02-07 14:30:49 UTC
I actually just looked at the scripts we currently have:

if [ -x /usr/sbin/issue-generator ]; then

    /usr/bin/systemd-tmpfiles --create issue-generator.conf || :
    /usr/sbin/issue-generator || :
fi

So this entire thing is pure cosmetic, as we already ignore errors;

I'll change this to only run system-tmpfiles in case the program is present, which is no change to what we have so far (error ignores), but spits one less error in case thie bin is missing
Comment 6 Fabian Vogt 2018-02-07 14:45:24 UTC
(In reply to Thorsten Kukuk from comment #4)
> (In reply to Dominique Leuenberger from comment #2)
> > for the case of installing with zypper --root, my preference would be b;
> > that would be least destructive
> 
> In the container we don't have systemd and don't need /etc/issue, there is
> nothing which could display it. So b) is in my opinion the best solution,
> too.

I would even suggest to not require issue-generator from the -release packages as it only provides optional functionality which is only useful in some cases anyway.

A Supplements: systemd to issue-generator might be the best option.

As the %posttrans is guarded with a check for issue-generator there shouldn't be any issues with the installation order either.
Comment 7 Thorsten Kukuk 2018-02-07 14:48:38 UTC
(In reply to Fabian Vogt from comment #6)

> I would even suggest to not require issue-generator from the -release
> packages as it only provides optional functionality which is only useful in
> some cases anyway.

We tried that, but then you have no /etc/issue if you install with --no-recommends, which did lead to other bug reports about missing /etc/issue ...
Comment 8 Fabian Vogt 2018-02-07 15:08:57 UTC
(In reply to Thorsten Kukuk from comment #7)
> (In reply to Fabian Vogt from comment #6)
> 
> > I would even suggest to not require issue-generator from the -release
> > packages as it only provides optional functionality which is only useful in
> > some cases anyway.
> 
> We tried that, but then you have no /etc/issue if you install with
> --no-recommends, which did lead to other bug reports about missing
> /etc/issue ...

I've got two ideas:
- Include the file as part of -release with special %verify settings
- Add a new package with just /etc/issue and a new virtual "issue" provides

It's probably not worth the extra complexity though.
Comment 9 Dominique Leuenberger 2018-02-07 18:10:00 UTC
osc rdiff openSUSE:Factory/_product -r 6253:6254

Index: openSUSE-release.spec
===================================================================
--- openSUSE-release.spec (revision 6253)
+++ openSUSE-release.spec (revision 6254)
@@ -127,7 +127,9 @@
 %posttrans
 # Launch the issue-generator: we have a new config file in /usr/lib/issue.d that needs to be represented
 if [ -x /usr/sbin/issue-generator ]; then
-    /usr/bin/systemd-tmpfiles --create issue-generator.conf || :
+    if [ -x /usr/bin/systemd-tmpfiles ]; then
+      /usr/bin/systemd-tmpfiles --create issue-generator.conf || :
+    fi
     /usr/sbin/issue-generator || :
 fi


Checked in as part of snapshot 0207