On RedHat/CentOS systems, all of the service management scripts in /etc/init.d (and also run by the "service" command) produce color output. (i.e. the "[ OK ]" and "[FAILED]" strings.) How do I disable this? (The color-producing escape sequences are making the webistrano output more ugly than it needs to be.)
1 Answer
Check out /etc/sysconfig/init
. The top lines on my CentOS 5.x system:
# color => new RH6.0 bootup
# verbose => old-style bootup
# anything else => new style bootup without ANSI colors or positioning
BOOTUP=color
Changing the BOOTUP line to something like nocolor
eliminates the formatting for all init scripts.
If you just want to disable formatting on one of your scripts, add:
BOOTUP=nocolor
after the line that reads:
/etc/init.d/functions
-
This works even when running scripts manually (i.e. not during bootup), amazingly enough. Is there any way to do this on a per-script basis, though? I'd rather not touch
/etc/sysconfig/init
. Commented Nov 4, 2011 at 15:57 -