2
Good day. Problem: In a %post install section of RPM spec file can be a script. I want to put there a script with a realtime output, like progress bar for post-installation process. But all output produced by commands in this section is strongly buffered by (i suppose) Yum, and showed only when section is completely executed. Question: is there a way to get output, produced by scripts inside of %post sections (python or pure pash scripts) imidiately or asap?
Thanks in advance.
2RPM is noninteractive. You really should not produce any output like progress bar. It will just confuse tools built on top of rpm. And it will very likely lead to some other errors. – msuchy – 2016-12-13T13:28:34.977
@msuchy I know that is sort of bad idea. But at least i don't try to do realy interactive things, like getting user input. Main installation part of my RPM was drowned into %post install script, so it was important to see progress and errors occuring during %post. As i discovered later, it's possible to do output in stderr. It's not bufferized like stdout. Anyway, already rerouted my output to log file. Thanks for a reply! – J. Keker – 2016-12-16T17:39:48.183
Although the original poster mentioned a
stderr
workaround,yum
3.4.3 seems to bufferstderr
as well. – szmoore – 2018-09-27T06:00:12.753There are very good reasons for showing output during an RPM installation. The fact that RPM is "noninteractive" has no relevance. If one of the scriptlets (pre, post, etc) takes a long time the user should get periodic updates in order to know that the process hasn't stalled. – shrewmouse – 2018-11-16T16:26:34.053