Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Lamar Owen
On Saturday 31 May 2003 20:03, Tom Jackson wrote:
> Andrew Piskorski wrote:
> >Zoran, I disagree.

> Me too! It sounds like a more native way of controlling the process. I
> can't count the number of cases of reported failure to properly install
> and setup daemontools to work.

Zoran, if votes count, I vote that your patch be integrated (possibly as a
configure option.  --with-controller-process or something).  I like this
simple, easy, native method that doesn't require any other work.  Nice.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Tom Jackson
Andrew Piskorski wrote:

Zoran, I disagree.

Me too! It sounds like a more native way of controlling the process. I
can't count the number of cases of reported failure to properly install
and setup daemontools to work.
I don't like the alternative of using inittab, which requires root privs
to do anything, and you can't really bring down a process.
--Tom Jackson

--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Andrew Piskorski
On Sat, May 31, 2003 at 07:07:18PM +0200, Zoran Vasiljevic wrote:

> We have it running for about 3 years already. No need to develop anything
> since it is already there. It does not change anything related to the main
> server so it needs no extra testing.
> It is just an C-equivalent of your shell-script and it alows you to:
>
>nsd -s -t config.tcl

> Seeing all those responses... I think I'll just  keep our own patched
> nsd copy and leave all as-is. It took me more time to write all those

Zoran, I disagree.  If it is true that you've already done the work,
it works well, and it adds no significant additional complexity or
risk of failure to AOLservers which do not use the feature, then you
should go ahead and add it to the standard codebase.

Low risk, low complexity utility features, particularly of proven
reliability and at least some proven usefullness, should go into the
standard codebase, IMNSHO.  And Zoran, at least, is someone I think we
can all trust when he says it is low impact, low risk, reliable, and
substantially useful to at least some people...

Note that I probably won't even use that feature myself, but the
debate so far on the list - DESPITE providing lots of useful info on
alternative methods - still largely reminds me of the apocryphal
stories of business executives heatedly debating over the cost of
coffee and the color of websites - not because it's important, but
because it's small, trivial, and something they all already understand
and easily relate to.

--
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Zoran Vasiljevic
On Saturday 31 May 2003 19:07, you wrote:
>nsd -s -t config.tcl

nsd -x -t config.tcl

(a typo).

Zoran


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Zoran Vasiljevic
On Saturday 31 May 2003 18:43, you wrote:

> How many lines of code and how many man-hours will it take to implement
> in C?  How long will it take to review all the code to ensure you've
> neither introduced any new bugs or otherwise broken already existing
> code?

We have it running for about 3 years already. No need to develop anything
since it is already there. It does not change anything related to the main
server so it needs no extra testing.
It is just an C-equivalent of your shell-script and it alows you to:

   nsd -s -t config.tcl

and forget about it. It logs worker start/stop/restart in system logfile
so its easy to track.


> Also, as a stand-alone script or program, folks running even older
> AOLserver 3.3.x could take advantage of it, rather than being forced to
> upgrade to either 4.x or 3.5.x ... or were you planning to backport this
> change all the way back?

Ah

Seeing all those responses... I think I'll just  keep our own patched
nsd copy and leave all as-is. It took me more time to write all those
anwers, than to write the small C-routine  we're talking about.
If everybody is happy with shell/daemontools/whatever there is no
reason for me to do anything here, obviously.
Apparently, we have a very different usage pattern than most of the other
users...

Cheers,
Zoran


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Tom Jackson
Dossy wrote:

I haven't used daemontools yet, but does running nsd under daemontools
require you to run nsd -f?  Or, will daemontools monitor the PID of nsd
and do the right thing if nsd disappears?


It monitors the process, not the PID. If nsd dies, it restarts it, based
on starting it with 'svc -u'. You could start the process with 'svc -o',
where -o means once. If the process dies, it will not restart.
You run nsd like so '/path/to/nsd -it nsd.tcl -u me' inside a shell
script named 'run'.
Check out an old document: http://zmbh.com/daemontools-aolserver/ which
explains the whole thing.
--Tom Jackson
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Rob Mayoff
+-- On May 31, Dossy said:
> I haven't used daemontools yet, but does running nsd under daemontools
> require you to run nsd -f?  Or, will daemontools monitor the PID of nsd
> and do the right thing if nsd disappears?

You use -f.


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Zoran Vasiljevic
On Saturday 31 May 2003 18:31, you wrote:

>
> Why not just use daemontools? You avoid the race conditions of pidfiles
> and get several other useful features.
>

Because of the added complexity of maintaining and setting up
different piece of software. We use just one nsd instance in our
solution and we need to be sure that it is running all the time.
We'd have to do much more work, distribute more software, write
more complex installation scripts, train people how to use them, etc.
It is just not worth it.

> Daemontools is a well-tested, working solution, maintained by someone
> known to write bulletproof code.

I don't say daemontools is bad. It is just getting more complex when
you add more pieces.

>
> > Now, what I did not say (nor done yet, but I'm planning to) is: win32.
> > You have no shell there. By having all built-in, you have no worry.
>
> Wouldn't it be better to run nsd as an NT service?

Of course. But it needs to be set-up so that it restarts the program
in case of failure only. If the server exits deliberately it should not
kick it again.  I haven't investigate this yet, as said above.

Zoran


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Dossy
On 2003.05.31, Zoran Vasiljevic <[EMAIL PROTECTED]> wrote:
> Doable, but messy. IMHO. nsd already takes care about pid-file
> logfiles, etc when going to background. This is all nice stuff
> and I wouldn't like to reimplement all this in an external shell-script.
> Why just not put this logic on the C-level in the nsd? It is already
> forking to background. Why not fork one more time and get a nice
> controller/worker tandem?

How many lines of code and how many man-hours will it take to implement
in C?  How long will it take to review all the code to ensure you've
neither introduced any new bugs or otherwise broken already existing
code?

> > As I said, I think implementing this directly in code with a
> > user-selectable command line switch might be really convenient.  But,
> > it's obviously not necessary to achieve the same results ... as you can
> > do it simply with a 8 line shell script.
>
> This is right. It is the convenience of having a well tested, working solution
> which you just use w/o shell-script workarounds. Somebody has to write,
> update, maintain, etc... this shell-script, right?

Um, it's an *8 line* shell script.  It took me about 20 minutes to write
and thoroughly test the first time I ever wrote it.  There's nothing to
update or maintain either, really.

I'm betting a beer that to do it right in pure C, with all the necessary
regression testing of nsd and so on, will take far more than 20 minutes.
I'm not one to push cost vs. benefit, but ... what's the benefit of
having done the extra work to do it in C when the benefit is EXACTLY the
same as doing it via my shell script?

> Now, what I did not say (nor done yet, but I'm planning to) is: win32.
> You have no shell there. By having all built-in, you have no worry.

I'd still rather write a general purpose process monitor and service
runner for Win32 so that MANY other folks could use it to run all sorts
of different things, nsd being just one of them.

Then, it'd also remain decoupled from the nsd code ...

Also, as a stand-alone script or program, folks running even older
AOLserver 3.3.x could take advantage of it, rather than being forced to
upgrade to either 4.x or 3.5.x ... or were you planning to backport this
change all the way back?

-- Dossy

--
Dossy Shiobara   mail: [EMAIL PROTECTED]
Panoptic Computer Network web: http://www.panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Dossy
On 2003.05.31, Rob Mayoff <[EMAIL PROTECTED]> wrote:
>
> Why not just use daemontools?

I haven't used daemontools yet, but does running nsd under daemontools
require you to run nsd -f?  Or, will daemontools monitor the PID of nsd
and do the right thing if nsd disappears?

-- Dossy

--
Dossy Shiobara   mail: [EMAIL PROTECTED]
Panoptic Computer Network web: http://www.panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Dossy
On 2003.05.31, Rob Mayoff <[EMAIL PROTECTED]> wrote:
>
> Wouldn't it be better to run nsd as an NT service?

Do services automatically restart when they abnormally terminate?

I think that's what Zoran's trying to accomplish, here.

-- Dossy

--
Dossy Shiobara   mail: [EMAIL PROTECTED]
Panoptic Computer Network web: http://www.panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Rob Mayoff
+-- On May 31, Zoran Vasiljevic said:
> Doable, but messy. IMHO. nsd already takes care about pid-file
> logfiles, etc when going to background. This is all nice stuff
> and I wouldn't like to reimplement all this in an external shell-script.
> Why just not put this logic on the C-level in the nsd?

Why not just use daemontools? You avoid the race conditions of pidfiles
and get several other useful features.

> This is right. It is the convenience of having a well tested, working solution
> which you just use w/o shell-script workarounds. Somebody has to write,
> update, maintain, etc... this shell-script, right?

Daemontools is a well-tested, working solution, maintained by someone
known to write bulletproof code.

> Now, what I did not say (nor done yet, but I'm planning to) is: win32.
> You have no shell there. By having all built-in, you have no worry.

Wouldn't it be better to run nsd as an NT service?


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Zoran Vasiljevic
On Saturday 31 May 2003 17:56, you wrote:

> My personal solution to this is to run the nsd process from a shell
> script.



Doable, but messy. IMHO. nsd already takes care about pid-file
logfiles, etc when going to background. This is all nice stuff
and I wouldn't like to reimplement all this in an external shell-script.
Why just not put this logic on the C-level in the nsd? It is already
forking to background. Why not fork one more time and get a nice
controller/worker tandem?

> As I said, I think implementing this directly in code with a
> user-selectable command line switch might be really convenient.  But,
> it's obviously not necessary to achieve the same results ... as you can
> do it simply with a 8 line shell script.

This is right. It is the convenience of having a well tested, working solution
which you just use w/o shell-script workarounds. Somebody has to write,
update, maintain, etc... this shell-script, right?

Now, what I did not say (nor done yet, but I'm planning to) is: win32.
You have no shell there. By having all built-in, you have no worry.

Cheers,
Zoran


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/


Re: [AOLSERVER] [ aolserver-Feature Requests-746579 ] Server instance controller process

2003-06-01 Thread Dossy
> Submitted By: Zoran Vasiljevic (vasiljevic)
> Summary: Server instance controller process
>
> Initial Comment:
> Since some time we have added an option to nsd to fork
> twice instead of once when putting itself in the background.
> This way we have created one additional server instance
> which is now able to monitor the actual server and restart
> it in the case of failure. This has proven very convenient,
> yet simple to do. Far more simple than fiddling with the
> inittab and init machinery. It is just a matter of giving one
> more startup option to the command starting the server.
>
> Now, I'm being tired to patch this simple change in the
> nsmain.c each time and I think that this would be interesing
> for other nsd users as well.
>
> I would like to get this into the regular distribution and if there
> are any voices against, please step out.
> Again, this change has no implications on the regular server
> operation and is conveniently selectable.

I think as long as this is kept as a command line switch, I think
there's no reason not to.

My personal solution to this is to run the nsd process from a shell
script.  In the shell script, there's a infinite while loop, and the
body of the loop runs nsd under strace (in Linux) or truss (in Solaris).
I do this so that it can run in the background (IOW, avoiding having to
use -f in the script) so that nsd logs to log/server.log instead of
the console (then having to redirect it in the shell script back into
log/server.log).

When the nsd exits (dies gracefully, or segfaults, or whatever) control
resumes in the shell script.  So, when I shut down nsd, what I do is rm
the log/nspid.${servername} file before issuing the nsd -K to shut it
down.  When strace/truss exit, the shell script looks to see if the
pidfile exists.  If it does, then nsd exited abnormally, and the while
loop starts over and re-runs nsd.  If the file doesn't exist, a break is
issued and the shell script terminates.

This might feel kludgy to some folks, but I've been running webservers
like this for ages -- I believe Netscape Enterprise Server even ships
with its start/stop scripts doing this!  Of course, they also have some
kind of watchdog process that runs as well, but I'm not 100% sure what
that process actually does ... ;-)

As I said, I think implementing this directly in code with a
user-selectable command line switch might be really convenient.  But,
it's obviously not necessary to achieve the same results ... as you can
do it simply with a 8 line shell script.

-- Dossy

--
Dossy Shiobara   mail: [EMAIL PROTECTED]
Panoptic Computer Network web: http://www.panoptic.com/
  "He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/