Now, COLUMNS do not correspond to the real terminal width, but are always set to 80 in /etc/init.d/functions.
This is due to the new, more correct way bash decides whether it is interactive and the fact that COLUMNS are set and maintained by bash only in interactive mode.
If the terminal is more narrow than 80 (resized xterm, for example), the output of /sbin/service is not nice.
When my system boots, the console on framebuffer is wide, but the OKs appear at 80, not at the right edge as it used to be before.
Run /sbin/service named restart in a naroow (or wide) xterm -- the OKs will also appear not at the edge, but either on the next line or at the 80th column.
Any ideas how to fix that properly?
I can think of two ways:
1. invoke shell like \'/bin/sh -i\' to make it look after COLUMNS (since it doesn\'t require libtinfo, I guess, it uses some ioctl to determine the width);
2. use termutils (see #1076; I call so the simple wrappers around libtinfo) like it is done in /user/imz/RPM/SOURCES/distribute-0.3.91/usr/lib/distribute/functions
But then an extra-dependency on tibtinfo is added for initscripts, I don\'t think this is the proper way.
To use termutils, I\'ll have to move tput from /usr/bin/ to /bin/; yes, tput is more portable...
BTW, /bin/ls is already linked with -ltinfo, so I see no problem adding dependence on termutils to initscripts.
Well, I\'ve relocated tput to /bin/.
Implemented in initscripts-5.49-ipl46mdk,
based on distribute-0.4.0/usr/lib/distribute/functions
This fix appeared to be incomplete:
it doesn\'t work with cases like this:
action \"test\" true 2>/dev/null
initscripts-5.49-ipl47mdk + sh-2.05b-alt4