I have no experience with start up scripts at ALL!!!
I need a script which will start my Domino server on SLES 10 Automaticly (After powerfailure etc.) Ive tried a few I found online, but none of them seems to work (Like I said, I have very little to know knowledge in this field)
If someone will be kind enough to provide me with a script? Or just help? PLEASE!!!
After a powerfailure… I guess I don’t understand. Specifically you
want a script that starts your service on bootup? Power failure or
normal shutdown/startup shouldn’t matter. If you can get Domino to
start at all automatically on startup you should be set. If Domino runs
on Linux I guess I’m surprised that there isn’t a script made for it
already for startup and shutdown. If nothing else you can take
/etc/init.d/skeleton and copy it to a new file in /etc/init.d (‘domino’
perhaps) and customize it. In the start section, put the command(s) you
use to start Domino up. In the stop section, the things that shut
everything down. Then use chkconfig domino on to set it to start on
startup and stop on shutdown.
Good luck.
mySolutions wrote:
> Hi Guys
>
> I urgetly need your help.
>
> I have no experience with start up scripts at ALL!!!
>
> I need a script which will start my Domino server on SLES 10
> Automaticly (After powerfailure etc.) Ive tried a few I found online,
> but none of them seems to work (Like I said, I have very little to know
> knowledge in this field)
>
> If someone will be kind enough to provide me with a script? Or just
> help? PLEASE!!!
>
> Thanks in advance.
>
> Mouritz Opperman
> Domino Admin
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
Here is the script I wrote to manage Domino 7 in my SLES 10 system.
Don´t use as is, since it makes use of several supporting configuration files.
Adapt it first to your environment and needs.
Take special care when adjusting the paths to the binaries.
Almost all the settings were defined in a file named domino located in /etc/sysconfig directory.
Keep in mind that this file is not part of the official Sles 10 distro, so you will have to create
one yourself.
DOMINO_USER and DOMINO_GROUP are the user account and group you created to restrict domino accesss to its data directories.
INPUT_FILE plays the role of a bare command console for domino.
OUTPUT_LOG is the file where you want domino to write its output, good for troubleshooting issues.
Finally, I have also removed from the script all the insserv headers. Once you have the script adapted to your system, it would be advisable
to add them to the top.
Use the ones from skeleton and adapt them according to your system start up dependencies.
One last thing: I have removed a function I wrote to fine tune some kernel parameters. Their values are
system specific and could make yours unstable.
#! /bin/bash
#
# Source domino configuration
-f /etc/sysconfig/domino ] && . /etc/sysconfig/domino || exit 2
# Check that the Domino server binary is installed
-x ${LOTUSDIR}/bin/server ] || exit 4
# Set domino system log directories
OUTPUT_LOG=$DOMINO_LOG/$DOMINO_SERVER.log
INPUT_FILE=$DOMINO_LOG/$DOMINO_SERVER.input
# See how we were called
case "$1" in
start)
if -f ${DOMINO_LOCK_FILE} ] ; then
echo "Domino seems to be already running."
exit 5
fi
# Let´s tune some kernel parameters
# kernel_tunning ()
echo -n "Starting $prog: "
if ! -d "$DOMINO_LOG" ] ; then
mkdir -p "$DOMINO_LOG"
chown -R "$DOMINO_USER"."$DOMINO_GROUP" "$DOMINO_LOG"
fi
test -f $INPUT_FILE || su - $DOMINO_USER -c "touch $INPUT_FILE"
test -f $INPUT_FILE && su - $DOMINO_USER -c "rm $INPUT_FILE; touch $INPUT_FILE"
su - $DOMINO_USER -c "$DOMINO_BIN start <$INPUT_FILE >>$OUTPUT_LOG 2>&1 &"
#
RETVAL=$?
if "$RETVAL" -eq "0" ] ; then
echo "Domino started succesfully"
touch ${DOMINO_LOCK_FILE}
else
echo "Failed"
fi
;;
stop)
echo -n "Shutting down Domino: "
echo "... waiting ..."
su - $DOMINO_USER -c "$DOMINO_BIN -quit" >> $OUTPUT_LOG
#
count=0
DOMINO_RUNNING=`ps -fu $DOMINO_USER |grep $LOTUSDIR | awk '{print $2}'`
while "$DOMINO_RUNNING" ] ; do
echo "$DOMINO_RUNNING"
sleep 10
count=`expr $count + 1`
echo ".. waiting "$count"0 seconds"
if $count -eq 13 ] ; then
echo "Domino is still running after 2 minutes"
echo "... Now time to use brute force."
rm -f ${DOMINO_LOCK_FILE}
cd $DOMINO_PATH
su $DOMINO_USER -c "$LOTUSDIR/bin/nsd -kill"
cd -
fi
DOMINO_RUNNING=`ps -fu $DOMINO_USER | grep $LOTUSDIR | awk '{print $2}'`
done
rm -f ${DOMINO_LOCK_FILE}
echo "Domino server shutdown completed"
;;
restart)
## Stop and start the service
$0 stop
$0 start
;;
status)
echo -n "Checking for Lotus Domino: "
DOMPROCS=`ps -fu $DOMINO_USER | grep $LOTUSDIR | awk '{print $2}'`
if -z "$DOMPROCS" ] ; then
echo "Domino does not seem to be running"
else
echo "Domino is running. Current running domino processes have pids: "
echo "$DOMPROCS"
echo "Run the command <ps -fu ${DOMINO_USER}> for more details about domino running subsystems."
echo "See file ${OUTPUT_LOG} for domino text console output."
echo "Run simple domino console commands by means of ${INPUT_FILE}."
echo " --> Example: $> echo 'show server' >> ${INPUT_FILE}"
fi
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
;;
esac
The biggest problem is, I have absolutely NO Knowledge of the Linux OS, neither Scripts, so it is almost impossible for me to edit any current script, as for I have no Idea what needs to be added where etc.
If anyone can maybe look at my script posted above, and see what needs to be added/removed to make it run?
It only needs to start Domino server on Bootup. Dont need anything fancy. My Domino is installed In Default Location with Default settings. Any more Help would be greatly appreciated.
Well, the main issue I see in your script is that you are starting Domino with root privileges, which is no correct.
As I stated in my previous post, you have to set up first a domino account and group.
Let´s picture they are domino/domino
stop)
echo -n "Shutting down Domino "
su - domino -c "/opt/ibm/lotus/bin/server -q"
;;
Keep in mind that the above reduce to the minimun the script. It doesn´t have any start/stop checking. If anything goes wrong you will have to add logging
to your script to troubleshooting what is going on.
Refer to my previous script for that.
Appart from that, double check that the domino data directory is owned by the domino account and group. In my system it looks like this:
# ls -ld notesdata/
drwxr-x--- 21 domino domino 8192 Nov 5 14:13 notesdata/
#
# ls -l /local/notesdata/
total 592800
-rw------- 1 domino domino 54 Jan 9 2008 .Xauthority
-rw------- 1 domino domino 2125 Oct 24 18:41 .bash_history
drwxr-x--- 3 domino domino 4096 Jan 9 2008 .java
-rw------- 1 domino domino 35 Oct 24 18:10 .lesshst
drwx------ 2 domino domino 4096 Jan 9 2008 .ssh
-rw------- 1 domino domino 874 Oct 24 18:08 .viminfo
-rw-r----- 1 domino domino 458752 Nov 5 05:00 AgentRunner.nsf
-rw-r----- 1 domino domino 0 Jan 9 2008 DDMRepCach.dat
drwxr-x--- 2 domino domino 4096 Oct 27 14:14 IBM_TECHNICAL_SUPPORT
-rw-r--r-- 1 domino domino 32768 Oct 26 02:00 IDB10088.DTF
-rw-r--r-- 1 domino domino 24576 Oct 24 23:25 IDB17520.DTF
....
....
....
....
-rw-r----- 1 domino domino 589824 Nov 5 05:01 userlicenses.ntf
-rw-r----- 1 domino domino 458752 Nov 5 05:01 userreg.ntf
-rw-r----- 1 domino domino 7340032 Nov 5 05:01 webadmin.ntf
-r--r----- 1 domino domino 1595392 Aug 14 2001 wpdic.dic
-rw-r--r-- 1 domino domino 0 Oct 24 18:09 ~notes.lck
-rw-r--r-- 1 domino domino 520 Oct 24 18:09 ~notetp2.reg
#
If the paths to the binaries are right and you have the domino server configured and setup correctly, it should start.