[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9559.0. "How to startup Netscape FastTrack Server ?" by JRDV04::SURUGA () Mon Apr 21 1997 01:27

I installed Netscape FastTrack Server V2.11a came with the Digital
UNIX V4.0B package in AlphaStation 200 4/100 running Digital UNIX V4.0B 
and have a following question.

  The default installation does not seem to add a startup file in
  /sbin/init*.d directory as most Digital layered software.  So when 
  the system starts up, the server process does not get started 
  automatically.  I have to execute /usr/opt/ns-home/start-admin manually
  and bring up Netscape Server Selector in privlege mode and set
  "Server On."  What is the usual way to startup a server at boot time ?

K. Suruga
T.RTitleUserPersonal
Name
DateLines
9559.1JRDV04::SURUGATue May 06 1997 20:561
any idea ??
9559.2Can this be done with inetd?IOSG::MARSHALLWed May 07 1997 13:2834
I'm trying to do similar to .0, but using inetd rather than a permanently
running server initialised at boot time.

I added this line to /etc/services:
    http            80/tcp

and this line to /etc/inetd.conf
    http  stream  tcp   nowait  root   /usr/opt/ns-home/httpd-ceroc/start httpd

Then I HUPped inetd.  The .../start program is a simple shell script, viz:
    cd /usr/opt/ns-home/bin/httpd
    ./ns-httpd -d /usr/opt/ns-home/httpd-ceroc/config $@

which was created by the FastTrack server admin program, and which before the
link-up with inetd worked perfectly well (ie it started the server and I could
connect to it from a Netscape client).

But attempting to initiate http connections with the inetd stuff in place gives
the error:
    could not bind to port 80 (Address already in use)

which I guess either means I haven't set up the interaction between inetd and
ns-httpd correctly, or maybe ns-httpd just can't work with inetd?

If the former, what do I need to to fix it please?  If the latter, I can
trivially use inittab with 'respawn' to start and maintain the server, but I'd
prefer to use inetd if possible; after all that's what it's there for!

NB I guess the required inittab line looks something like this (I haven't tried
it yet!), which may help .0:
    httpd:3:respawn:/usr/opt/ns-home/httpd-ceroc/start > dev/console 2>&1

Thanks,
Scott
9559.3working with error messageJRDV04::SURUGAThu May 08 1997 06:0211
>NB I guess the required inittab line looks something like this (I haven't tried
>it yet!), which may help .0:

>    httpd:3:respawn:/usr/opt/ns-home/httpd-ceroc/start > dev/console 2>&1

I added similar to above and for start-admin in /etc/inittab.  They seem
to work but as stated in .2, I get following error message at boot time.

    could not bind to port 80 (Address already in use)

K. Suruga
9559.4FastTrack is not inetd-compatibleIOSG::MARSHALLThu May 08 1997 06:4012
To answer my own inetd question, I found (using Altavista, of course :-):
    http://webcompare.iworld.com/compare/netscapefasttrack.shtml

According to this page, FastTrack won't work with inetd (they go on to say you
wouldn't want a Web Server running off inetd anyway, but don't give a convincing
argument why!).

So I'll pursue the inittab angle.

.3: let me know if you solve the bind error, and I'll do likewise.

Scott
9559.5Anyone know a hack to make ns-httpd work with inetd?IOSG::MARSHALLThu May 08 1997 13:0642
I've figured out the reason this doesn't work with inittab/respawn is that the
started ns-httpd process kicks off some child 'worker' processes then dies.  So
init tries to respawn it when in fact the server is still running, causing the
port errors.  This may well also be what causes the inetd problems

I guess one could use 'once' instead of 'respawn' in inittab, but that defeats
the whole point of using init to ensure the server is restarted if it fails.  So
at this point I'm out of ideas, unless someone has a solution/hack that enables
ns-httpd to work with inetd.

In the meantime, here's a hack to achieve the objective.  Put this line in
/etc/inittab:
    httpd:3:respawn:/usr/local/bin/httpd > dev/console 2>&1

Then put the shell script below in /usr/local/bin/httpd.  Obviously you can play
around with filenames and locations.  I haven't tested it all at this point, but
you get the idea...

Scott


#!/bin/ksh

# Script to restart a program if it fails.  The script checks for the existence
# of a PID file; if the file is missing, or the PID it contains is not running,
# it will start the specified program (which should create or overwrite the PID
# file with the new process ID).  The script then repeatedly checks the process,
# at a specified interval, and restarts it if it has failed.
#     $1: name of program to run (including any arguments)
#     $2: name of file in which program stores its PID
#     $3: interval (in seconds) at which to check program status

# Hard-coded parameter values for http daemon
httpdir=/usr/opt/ns-home/httpd-ceroc
set $httpdir/start $httpdir/logs/pid 300

while true; do
    if ! test -r $2 || ! ps $(<$2) > /dev/null; then
        $1 &
    fi
    sleep $3
done
9559.6IOSG::MARSHALLMon May 12 1997 11:097
To conclude this rather lonely notes stream:

It seems ns-httpd does not work with inetd, period.

I've now tested the script in .5 and it does what is required.

Scott