Stopping MINA based server

2008-10-11 Thread Ahmed Al-Obaidy
I am sorry, I should post this in here instead of the dev mailing list

I am writing a MINA based server. I am looking for a guide lines or
best practices of how to stop the server from the Linux service script
(/etc/init.d/myserver).

I mean: 
1) should I write the process id on a file, and kill that process in the stop 
script?
2) should I open a socket listener to receive stop commands? how to secure that?
3) should I use IPC ? or process signalling?
4) or there is something better? please suggest



  

Stopping MINA based server

2008-10-11 Thread Ahmed Al-Obaidy
I am sorry, I should post this in here instead of the dev mailing list

I am writing a mina based server. I am looking for a guide lines or
best practices of how to stop the server from the Linux service script
(/etc/init.d/myserver).

I mean: 
1) should I write the process id on a file, and kill that process in the stop 
script?
2) should I open a socket listener to receive stop commands? how to secure that?
3) should I use IPC ? or process signalling?
4) or there is something better? please suggest






  

Re: Stopping MINA based server

2008-10-11 Thread Emmanuel Lecharny

Ahmed Al-Obaidy wrote:

I am sorry, I should post this in here instead of the dev mailing list

I am writing a MINA based server. I am looking for a guide lines or
best practices of how to stop the server from the Linux service script
(/etc/init.d/myserver).

I mean: 
1) should I write the process id on a file, and kill that process in the stop script?
  
This is what unix script commonly do, AFAIK. Simply avoid doing a kill 
-9. Kill -TERM should be enough.

2) should I open a socket listener to receive stop commands? how to secure that?
  
That's another option. look at Tomcat scripts, I think it's perfect if 
you select this option.

3) should I use IPC ? or process signalling?
  
Seems a bit overkilling, but I must admit I'm not really a specialist in 
this area.

4) or there is something better? please suggest
  
You have wrappers, like Tanuki, which already implements such start and 
stop precedure, IFAIR.


Hope it helps.

--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org




Re: Stopping MINA based server

2008-10-11 Thread Ahmed Al-Obaidy
It is released  under GPL license, which is not viable to me! It would be ok if 
it is Apache or LGPL or any other commercial friendly license!

--- On Sat, 10/11/08, Emmanuel Lecharny [EMAIL PROTECTED] wrote:
From: Emmanuel Lecharny [EMAIL PROTECTED]
Subject: Re: Stopping MINA based server
To: users@mina.apache.org
Date: Saturday, October 11, 2008, 7:04 PM

Ahmed Al-Obaidy wrote:
 I am sorry, I should post this in here instead of the dev mailing list

 I am writing a MINA based server. I am looking for a guide lines or
 best practices of how to stop the server from the Linux service script
 (/etc/init.d/myserver).

 I mean: 
 1) should I write the process id on a file, and kill that process in the
stop script?
   
This is what unix script commonly do, AFAIK. Simply avoid doing a kill 
-9. Kill -TERM should be enough.
 2) should I open a socket listener to receive stop commands? how to secure
that?
   
That's another option. look at Tomcat scripts, I think it's perfect if 
you select this option.
 3) should I use IPC ? or process signalling?
   
Seems a bit overkilling, but I must admit I'm not really a specialist in 
this area.
 4) or there is something better? please suggest
   
You have wrappers, like Tanuki, which already implements such start and 
stop precedure, IFAIR.

Hope it helps.

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org





  

Re: Stopping MINA based server

2008-10-11 Thread Squee
The Apache Commons Daemon project is a good alternative in that case.

On Sat, Oct 11, 2008 at 11:13 AM, Ahmed Al-Obaidy
[EMAIL PROTECTED] wrote:
 It is released  under GPL license, which is not viable to me! It would be ok 
 if it is Apache or LGPL or any other commercial friendly license!

 --- On Sat, 10/11/08, Emmanuel Lecharny [EMAIL PROTECTED] wrote:
 From: Emmanuel Lecharny [EMAIL PROTECTED]
 Subject: Re: Stopping MINA based server
 To: users@mina.apache.org
 Date: Saturday, October 11, 2008, 7:04 PM

 Ahmed Al-Obaidy wrote:
 I am sorry, I should post this in here instead of the dev mailing list

 I am writing a MINA based server. I am looking for a guide lines or
 best practices of how to stop the server from the Linux service script
 (/etc/init.d/myserver).

 I mean:
 1) should I write the process id on a file, and kill that process in the
 stop script?

 This is what unix script commonly do, AFAIK. Simply avoid doing a kill
 -9. Kill -TERM should be enough.
 2) should I open a socket listener to receive stop commands? how to secure
 that?

 That's another option. look at Tomcat scripts, I think it's perfect if
 you select this option.
 3) should I use IPC ? or process signalling?

 Seems a bit overkilling, but I must admit I'm not really a specialist in
 this area.
 4) or there is something better? please suggest

 You have wrappers, like Tanuki, which already implements such start and
 stop precedure, IFAIR.

 Hope it helps.

 --
 --
 cordialement, regards,
 Emmanuel Lécharny
 www.iktek.com
 directory.apache.org