Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpm script output not always printed #4468

Open
champtar opened this issue Jun 15, 2023 · 2 comments
Open

rpm script output not always printed #4468

champtar opened this issue Jun 15, 2023 · 2 comments
Labels
difficulty/medium medium complexity/difficutly issue priority/high triaged This issue was triaged

Comments

@champtar
Copy link

rpm scripts outputs are often not printed, so we potentially missing important errors or warnings

Host system details
Alma 8.8 build host (rpm-ostree 2022.10...)

Expected vs actual behavior

# rpm-ostree compose tree --unified-core

Checking out packages... done
Running pre scripts... 18 done
⠙ Running post scripts... zlib
readline.post: install-info: No such file or directory for /usr/share/info/history.info
⠒ Running post scripts... readline
⠂ Running post scripts... nettle
⠂ Running post scripts... file-libs
[...]
⠓ Running post scripts... grub2-tools
grub2-tools.post: install-info: No such file or directory for /usr/share/info/grub2.info.gz
⠉ Running post scripts... cockpit-ws

Expected:
ALL ouputs from rpm scripts are printed (put |& cat after the command)

Input state hash: XXX
Relabeling...done
Checking out packages...done
Running pre scripts...18 done
Running post scripts...done
Running posttrans scripts...24 done
Writing rpmdb...done
readline.post: install-info: No such file or directory for /usr/share/info/history.info
readline.post: install-info: No such file or directory for /usr/share/info/rluserman.info
sed.post: install-info: No such file or directory for /usr/share/info/sed.info.gz
nettle.post: install-info: No such file or directory for /usr/share/info/nettle.info
grep.post: install-info: No such file or directory for /usr/share/info/grep.info.gz
diffutils.post: install-info: No such file or directory for /usr/share/info/diffutils.info
gettext.post: install-info: No such file or directory for /usr/share/info/gettext.info.gz
binutils.post: install-info: No such file or directory for /usr/share/info/as.info.gz
binutils.post: install-info: No such file or directory for /usr/share/info/binutils.info.gz
binutils.post: install-info: No such file or directory for /usr/share/info/gprof.info.gz
binutils.post: install-info: No such file or directory for /usr/share/info/ld.info.gz
binutils.post: install-info: No such file or directory for /usr/share/info/standards.info.gz
systemd-udev.post: Failed to create directory /var/lib/systemd: Read-only file system
device-mapper-event.post: rpm-ostree-systemctl: Ignored non-preset command: enable dm-event.socket
chrony.post: rpm-ostree-systemctl: Ignored non-preset command: daemon-reload
wget.post: install-info: No such file or directory for /usr/share/info/wget.info.gz
grub2-tools.post: install-info: No such file or directory for /usr/share/info/grub2.info.gz
grub2-tools.post: install-info: No such file or directory for /usr/share/info/grub2-dev.info.gz
cockpit-ws.post: libsemanage.semanage_direct_install_info: Overriding cockpit module at lower priority 100 with module at priority 200.
lvm2.post: rpm-ostree-systemctl: Ignored non-preset command: enable lvm2-monitor.service
lvm2.post: rpm-ostree-systemctl: Ignored non-preset command: enable lvm2-lvmpolld.socket
epel-release.post: Many EPEL packages require the CodeReady Builder (CRB) repository.
epel-release.post: It is recommended that you run /usr/bin/crb enable to enable the CRB repository.
Regenerating rpmdb for target
Relabeling...done
Executing postprocessing script

note that when using the workaround the *.post outputs are printed pretty late (should be between post and posttrans lines)

Steps to reproduce it
Replace bwrap with a small script to log, look at the logs

mv /usr/bin/bwrap /usr/bin/bwrap-original
cat > /usr/bin/bwrap <<'EOF'
#!/bin/bash
mkdir -p /tmp/bwrap-logs
bwrap-original "$@" |& tee /tmp/bwrap-logs/$$
EOF

As a workaround you can also add |& cat after the command

I think we need to stop the spinner and or flush stdout and or set the buffering mode to line somewhere.

Would you like to work on the issue?
No

@cgwalters cgwalters added triaged This issue was triaged priority/high difficulty/medium medium complexity/difficutly issue labels Jun 16, 2023
@cgwalters
Copy link
Member

Yeah, the current state is just embarrassing.

I think we need to stop the spinner and or flush stdout and or set the buffering mode to line somewhere.

Mmm...I think rather instead we should buffer stdout/stderr from scripts to an O_TMPFILE or so, and then display it at the end?

Or I guess, after each script is run, detect if we had any output, and if so then stop spinner, output and then restart.

@champtar
Copy link
Author

champtar commented Jun 21, 2023

I think it's already buffered from quickly looking at the code

dump_buffered_output (const char *prefix, GLnxTmpfile *tmpf, GError **error)
but haven't tried to troubleshoot further as I have a workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium medium complexity/difficutly issue priority/high triaged This issue was triaged
Projects
None yet
Development

No branches or pull requests

2 participants