在RedHat / CentOS系统上,/etc/init.d中的所有服务pipe理脚本(也由“服务”命令运行)都会生成彩色输出。 (即“[OK]”和“[FAILED]”string)。如何禁用? (产生颜色的转义序列使得webistrano的输出比需要的更难看。)
检出/etc/sysconfig/init 。 我的CentOS 5.x系统的顶线:
# color => new RH6.0 bootup # verbose => old-style bootup # anything else => new style bootup without ANSI colors or positioning BOOTUP=color
将BOOTUP行更改为像nocolor这样的nocolor消除所有init脚本的格式化。
如果您只想禁用某个脚本的格式,请添加:
BOOTUP=nocolor
后面写着:
/etc/init.d/functions