ページのトップに戻る
TeamWARE Office 200X V3.0L10 管理者ガイド

4.3.5 Linuxでの自動起動の設定

Linuxの場合、TeamWARE Officeをインストールすると、/etc/init.dディレクトリにteamwareというファイル名で自動起動のスクリプトが格納されます。このスクリプトによって、次回のシステム起動時にTeamWARE Officeが自動起動されます。以下に、teamwareスクリプトの内容を示します。

teamwareスクリプトの内容

#!/bin/sh
#
# Copyright(C) TeamWARE Group Oy 2002 and Fujitsu Limited 2002
# and/or their licensors
#
# teamware TeamWARE server startup script for Linux
# chkconfig: 35 01 97
# Suse init info
### BEGIN INIT INFO
# Provides: teamware
# Required-Start: $network
# Required-Stop:
# Default-Start: 3 5
# Default-Stop:
# Description: start the TeamWAREOffice servers
### END INIT INFO

# Set the TeamWARE root directory.
TO=`awk -F= '/INSTDIR/ {print $2}' /usr/lib/two/inst.ini`
export TO

# Set the TeamWARE root directory to PATH.
PATH=$PATH:$TO
export PATH

# Chdir to TeamWARE directory.
if [ ! -d $TO ] ; then
echo "TeamWARE root directory $TO not found."
exit 1
fi
cd $TO || exit 2

# Set TeamWARE user name.
USER=`awk -F= '/TWADMIN/ {print $2}' /usr/lib/two/inst.ini`
export USER

# Check TeamWARE shell.
if [ ! -x $TO/to ] ; then
echo "TeamWARE server shell $TO/to not found."
exit 3
fi
RETVAL=0

# Start or stop.
case "$1" in

start)
# It is recommended that resume is run manually and only when necessary.
# echo "Conditioning TeamWARE databases"
# su - $USER -c "$TO/to resume directory"
# su - $USER -c "$TO/to resume mail"
# su - $USER -c "$TO/to resume calendar"
# su - $USER -c "$TO/to resume library"
# su - $USER -c "$TO/to resume forum"
# su - $USER -c "$TO/to resume task"
echo "Starting TeamWARE server"
# The following is an automatic starting command
su - $USER -c "$TO/to start >$TO/boot.log"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/teamware
;;

stop)
echo "Stopping TeamWARE server"
# The following is an automatic stopping command
su - $USER -c "$TO/to stop"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/teamware
;;

esac

# end of teamware