Linux环境下Domino多帐户自动启动

#! /bin/sh

#

# A startup script for the ND 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 ND 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

    

使用注意:

- 将文档复制到 /etc/init.d/domino

- 检查文档所有者(owner)必须为root

- 检查文档属性是否正确,可将mode设置为 744

- 启动/停止Domino服务器可用命令行: /etc/init.d/domino start(stop)

- 如希望自动运行Domino,可在r0-r6运行level中创建脚本link,如下所示:

   

Now, create symlinks to start the Domino server at runlevels 3 and 5 with thefollowing commands:

ln -s /etc/rc.d/init.d/domino /etc/rc.d/rc3.d/S95domino

ln -s /etc/rc.d/init.d/domino /etc/rc.d/rc5.d/S95domino

And create symlinks to stop the server at runlevels 1 (single-user), 0 (halt) and 6(reboot) with the following commands:

ln -s /etc/rc.d/init.d/domino /etc/rc.d/rc1.d/K01domino

ln -s /etc/rc.d/init.d/domino /etc/rc.d/rc0.d/K01domino

ln -s /etc/rc.d/init.d/domino /etc/rc.d/rc6.d/K01domino 

转载于:https://www.cnblogs.com/hijkw/p/5902037.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值