-
Notifications
You must be signed in to change notification settings - Fork 73
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
NeedRestart::UI assumes STDOUT is a terminal, fails to run when piped #86
Comments
As an alternative I've tried using the batch mode as follows, which works without a terminal: But it appears to ignore the quiet option and always prints needrestart's version, which is not desired. So still no solution in sight. |
I submitted a pull request along with an example command to run needrestart in a unattended manner, and produce a human-readable output:
|
Hi, the batch options does indeed ignore the quiet option intentional. The batch option prints all findings in a parsable format (used by DE-IBH/apt-dater) for further processing so the quiet option does not make any sense. I'm considering to add another option to needrestart to enforce a unattended/non-interactive mode. HTH, |
Followup of the bug fix in liske#86, triggered by running needrestart with yum/dnf in cron
Followup of the bug fix in liske#86, triggered by running needrestart with yum/dnf in cron
I encounter issues running needrestart in an unattended manner because NeedRestart::UI assumes STDOUT is a terminal.
This bug was previously logged downstream as Debian bug #859387. I am logging this here as I believe the issue is upstream.
The following command:
DEBIAN_FRONTEND=noninteractive needrestart -q -r l | logger -s
Gives the following error:
Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work. The COLUMNS and LINES environment variables didn't work. The resize program didn't work. The stty program didn't work. at /usr/share/perl5/NeedRestart/UI.pm line 50.
Explanation of the command:
DEBIAN_FRONTEND=noninteractive
tells debconf not to wait for user interaction regarding kernel updates. This is a workaround for List-only mode should not require interaction for kernel updates #67logger -s
sends the output to syslog and STDERR. The actual command is not important, the catch here is NeedRestart::UI doesn't expect the output to be piped to another process, it expect instead STDOUT to be a terminal.The text was updated successfully, but these errors were encountered: