[Techtalk] killproc
Andreas Berglund
andreas.berglund at home.se
Wed Jan 3 00:03:05 UTC 2007
Maria McKinley wrote:
> Hi there,
>
Hi!
> I run debian, and I have a script I want to stick in /etc/init.d/, but
> it calls the function killproc, which does not seem to be available in
> the debian package system. Does anyone know how killproc works, and how
> I can re-write the line using kill?
>
> killproc $MATHLM_BINARY 15
>
> This same script calls . /etc/init.d/functions, which looks like it is a
> redhat thing, and commenting it out seems to have no ill effect.
>
> Finally, this line:
> [ ${NETWORKING} = "no" ] && exit 1
>
> causes this error:
>
> /etc/init.d/mathlm: line 24: [: =: unary operator expected
What you need to do is enclose ${NETWORKING} in quotes.
The reason for this is that NETWORKING is defined in
/etc/sysconfig/network which you don't have on a debian system. This
means that the variable you are trying to test is the empty string and
the test is expanded to [ = "no" ] which is not a valid condition.
regards
Andreas
More information about the Techtalk
mailing list