kozu@xxxxxxxです。
本日は ntsysv について確認させて下さい。
○質問内容
起動スクリプトを自作しまして、/etc/rc.d/init.d に配置し、
一通り start|stop|restart が稼動できる事を確認した上で ntsysv に登録しようと起動したところ、
ntsysv の一覧に私が作成した起動スクリプトが表示されていないことに気付きました。
ntsysv の一覧に表示させるためには何か特別な設定が必要なのでしょうか?
アドバイスの程、よろしくお願いします。
○詳細
・起動スクリプトのファイル名
ndbd (パーミッション:755)
・起動スクリプトの中身
#!/bin/bash
#
# Startup script for the DB Node
#
# Source function library.
. /etc/rc.d/init.d/functions
# Path to the version, ndb_mgmd binary, and the other files.
ndb_version=5.1.19
ndbd=/usr/local/mysql-${ndb_version}/libexec/ndbd
ndb_pid=/var/lib/mysql-cluster/ndb_2.pid
ndb_lockfile=/var/lock/subsys/ndb_mgmd
prog="MySQL DB Node v${ndb_version}"
RETVAL=0
# Checking files
[ -f $ndb_mgmd ] || exit $?
start()
{
if [ -f $ndb_lockfile ]; then
echo -n "$prog is running "
echo
exit $?
fi
echo -n $"Starting $prog: "
daemon $ndbd
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $ndb_lockfile
return $RETVAL
}
stop()
{
echo -n $"Stopping $prog: "
killproc $ndbd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f $ndb_lockfile $ndb_pid
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
$"Usage: $prog {start|stop|restart}"
exit 1
esac
exit $RETVAL