I am trying to install an .rpm
package with rpm-ostree install /var/mnt/data/repo/nch.rpm
, and it fails with the following error messages:
error: Running %post for nch: bwrap(/bin/sh): Child process killed by signal 1; run `journalctl -t 'rpm-ostree(nch.post)'` for more information
Calling journalctl -t 'rpm-ostree(nch.post)'
shows this:
Feb 09 16:59:53 rpm-ostree(nch.post)[32467]: /proc/self/fd/5: line 1: /var/log/nch.install.log: No such file or directory
Feb 09 16:59:53 rpm-ostree(nch.post)[32463]: /proc/self/fd/5: line 2: /var/log/nch.install.log: No such file or directory
Feb 09 16:59:53 rpm-ostree(nch.post)[32463]: /proc/self/fd/5: line 122: /var/log/nch.install.log: No such file or directory
The error is being caused by these strings of %post
script:
date +"%Y-%m-%d %T" >> /var/log/nch.install.log #error at line 1
echo "Post section started" >> /var/log/nch.install.log #error at line 2
#...
echo "Post section completed" >> /var/log/nch.install.log #error at line 122
I tried to run echo "Test" >> /var/log/test.log
as superuser (through sudo -i
), and it worked. But running rpm-ostree install /var/mnt/data/repo/nch.rpm
in such way still produced described error.
Is it possible to work around it somehow? I could repackage the .rpm
with changed script, but what changes should I make? I still need logging.