サービス自動起動設定
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
* サービス自動起動設定 [#i133c881]
Redhat系では、下記のように行ないます。
** 起動スクリプトの用意 [#kd481c79]
パッケージによっては雛型が用意されています。ない場合は、...
#!/bin/sh
#
# Startup script for the tomcat
#
# chkconfig: 345 80 15
# description: Tomcat
# Source function library.
. /etc/rc.d/init.d/functions
case "$1" in
'start')
if [ -f /usr/local/tomcat/bin/startup.sh ]; then
echo "Starting tomcat (~o~)//"
export JAVA_HOME=/usr/local/j2sdk/; \
export TOMCAT_HOME=/usr/local/tomcat;/usr/lo...
fi
;;
'stop')
echo "Stopping tomcat (~o~)/~~~~"
export JAVA_HOME=/usr/local/j2sdk/; \
export TOMCAT_HOME=/usr/local/tomcat;/usr/local/...
;;
'restart')
$0 stop
$0 start
;;
esac
exit 0
以下、説明をします。
#!/bin/sh
#
# Startup script for the tomcat
使うシェルの指定と、スクリプトに関する説明。
#
# chkconfig: 345 80 15
第1引数が、ランレベルの指定です。上記の場合は、3,4,5が指...
# description: Tomcat
起動スクリプトに関する説明を書きます。前述で書いたものは...
# Source function library.
. /etc/rc.d/init.d/functions
case "$1" in
'start')
if [ -f /usr/local/tomcat/bin/startup.sh ]; then
echo "Starting tomcat (~o~)//"
export JAVA_HOME=/usr/local/j2sdk/; \
export TOMCAT_HOME=/usr/local/tomcat;/usr/lo...
fi
;;
ケース文で、入力引数("start","stop"..)ごとに処理を分岐し...
** 起動スクリプトの配置 [#f5fab340]
用意した起動スクリプトを、配置します。作成した起動スクリ...
# cp ./tomcat /etc/rc.d/init.d/
続いて、起動スクリプトに実行権を与えます。
# chmod 0755 /etc/rc.d/init.d/tomcat
** chkconfigに登録 [#aff7ff36]
起動スクリプトの配置が終わったら、chkconfigに登録します。
# chkconfig --add tomcat
続いて、自動的に起動するように、設定します。
# chkconfig tomcat on
きちんと、設定が反映されたか、確認します。3,4,5がオンにな...
# chkconfig --list tomcat
tomcat 0:off 1:off 2:off 3:on 4:on 5:...
** 各パッケージごとの留意点 [#sc09448a]
*** Tomcat [#a6d26d33]
Tomcatは、Apacheより先に起動する必要があります。そこで、#...
** 参考リンク [#e29e97be]
- [[MySQLの自動起動:http://blog.c-production.com/archives...
- [[Tomcat 自動起動設定:http://miyazaki.ddo.jp/linuxserve...
----
** 履歴 [#r13a24d7]
- 2007/03/25 ぼくぴ 新規作成
終了行:
* サービス自動起動設定 [#i133c881]
Redhat系では、下記のように行ないます。
** 起動スクリプトの用意 [#kd481c79]
パッケージによっては雛型が用意されています。ない場合は、...
#!/bin/sh
#
# Startup script for the tomcat
#
# chkconfig: 345 80 15
# description: Tomcat
# Source function library.
. /etc/rc.d/init.d/functions
case "$1" in
'start')
if [ -f /usr/local/tomcat/bin/startup.sh ]; then
echo "Starting tomcat (~o~)//"
export JAVA_HOME=/usr/local/j2sdk/; \
export TOMCAT_HOME=/usr/local/tomcat;/usr/lo...
fi
;;
'stop')
echo "Stopping tomcat (~o~)/~~~~"
export JAVA_HOME=/usr/local/j2sdk/; \
export TOMCAT_HOME=/usr/local/tomcat;/usr/local/...
;;
'restart')
$0 stop
$0 start
;;
esac
exit 0
以下、説明をします。
#!/bin/sh
#
# Startup script for the tomcat
使うシェルの指定と、スクリプトに関する説明。
#
# chkconfig: 345 80 15
第1引数が、ランレベルの指定です。上記の場合は、3,4,5が指...
# description: Tomcat
起動スクリプトに関する説明を書きます。前述で書いたものは...
# Source function library.
. /etc/rc.d/init.d/functions
case "$1" in
'start')
if [ -f /usr/local/tomcat/bin/startup.sh ]; then
echo "Starting tomcat (~o~)//"
export JAVA_HOME=/usr/local/j2sdk/; \
export TOMCAT_HOME=/usr/local/tomcat;/usr/lo...
fi
;;
ケース文で、入力引数("start","stop"..)ごとに処理を分岐し...
** 起動スクリプトの配置 [#f5fab340]
用意した起動スクリプトを、配置します。作成した起動スクリ...
# cp ./tomcat /etc/rc.d/init.d/
続いて、起動スクリプトに実行権を与えます。
# chmod 0755 /etc/rc.d/init.d/tomcat
** chkconfigに登録 [#aff7ff36]
起動スクリプトの配置が終わったら、chkconfigに登録します。
# chkconfig --add tomcat
続いて、自動的に起動するように、設定します。
# chkconfig tomcat on
きちんと、設定が反映されたか、確認します。3,4,5がオンにな...
# chkconfig --list tomcat
tomcat 0:off 1:off 2:off 3:on 4:on 5:...
** 各パッケージごとの留意点 [#sc09448a]
*** Tomcat [#a6d26d33]
Tomcatは、Apacheより先に起動する必要があります。そこで、#...
** 参考リンク [#e29e97be]
- [[MySQLの自動起動:http://blog.c-production.com/archives...
- [[Tomcat 自動起動設定:http://miyazaki.ddo.jp/linuxserve...
----
** 履歴 [#r13a24d7]
- 2007/03/25 ぼくぴ 新規作成
ページ名: