Re: How to convert a standar apps, to a Service

2011-04-30 Thread Winnie Lacesso
On Wed, 27 Apr 2011 Alec T. Habig wrote
snip - much good advice
 logging (have it log status information, ideally with customizeable log
 levels, to the appropriate place),  

What about the logrotate part to correctly rotate logs so they
don't grow infinitely

NB I notice SL5 by default rotates on size not date (as SL4 did); this is
good. Rather a few not-too-big logfiles (good default) than many mostly empty
rotated dutifully but pointlessly once a week or whatever.


Re: How to convert a standar apps, to a Service.

2011-04-28 Thread William Scott
On 28 April 2011 07:27, Florian Philipp li...@binarywings.net wrote:

 There is also libdaemon which is meant to facilitate converting your
 program into a proper daemon (not tried it, though).  BTW: It is a shame
 that SL does not contain the start-stop-daemon like Gentoo or Ubuntu
 (http://manpages.ubuntu.com/manpages/dapper/en/man8/start-stop-daemon.8.html).
 It makes converting arbitrary executables into daemons a matter of minutes.

 Regards,
 Florian Philipp



What about upstart in SL6?


Re: How to convert a standar apps, to a Service.

2011-04-28 Thread Pablo Cavero
2011/4/28 William Scott will...@magicwilly.info

 On 28 April 2011 07:27, Florian Philipp li...@binarywings.net wrote:

  There is also libdaemon which is meant to facilitate converting your
  program into a proper daemon (not tried it, though).  BTW: It is a shame
  that SL does not contain the start-stop-daemon like Gentoo or Ubuntu
  (
 http://manpages.ubuntu.com/manpages/dapper/en/man8/start-stop-daemon.8.html
 ).
  It makes converting arbitrary executables into daemons a matter of
 minutes.
 
  Regards,
  Florian Philipp
 
 

 What about upstart in SL6?


Am test and make it to work over SL 5.5, but am think that in SL6, this will
work OK. Why not??

-- 
Pablo Cavero
System Engineer
+569 8920 9509


How to convert a standar apps, to a Service.

2011-04-27 Thread Pablo Cavero
Hello,

I have an apps, and I want to convert this to a service.
I have the source in C, and the binary executable. Think for example, in the
ultra vnc repeater.


http://sourceforge.net/projects/ultravnc/files/Repeater/win32%20and%20unix%20Repeaters/

The Only that I need is a set of bash script, like script used by the
tomcat, for example, or need a special binary executable??
http://www.laliluna.de/articles/tomcat-startup-script-linux.html

I want to may will use chkconfig, like an standar service.

Thank a lot, for your comments,

-- 
Pablo Cavero
System Engineer
+569 8920 9509


Re: How to convert a standar apps, to a Service.

2011-04-27 Thread Alec T. Habig
Pablo Cavero writes:
 The Only that I need is a set of bash script, like script used by the
 tomcat, for example, or need a special binary executable??
 http://www.laliluna.de/articles/tomcat-startup-script-linux.html
 
 I want to may will use chkconfig, like an standar service.

The chkconfig script part is easy, just look in /etc/rc.d/init.d, steal
an existing service's script, and modify it to run what you want.  Note
the commented line at the top starting with chkconfig - that
information specifies the run levels chkconfig will set it up to be
activated in, and the startup/shutdown priority.

As for the code you run, that gets trickier.  All the startup scripts do
is start and stop things.  Those things could be more scripts,
executables, or combinations thereof.  Areas to pay attention to with
your code (to get it to behave nicely when run this way) include:
getting it daemonized properly (dropping and/or redirecting IO streams),
privilege seperation (can it run as a non privleged user?  if so, do
that, if not, be really careful and have only the bare minimum code run
with elevated privileges), logging (have it log status information,
ideally with customizeable log levels, to the appropriate place), and
signal handling so it shuts down cleanly when told to, reloads
configuration files if asked, etc.

-- 
Alec Habig, University of Minnesota Duluth Physics Dept.
ha...@neutrino.d.umn.edu
   http://neutrino.d.umn.edu/~habig/


Re: How to convert a standar apps, to a Service.

2011-04-27 Thread Florian Philipp
Am 27.04.2011 22:54, schrieb Alec T. Habig:
 Pablo Cavero writes:
 The Only that I need is a set of bash script, like script used by the
 tomcat, for example, or need a special binary executable??
 http://www.laliluna.de/articles/tomcat-startup-script-linux.html

 I want to may will use chkconfig, like an standar service.
 
 The chkconfig script part is easy, just look in /etc/rc.d/init.d, steal
 an existing service's script, and modify it to run what you want.  Note
 the commented line at the top starting with chkconfig - that
 information specifies the run levels chkconfig will set it up to be
 activated in, and the startup/shutdown priority.
 
 As for the code you run, that gets trickier.  All the startup scripts do
 is start and stop things.  Those things could be more scripts,
 executables, or combinations thereof.  Areas to pay attention to with
 your code (to get it to behave nicely when run this way) include:
 getting it daemonized properly (dropping and/or redirecting IO streams),
 privilege seperation (can it run as a non privleged user?  if so, do
 that, if not, be really careful and have only the bare minimum code run
 with elevated privileges), logging (have it log status information,
 ideally with customizeable log levels, to the appropriate place), and
 signal handling so it shuts down cleanly when told to, reloads
 configuration files if asked, etc.
 

There is also libdaemon which is meant to facilitate converting your
program into a proper daemon (not tried it, though).  BTW: It is a shame
that SL does not contain the start-stop-daemon like Gentoo or Ubuntu
(http://manpages.ubuntu.com/manpages/dapper/en/man8/start-stop-daemon.8.html).
It makes converting arbitrary executables into daemons a matter of minutes.

Regards,
Florian Philipp



signature.asc
Description: OpenPGP digital signature


Re: How to convert a standar apps, to a Service - WORKING!!

2011-04-27 Thread Pablo Cavero
Thanks a lot, for everyone.

The Ultra VNC Repeater, release 17 include the scripts and sources to make
the compiling, and the installing.
But, the problem is that in Scientific Linux, have not the
start-stop-deamon apps.

Downloanding and compiling this, and adding the start-stop-deamon binary
executable to the /sbin directory, all work so fine.

A few configuration on the uvncrepeater.ini and All Rigths.

If someone need any more details, to make this implementation, only tell me
how I can help you.

Best Regards,

Pablo Cavero.
System Engineer



2011/4/27 Florian Philipp li...@binarywings.net

 Am 27.04.2011 22:54, schrieb Alec T. Habig:
  Pablo Cavero writes:
  The Only that I need is a set of bash script, like script used by the
  tomcat, for example, or need a special binary executable??
  http://www.laliluna.de/articles/tomcat-startup-script-linux.html
 
  I want to may will use chkconfig, like an standar service.
 
  The chkconfig script part is easy, just look in /etc/rc.d/init.d, steal
  an existing service's script, and modify it to run what you want.  Note
  the commented line at the top starting with chkconfig - that
  information specifies the run levels chkconfig will set it up to be
  activated in, and the startup/shutdown priority.
 
  As for the code you run, that gets trickier.  All the startup scripts do
  is start and stop things.  Those things could be more scripts,
  executables, or combinations thereof.  Areas to pay attention to with
  your code (to get it to behave nicely when run this way) include:
  getting it daemonized properly (dropping and/or redirecting IO streams),
  privilege seperation (can it run as a non privleged user?  if so, do
  that, if not, be really careful and have only the bare minimum code run
  with elevated privileges), logging (have it log status information,
  ideally with customizeable log levels, to the appropriate place), and
  signal handling so it shuts down cleanly when told to, reloads
  configuration files if asked, etc.
 

 There is also libdaemon which is meant to facilitate converting your
 program into a proper daemon (not tried it, though).  BTW: It is a shame
 that SL does not contain the start-stop-daemon like Gentoo or Ubuntu
 (
 http://manpages.ubuntu.com/manpages/dapper/en/man8/start-stop-daemon.8.html
 ).
 It makes converting arbitrary executables into daemons a matter of minutes.

 Regards,
 Florian Philipp




-- 
Pablo Cavero
System Engineer
+569 8920 9509