Dec 042005
 

Red HatやCentOSではrhgbというパッケージを使ってグラフィカルなブート画面を表示させることができます。
テキストモード時とは違って、各デーモンの起動スクリプトが順に実行されている様子がわかりにくいのですが、プログレスバー下に表示されている”Show details”(詳細表示)をクリックするとテキストモード時と同じ内容が表示できます。
この詳細表示を最初からデフォルト状態にしたいと思ったのですが、/etc/rc.sysinitを眺めた限りでは/etc/sysconfig/*の設定では変更できそうにありません。

/etc/rc.sysinitを眺めていてわかったところでは

  • rhgbはvt8で立ち上がります。普通に起動した状態でrhgbを実行することも可能です。意味ありませんが。
  • rhgbの起動チェックや終了はrhgb-clientコマンドでおこなえるようです。

このrhgb-clientコマンドの起動オプションを確認するとShow detailsもコントロールできそうなことがわかります。

[root@localhost ~]# rhgb-client --help
Usage: rhgb-client [OPTION...]
  -u, --update=STRING      Update a service's status
  -d, --details=STRING     Show the details page (yes/no).
  -p, --ping               See if the server is alive
  -q, --quit               Tells the server to quit
  -s, --sysinit            Inform the server that we've finished rc.sysinit

Help options:
  -?, --help               Show this help message
  --usage                  Display brief usage message

そこで/etc/rc.d/init.d/rhgb-detailsという名前で起動スクリプトを用意し、”rhgb-client –details=yes”を実行するようにしてみました。

#!/bin/sh
#
# chkconfig: 5 05 95
# description:  rhgb show details
#

# Sanity checks.
[ -x /usr/bin/rhgb-client ] || exit 0

# Source function library.
. /etc/rc.d/init.d/functions

start() {
    echo -n $"Starting rhgb show details: "
    /usr/bin/rhgb-client --details=yes
}

stop() {
   /bin/true
}

# See how we were called.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
        ;;
    restart)
        stop
        start
        ;;
    condrestart)
        ;;
    reload)
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
        ;;
esac
exit $RETVAL

rhgbコマンド本体の起動オプション等で制御できるのが一番スマートなのでしょうが、ソース見てないのでこの方法でとりあえず満足しています。
また、fedoraforun.orgでのrhgb defaultのスレッドを見ますと/etc/rc.d/init.d/functionsに仕込むような方法も書き込まれていますが試していません。

まぁここまでやるくらいなら最初からテキストモードでブートしたほうがいいんですけどね 😛

 Posted by at 6:33 am  Tagged with:

Sorry, the comment form is closed at this time.