-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
rhel-10.1
-
None
-
None
-
None
-
rhel-systemd
-
None
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
-
All
-
None
What were you trying to do that didn't work?
A systemd service doesn't show progress bar in the console
What is the impact of this issue to you?
Without the progress bar, users may be mislead to think there is something wrong or even reboot the machine by force.
Please provide the package NVR for which the bug is seen:
How reproducible is this bug?:
always
Steps to reproduce
- Build a program /usr/sbin/progress that prints progress bar,
#include <stdio.h> #include <unistd.h> int main() { int total_time = 10; for (int remaining = total_time; remaining >= 0; remaining--) { int elapsed = total_time - remaining; fprintf(stderr, "\rProgress: %2d%% | ETA: %2d sec ", (elapsed * 100) / total_time, remaining); fflush(stderr); sleep(1); } fprintf(stderr, "\nDone.\n"); return 0; }
- Create a systemd service progress.service and start it
[Unit] Description=Print Progress [Service] Type=oneshot ExecStart=/usr/sbin/progress StandardInput=null StandardOutput=syslog StandardError=journal+console KillMode=process
Expected results
The progress bar will be printed.
Actual results
Only a line "Progress 100%..." is printed when the program finishes.
Notes
1. Using StandardError=tty instead of StandardError=journal+console can make the progress bar printed.
2. This issue is originally reported by IBM developer Sourabh Jain in upstream