[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: init.d startup script does not exit



El dom, 14-09-2008 a las 08:46 +0200, Clifford W. Hansen escribió:
> On Sunday 14 September 2008 08:35:13 rex wrote:
> > Hello,
> >
> > I have a script that launches a program.  If I launch this program
> > manually, it keeps on running in the shell.  It is a webserver, so I
> > need it running all the time.  However, if I exit the shell, it kills
> > the webserver.
> >
> > I tried putting links to it in the rc0.d, rc1.d etc to make it start
> > during startup, but it keeps on going during startup and never starts
> > the other services.
> >
> > here is my script in /etc/init.d/coldfusion
> >
> > #!/bin/sh -e
> > sAppName="ColdFusion 8"
> > sUser=cfuser
> > COLDFUSION_HOME=/opt/jrun4
> > case "$1" in
> > start)
> > echo "Starting ${sAppName} as user $sUser..."
> > su ${sUser} -c "$COLDFUSION_HOME/bin/jrun -start instance01"
> > exit 0
> > ;;
> > stop)
> > echo "Stopping ${sAppName}..."
> > su ${sUser} -c "$COLDFUSION_HOME/bin/jrun -stop instance01"

[...]

> > It does not exit.  If this was in the startup, I would never get to the
> > user login.
> >
> > And, if I press Ctrl-C, then the program terminates, but then webserver
> > is dead.
> >
> > Any suggestions please?
> >
> > Thanks!
> >
> > - Rex
> 
> Rex,
> 
> I'm not sure if there is a better way to do this, but you could try adding a & 
> at the end of the start line:
>     su ${sUser} -c "$COLDFUSION_HOME/bin/jrun -start instance01" &

Shouldn't that be:
    su ${sUser} -c "$COLDFUSION_HOME/bin/jrun -start instance01 &"


Also, this thread deserves a loud WTF. I mean, the OP seems to know the
basics about unix administration (he was able to write a shell script,
at least) but fails at something as basic as running an app in
background.


-- 
Gabriel Parrondo
GNU/Linux User #404138
GnuPG Public Key ID: BED7BF43
JID: gabrielp@xmpp.us

"The only difference between theory and practice is that, in theory,
there's no difference between theory and practice."

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente


Reply to: