[ELDK] Running a server: init or script?

Detlev Zundel dzu at denx.de
Fri Jul 4 10:52:55 CEST 2008


Hi Giuseppe,

> how should I start a server (for example, a web server or a ftp 
> server) on a linux box based on ELDK 4.1 SELF ramdisk?

Nobody knows what you "should" do.  This depends on your requirements.

> One option is init, by using respawn action: in this way the server 
> is automatically restarted if it dies (for a bug or something else..)
>
> The other option is a script started by init with sysinit action. In 
> this way the server isn't automatically restarted if it dies for any 
> reason.
>
>
> I'd use the first solution (init), but I see that modern distribution 
> (like Debian or Ubuntu) doesn't use init to start servers, but uses 
> scripts in /etc/init.d or something similar.

Think about what you need.  If you always need the webserver, i.e. if it
is an integral part of your device, then use init + respawn.  This way
you are even protected against webserver crashes.

If on the other hand the webserver is an optional service, i.e. there
are times where the service is not allowed to run (for example due to
memory constraints during an update, etc.), then init is not the natural
choice.

Because of this optional nature, most services on desktop machines are
not started by init + respawn.

Cheers
  Detlev

-- 
Every generation laughs at the old fashions, but follows religiously
the new.
                                        -- Henry David Thoreau
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the eldk mailing list