Startup script for Sametime 8.5 on Linux
Michael Urspringer has recently explained how to write scripts for controlling Sametime 8.5 services on Windows servers.
Since we run our Sametime servers on Linux, Michael's article did not help, but it did inspire me to finally write scripts for our environment.
Fortunately, I did a search before starting to write scripts and I found out that Enio Basso has already written such a script. The script is quite rudimentary, but it works as expected and it is easy to customise and understand. And that is the most important.
I am sure that the script will be improved with time and maybe even reach the same level of sophistication as Daniel Nashed's Domino startup scripts.
Anyway, if you run Sametime on Linux and you still start all servers manually, head over to ebasso.net and get the script.
Note one thing - this script does not control DB2 server instance used by Sametime servers.
And that brought me to my next task - to find a way to automatically start the appropriate DB2 instance. Now, I know DB2 about as much as WebSphere, which equals to nothing. So, I started browsing through the DB2 help documentation, blogs and articles, but could not find a way to automatically start the instance. The help documentation had some examples, but they didn't seem to work in my case.
Half-frustrated, I decided to instead do it my way and I wrote a script that mimics a manual start of the instance: switching to DB2 admin user and running db2start command.
Script is extremely simple:
#! /bin/sh
########################################################################
# chkconfig: 345 98 16
# description: IBM DB2
# Provides: rc_db2
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: IBM DB2 Linux Script version 20100622.01
# Author: Sasa Brkic (http://lsoy.posterous.com)
# Copyright (C) 2010 Creative Commons
# License: GNU GPL V2 or (at your option) any later version.
### END INIT INFO########################################################################case "$1" in
start)
echo -n "Starting IBM DB2: "
su - db2admin -c db2start > /dev/null
;;
stop)
echo -n "Stopping IBM DB2: "
su - db2admin -c db2stop > /dev/null
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit 1
esac
exit 0
All you need to do is this:
- log in as root,
- create a file /etc/rc.d/init.d/rc_db2 with the above contents
- check file permissions, they should be -rwxr-xr-x
- run chkconfig --add /etc/init.d/rc_db2
Next time you restart your server, the DB2 should start automatically. And if you are using my DB2 script and Enio's Sametime script, then the parameters are adjusted in such way that DB2 is started first and then Sametime servers.
If you know any better way to automatically start DB2 instance, I'll be more than happy to learn it.
As said, both scripts do require some polishing, and I'll post any improvement that I make. In the meantime, enjoy your Sametime and let me know if you need any help.