Bug 1702226 - [silverblue] Running %post for pcp: Executing bwrap(/bin/sh): Child process killed by signal 1
Summary: [silverblue] Running %post for pcp: Executing bwrap(/bin/sh): Child process k...
Keywords:
Status: CLOSED DUPLICATE of bug 1827441
Alias: None
Product: Fedora
Classification: Fedora
Component: pcp
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nathan Scott
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1717966 (view as bug list)
Depends On:
Blocks: 1352154
TreeView+ depends on / blocked
 
Reported: 2019-04-23 09:15 UTC by Enrico Tagliavini
Modified: 2020-05-05 23:17 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 23:17:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Enrico Tagliavini 2019-04-23 09:15:42 UTC
Description of problem:
When installing the pcp package via rpm-ostree install pcp on Fedora Silverblue the installation fails with error

Running post scripts... done
error: Running %post for pcp: Executing bwrap(/bin/sh): Child process killed by signal 1; run `journalctl -t 'rpm-ostree(pcp.post)'` for more information


Version-Release number of selected component (if applicable):
pcp-4.3.1-2.fc29.x86_64

How reproducible:
always

Steps to Reproduce:
1. install fedora silverblue 29
2. rpm-ostree install pcp (or any package depending on it)

Actual results:
Installation fails

Expected results:
Installation should be successful

Additional info:

journalctl -t 'rpm-ostree(pcp.post)' output:

Apr 23 11:12:08 localhost.localdomain rpm-ostree(pcp.post)[1945]: touch: cannot touch '/var/lib/pcp/pmns/.NeedRebuild': No such file or directory
Apr 23 11:12:08 localhost.localdomain rpm-ostree(pcp.post)[1945]: chmod: cannot access '/var/lib/pcp/pmns/.NeedRebuild': No such file or directo>
Apr 23 11:12:08 localhost.localdomain rpm-ostree(pcp.post)[1945]: /usr/pcp.post: line 52: cd: /var/lib/pcp/pmns: No such file or directory
Apr 23 11:12:08 localhost.localdomain rpm-ostree(pcp.post)[1945]: /usr/pcp.post: line 53: cd: HOME not set

Comment 1 Jonathan Lebon 2019-07-25 14:59:47 UTC
This is because rpm-ostree by default doesn't allow writing to `/var` from scriptlets. For more information on this and other rpm-ostree "adaptations" required, see https://bugzilla.redhat.com/show_bug.cgi?id=1352154 and https://bugzilla.redhat.com/show_bug.cgi?id=1703203#c1.

In this case, offhand, it seems like pcp would need to be adapted as such:
- tmpfiles entries to create necessary dirs under /var
- run whatever rebuild scripts needed at startup time, rather than %post time

Comment 2 Nathan Scott 2019-08-19 03:41:32 UTC
*** Bug 1717966 has been marked as a duplicate of this bug. ***

Comment 3 Ben Cotton 2019-10-31 18:56:45 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2019-11-27 23:14:32 UTC
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Jonathan Lebon 2020-05-05 16:19:31 UTC
I think this is still an issue, right? Re-opening.

Re those errors:

> Apr 23 11:12:08 localhost.localdomain rpm-ostree(pcp.post)[1945]: touch: cannot touch '/var/lib/pcp/pmns/.NeedRebuild': No such file or directory
> Apr 23 11:12:08 localhost.localdomain rpm-ostree(pcp.post)[1945]: chmod: cannot access '/var/lib/pcp/pmns/.NeedRebuild': No such file or directo>

I see in the spec file that it's likely from:

> %{install_file "$PCP_PMNS_DIR" .NeedRebuild}

which expands to:

> %global install_file() %{expand:
> if [ -w "%1" ]
> then
>     (cd "%1" && touch "%2" && chmod 644 "%2")
> else
>     echo "WARNING: Cannot write to %1, skipping %2 creation." >&2
> fi
> }

And that later on will trigger the `Rebuild` script to run? So in other words, we always want to run the `Rebuild` script whenever we drop in new binaries in case things need rebuilding?

If it's cheap to determine whether a rebuild is needed, then we could have a systemd service ordered before the PCP services do the check and potential rebuild. While this should work for both OSTree-based and traditional systems, we can keep doing it at post time for the latter if wanted by keying off of `test -f /run/ostree-booted`.

Comment 6 Nathan Scott 2020-05-05 23:17:20 UTC
Thanks for those notes Jonathan - the spec snippet you're looking at has changed since this BZ was opened, and the runtime situation is more complex than triggering rebuild outside of rpm install (this already is done, and the issues in this original BZ are actually now resolved since pcp-5.1.0 - there are many issues remaining for us though).

We're trying to figure out how to make PCP and ostree play nicely over in 1827441 now (do I've DUP'd this one there), and upstream in https://github.com/performancecopilot/pcp/issues/816

*** This bug has been marked as a duplicate of bug 1827441 ***


Note You need to log in before you can comment on or make changes to this bug.