fly2moon
作者fly2moon·2015-11-19 17:12
软件开发工程师·18m

Domino Linux 启动脚本样例

字数 2627阅读 916评论 0赞 0
Modifying the startup script for the Lotus Domino 6 Server

http://www-01.ibm.com/support/docview.wss?rs=899&uid=swg21179847

SAMPLE STARTUP SCRIPT

#! /bin/sh
#
# A startup script for the Lotus Domino 6 server
#
# description: This script is used to start the domino server as a background process.
#
# Usage /etc/init.d/domino start|stop

# You should change the 3 following variables to reflect your environment.

# DOM_HOME is the variable that tells the script where the Domino Data resides
DOM_HOME=/local/notesdata

# DOM_USER is the Linux account used to run the Domino 6 server
DOM_USER=notes

# DOM_PROG is the location of the Domino executables
DOM_PROG=/opt/lotus/bin

# START: This is executed when you launch the command /etc/init.d/domino start
start() {
echo -n "Starting domino: "

# When the Domino Controller runs, it creates a .jsc_lock file. 
# If you've configured Domino to use the Domino Controller and the Server crashes then the ".jsc_lock" file is not deleted. 
# When the system reboots and starts Domino, it will fail because of the existing .jsc_lock file.
# Here we want to ensure that we delete the file if it's there before Domino starts 
if [ -f $DOM_HOME/.jsc_lock ]; then
rm $DOM_HOME/.jsc_lock
fi
cd $DOM_HOME

# The script must be launched by root. 
# Here we become the notes user and we launch the Domino Server with the Domino Controller (-jc) enabled.
# To launch the Server without Domino Controller use the line:
# su $DOM_USER -c "$DOM_PROG/server > /dev/null 2>&1 &" 
# Start Domino as a background process
su $DOM_USER -c "$DOM_PROG/server -jc -c > /dev/null 2>&1 &"
return 0 
}

# STOP: This is executed when you launch the command /etc/init.d/domino stop
stop() {
echo -n "Stopping domino: "
cd $DOM_HOME
# Here we become the notes user and we quit the Domino Server and the Domino Controller (-jc).
# To stop Domino when the Domino Controller is not enabled use the line:
# su $DOM_USER -c "$DOM_PROG/server -q"
# We pipe the Y into the command so Domino is shut down without needing to type "Y" on the terminal.
echo Y | su $DOM_USER -c "$DOM_PROG/server -jc -q"
return 0
}

case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: domino {start|stop}"
exit 1
esac

To use this script:

    • copy and paste the script into the file /etc/init.d/domino.
    • check that the script is owned by root
    • set the correct permissions (744)
    • Domino can be started(stopped) manually using the script using the command: /etc/init.d/domino start(stop)
    • To start and stop Domino automatically when the machine starts and quit, create the symlinks to the script in the default runlevel and in the r6 and r0 runlevels.

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

0

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关问题

相关资料

X社区推广