LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-13-2004, 11:42 AM   #1
rnj13
LQ Newbie
 
Registered: Jul 2004
Location: Louisville, KY
Distribution: Slackware
Posts: 13

Rep: Reputation: 0
Domino 6.5 Startup Scripts


Hey folks,

I'm not a linux expert by any means, but I searched high and low for decent Domino startup scripts for my Slackware installation (10.0 as of this post) with very little success. I've been a supporter of the Slackware project since 3.6 and I've used this forum frequently over my Slackware tenure.

I'm simply posting this because someone might find it useful. Just trying to return to the community what it has done for me for several years.

After scowering the IBM forums, I was able to find a script someone had written for Redhat (I think), but it didn't quite work for my Slackware. The minted Domino 6.5 CD doesn't include any way for you to autostart the server, so you need to not only create a startup script, but you also need to add it to the mutliuser and shutdown scripts.

This script assumes you've already created the user and group for notes to use when it runs, so you'll already have the /home/notes directory. You might also need to edit the file locations, as I installed Domino in /usr/lotus and I installed the data directory to /usr/notes/data (because of the way my disk is partitioned).

Here's the rc.domino script that I used in /etc/rc.d (the original script was written by someone else, but I couldn't find the author's name so I can't give him/her credit):
Code:
#!/bin/sh
#
# Start/stop the Lotus Domino server
#
# description: This script is used to start and stop the domino
# server as a background process. It will send
# the serverID password from a file to the server.
# Communication with the server may be done with a screen -r -D Domino when logged in as user 'notes'
#
# Usage: domino start|stop
#
#
#

domino_start() {
  echo -n "Starting Domino server..."
  su - notes -c "screen -d -m -S Domino /home/notes/startnotes"
  echo "done."
}

domino_stop() {
  echo -n "Stopping Domino server. "
  su - notes -c "cd /usr/notes/data; /usr/lotus/bin/server -q"
}



case "$1" in
'start')
  domino_start
  ;;
'stop')
  domino_stop
  ;;
*)

esac
# End of the domino script
Place this script in /etc/rc.d, then chmod 755 rc.domino.

Next, in your /home/notes directory, create this file named startnotes. I just used "pico startnotes." Again, you might also need to edit to accomdate the locations of your files:
Code:
cd /usr/notes/data
/usr/lotus/bin/server
chmod 755 startnotes

Next, you're going to need to edit the multiuser startup script /etc/rc.d/rc.M(the file linux runs when it goes multiuser):

I added these lines right under the lines for Samba. It probably doesn't matter where you put them, so long as it comes AFTER where shared library links are updated:
Code:
# Start Domino
if [ -x /etc/rc.d/rc.domino ]; then
  . /etc/rc.d/rc.domino start
fi
Save and exit /etc/rc.d/rc.M, then you need to make one final change to /etc/rc.d/rc.6, the shutdown script. Again, I added these lines right after Samba, although it probably doesn't make a huge difference so long as you shut down Domino before it starts to shutdown your hardware:
Code:
# Stop the Domino server:
if [ -x /etc/rc.d/rc.domino ]; then
  . /etc/rc.d/rc.domino stop
fi
That's it. Once all of that was in place, my Domino starts and stops when it is supposed to. These are pretty basic scripts, it doesn't provide any extravagant crash recovery data (at least I don't think so). If anyone has any changes or corrections where I may have made an error (and I bet there is), feel free to say so!

-Shane
 
Old 07-13-2004, 12:46 PM   #2
Mephisto
Member
 
Registered: Oct 2002
Location: Washington D.C, USA
Distribution: Slack 12, Etch, Gutsy
Posts: 453

Rep: Reputation: 31
I do something similar but I use rc.local rather than modifying rc.M. Nice script though.
 
Old 07-13-2004, 03:16 PM   #3
netmask
Member
 
Registered: Jul 2004
Location: Sherbrooke, Quebec, Canada, North America, World, Milky Way
Distribution: Gentoo
Posts: 103

Rep: Reputation: 16
One thing you could add is to prevent users from starting the server twice.

Just grep the process name out of "ps aux" and check if there's a match.

Same thing could go with stopping the server. No need to try to stop it if it's not even started


Overall it's a nice script. Good job.
 
Old 07-15-2004, 10:06 AM   #4
rnj13
LQ Newbie
 
Registered: Jul 2004
Location: Louisville, KY
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: 0
I'm not really sure what the advantage is to using rc.local over rc.M. If you could fill me on that, I'd appreciate it!

About grep, good idea. I did some research and came up with this:

Code:
domino_start() {
  #check to see if Domino is already started
  if ps -aux | grep -q 'startnotes' ; then
    echo "Domino already running."
  else
    echo -n "Starting Domino server..."
    su - notes -c "screen -d -m -S Domino /home/notes/startnotes"
    echo "done."
  fi
}

domino_stop() {
  #check to see if Domino is started
  if ps -aux | grep -q 'startnotes' ; then
    echo -n "Stopping Domino server."
    su - notes -c "cd /usr/notes/data; /usr/lotus/bin/server -q"
  else
    echo "Domino is not running."
  fi
}
Let me know if you think that needs to be changed any, and then I'll edit the original post for reference. That seemed to work OK on my system. Sometimes, it would detect something when Domino isn't running and would execute the shutdown process anyway. This doesn't really matter that much, the 'server -q' command is pretty quick about getting back on track if it's not running. I decided to use 'startnotes' as the search in my grep process because the actual process name is 'server' which is pretty vague. By using the file you created in /home/notes to determine which server you started, you could easily swap out the names in each script to detect multiple server instances (if you're using them) and make sure they're all shut down.

-Shane
 
Old 07-15-2004, 11:03 AM   #5
netmask
Member
 
Registered: Jul 2004
Location: Sherbrooke, Quebec, Canada, North America, World, Milky Way
Distribution: Gentoo
Posts: 103

Rep: Reputation: 16
It looks good.

I thing I used before is to use PID files. I'd put a file in /var/run at startup and do my operations based on if the files is there or not. You're way is just as good
 
Old 07-15-2004, 01:12 PM   #6
Mephisto
Member
 
Registered: Oct 2002
Location: Washington D.C, USA
Distribution: Slack 12, Etch, Gutsy
Posts: 453

Rep: Reputation: 31
There is nothing wrong with modifying rc.M, but the point of rc.local is for the admin to add his own scripts into the init process without having to modify the standard scripts. Of course I usually need to go in to the various scripts and comment out some stuff anyway.
 
Old 07-15-2004, 01:12 PM   #7
rnj13
LQ Newbie
 
Registered: Jul 2004
Location: Louisville, KY
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: 0
Hmm, well... I've had some minor problems with this script. grep is not reliably returning the proper results.

Sometimes, it was including the grep process which includes my search string. When looped back into itself, it will always pass the check, so it never does anything. To try and avert this, I changed it to:

Code:
ps -aux | grep -w startnotes | grep -v grep
This works better, but still 'blips' sometimes and returns a false statement. I'm thinking a PID file might be more appropriate, but I'm not really sure how to do that. If you could post an example, I would appreciate it.

-Shane
 
Old 07-15-2004, 06:11 PM   #8
wellmt
Member
 
Registered: Oct 2003
Location: Oxford, England
Distribution: Ubuntu
Posts: 70

Rep: Reputation: 15
Just out of interest, how do you install Domino on Slackware? That is to say, IBM ship Domino CDs for Redhat and United Linux distros IIRC

Did you use the RPM files on install CD or do are the install files shipped with their own installer? (like Mozilla)

Sorry it's a bit of topic. We run Domino on Win32 where I work and I'd be interested in investigating it on Linux at some point. Especially if I can use Slackware!
 
Old 07-15-2004, 09:09 PM   #9
Mephisto
Member
 
Registered: Oct 2002
Location: Washington D.C, USA
Distribution: Slack 12, Etch, Gutsy
Posts: 453

Rep: Reputation: 31
Just extract the tar file and put it in the directory you want to install it in. Do a google for "Domino power Linux" and you'll get an article from 1999-2000 describing the steps. Unlike most other IBM products Domino does not use RPM or require that you run a specific flavor of Linux. That is unless this changed with 6.5.1. Last time I did a fresh install was about 3 years ago, so someone else may be able to give you better directions. R5 was a little touchy running on Linux but R6 is doing fairly well for us. If you need SameTime or quickplace though keep in mind there is not a Linux version at this time. (Maybe R8, but that is just an educated guess.)
 
Old 07-15-2004, 09:25 PM   #10
Mephisto
Member
 
Registered: Oct 2002
Location: Washington D.C, USA
Distribution: Slack 12, Etch, Gutsy
Posts: 453

Rep: Reputation: 31
Note that the Domino Power article is hopelessly out of date. For one thing I know if you do the install from X you get a gui install interface and don't have to do an http install. I just don't know of any more recent tutorials. If you have done Domino installs in windows though it is basically the same. The main difference is the command line for launching Domino.
 
Old 07-16-2004, 03:17 AM   #11
wellmt
Member
 
Registered: Oct 2003
Location: Oxford, England
Distribution: Ubuntu
Posts: 70

Rep: Reputation: 15
Thank you Mephisto
 
Old 07-30-2004, 02:18 PM   #12
rnj13
LQ Newbie
 
Registered: Jul 2004
Location: Louisville, KY
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: 0
Hmm, the company I work for has an "IBM Passport Advantage" and we have two server licenses. On the 'passport,' they send you the entire CD set every time there's an updated release. There's two CDs for Linux, but neither have any kind of RPM package that I saw. It has it's own installer deal. One of the Linux CDs is for the IBM zSeries server something-or-other.

The installer is text-based and can be done from a remote console pretty easily. You can set it up to do anything you wish, pretty much. If you want my advice, I'd install the server from the text-based installer, than set it up to be configured with Remote Server Setup. Do the server setup from a Windows box with Notes installed - you'll get better control over all the setup functions.

If you don't want to get the passport thing, I'm pretty sure you can pay a one-time fee and get the CD you need. You can get updates through the next major release from their web site for free.

If you want or need help with getting it installed and working, I'll do my best to help you. I'm no expert, I'm just one of those guys who has gotten it to work.

We ran Domino on Windows servers for years, and as time passed, I became increasingly disappointed in Domino's speed. As a seat-of-the-pants move, I brought in my fresh Slackware 10 CDs and slapped that on an old 566 MHz machine I had sitting around. Domino runs faster and better on that 566 that it ever did on any of the dual-processor Dell boxes we have.

As far as the startup scripts go, I've stripped them back to the plain and simple launch commands with no grep. Domino is smart enough to know that it's already started and won't continue to launch if you try to run it again while it's already running. It's the same with trying to shut it down if it's not running. Therefore I don't really see a need to grep out the process.

Last edited by rnj13; 07-30-2004 at 02:20 PM.
 
Old 07-30-2004, 09:17 PM   #13
Mephisto
Member
 
Registered: Oct 2002
Location: Washington D.C, USA
Distribution: Slack 12, Etch, Gutsy
Posts: 453

Rep: Reputation: 31
One suggestion, rather than eliminating the grep you might try:

if screen -ls | grep -q 'Domino'; then

It works fairly well and consistently for me, provided of course domino was started with the script.


Last edited by Mephisto; 07-30-2004 at 09:20 PM.
 
Old 07-30-2004, 10:28 PM   #14
rnj13
LQ Newbie
 
Registered: Jul 2004
Location: Louisville, KY
Distribution: Slackware
Posts: 13

Original Poster
Rep: Reputation: 0
Well, as I said above, Domino knows if it's being launched twice and just returns a quick error before quitting out. You can throw the server -q switch at it if it's already shut down and it will just dump you back at the command line instantly. Because of this, using grep is just an extra unneeded step.

The only time I can see actually needing a grep process in place is when you're running multiple instances of Domino on the same box. Even then, it can be done without grep.

I like the idea of using a pid file, that's got to be the quickest, cleanest way to 'test' the running process, I'm just not quite sure how to do it even though it's not entirely necessary.

Last edited by rnj13; 07-30-2004 at 10:31 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
startup scripts... ValidiusMaximus Linux - Software 8 01-11-2005 05:55 PM
Startup scripts MadnessASAP Linux - Software 2 12-15-2004 07:09 PM
Startup Scripts? gauge73 Linux - Newbie 3 12-12-2003 02:03 AM
startup scripts amphion Linux - Newbie 8 03-28-2003 01:39 PM
startup scripts mimi Linux - General 1 04-24-2002 03:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration