|
From: EXT-Smith, E. M <eri...@bo...> - 2003-12-05 16:17:20
|
Grant,
> I'm not happy about having to have a port open=20
> (even on a local interface) would it be much=20
> work to change the code (both Linux and Java)=20
> to watch a file rather than a TCP port ? I'm=20
> thinking of making changes to Wrapper to support=20
> such a mode so that it doesn't need networking=20
> started before it can run Java apps.
I had many of the same concerns while working on startup; however, I =
chose a solution that doesn't alter wrapper at all and provides me the =
same basic capabilities. I wrote my own startup scripts and customized =
them for my system.
e.g: (This is the header for my startup script)
#!/bin/sh
#
# wrapper_start This shell script takes care of starting and stopping
# the wrapper services.
#
# chkconfig: 345 96 04
# description:=20
# probe: true
# config: /etc/sysconfig/wrapperservices/wrapper_environment
=
#------------------------------------------------------------------------=
-----
# These settings can be modified to fit the needs of your application
=09
# Load management functions and networking routines.
[ ! -f /etc/init.d/functions ] && exit 0
. /etc/init.d/functions
[ ! -f /etc/sysconfig/network ]; && exit 0
. /etc/init.d/network
# Check that networking is up.
[ ${NETWORKING} =3D "no" ] && exit 0
>>> ( The rest of the file prepares for and calls the service launcher =
routines. ) <<<
The important lines are the check for [ ${NETWORKING} =3D "no" ] and the =
# chkconfig.
First, since networking starts relatively early (start sequence 45 on my =
box), I have set the start sequence number very high for my wrapper =
(96). This way, my wrapper will only start after networking has had =
it's chance.
Second, the check for $NETWORKING (taken directly from the Mandrake =
startup script for NFS), will terminate the script if the networking =
isn't started. This combined with the first check makes sure my =
services that need networking (i.e. all wrappered services) only start =
when all of their underlying components are ready.
The nice thing about the Windows Service Control Manager is the =
dependency capabilities (if s1 needs s2, make sure you start s2 before =
s1...). This can be done using shell scripts and some dependency =
information.
Eric
|