* [gentoo-user] daemon start up problem
@ 2006-02-08 16:04 K. Mike Bradley
2006-02-09 4:54 ` Ryan Tandy
0 siblings, 1 reply; 5+ messages in thread
From: K. Mike Bradley @ 2006-02-08 16:04 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]
Here is the script:
#!/bin/sh
# description: Start or stop WebServer as a daemon
INSTALL_DIR='/opt/WebCTRL3.0'
SYSTEM=`uname -rsv`
#
# Set up configuration based on system type
# If not listed, then not supported
#
case $SYSTEM in
"SunOS 5."*)
SYSTYPE="Solaris 2.x"
JREPATH='./java/solaris/jre/bin/java'
;;
"Linux"*)
SYSTYPE="Linux"
JREPATH='./java/linux/jre/bin/java'
;;
*)
echo Unknown or unsupport operating system type
echo "Operating system type: $SYSTEM"
echo
echo Aborting.
exit 1
;;
esac
CJARGS='-Dservice.port=8282 -cp classes/common:lib/cjcommon.jar'
LOCK_FILE=/var/lock/subsys/cjgreenserver
if test -w "$INSTALL_DIR"
then
cd $INSTALL_DIR
fi
case "$1" in
start)
$JREPATH $CJARGS CJLauncher WEBSRV </dev/null >/dev/null 2>&1 &
wcPid=$!;
sleep 5
$JREPATH $CJARGS CJLauncher waitforstarted
if [ "$2" == "-wait" ]
then
echo $wcPid > /webctrl/tmp/wcPid.txt
fi
# Create lock file for several versions of Linux
# (RedHat, SuSE, Mandrake, etc).
if test -w /var/lock/subsys
then
touch $LOCK_FILE
fi
;;
stop)
$JREPATH $CJARGS CJLauncher stopservice
# Delete lock file for RedHat, SuSE, Mandrake, etc.
if test -f $LOCK_FILE
then
rm $LOCK_FILE
fi
;;
*)
echo "Usage: $0 { start | stop }"
;;
esac
exit 0
[-- Attachment #2: Type: text/html, Size: 3704 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] daemon start up problem
2006-02-08 16:04 [gentoo-user] daemon start up problem K. Mike Bradley
@ 2006-02-09 4:54 ` Ryan Tandy
0 siblings, 0 replies; 5+ messages in thread
From: Ryan Tandy @ 2006-02-09 4:54 UTC (permalink / raw
To: gentoo-user
K. Mike Bradley wrote:
> Here is the script:
>
>
>snip<
You haven't read the documentation for Gentoo rc-scripts. This script
was likely developed for a different distribution, for example Debian.
Gentoo rc-scripts require, in addition to start() and stop(), a
checkconfig() function that lets the rc services know what services this
one requires. You'll need to either manually figure out the
dependencies and add a checkconfig(), or simply add 'webservice.sh start
&' to /etc/conf.d/local.start and 'webservice.sh stop &' to
/etc/conf.d/local.stop as another poster recommended.
To learn more about rc-scripts and their required functions, run
'/etc/init.d/webservice.sh help' (or any service in /etc/init.d).
Also, the script as provided seems to expect to be run from a certain
CWD with your JRE relative to there. This is unlikely to work on
Gentoo, especially given Gentoo's use of java-config to support
different JREs.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-user] daemon start up problem
@ 2006-02-08 15:08 K. Mike Bradley
2006-02-08 15:36 ` Patrick Börjesson
0 siblings, 1 reply; 5+ messages in thread
From: K. Mike Bradley @ 2006-02-08 15:08 UTC (permalink / raw
To: gentoo-user
Hello,
I am running latest Gentoo.
I want to start my app as a daemon.
This app has a script to do so.
webservice.sh
I copied this file to /etc/init.d/
I made a link:
/etc/runlevels/default/webctrl ---> /etc/init.d/webservice.sh
If I start manually it's ok:
/etc/init.d/webservice.sh start
But when I re-boot I get:
*WARNING: /etc/init.d/webctrl missing ... Skipping [ok]
If I run:
nano /etc/runlevels/default/webctrl
I get the webservice.sh that the link points to.
Please help.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] daemon start up problem
2006-02-08 15:08 K. Mike Bradley
@ 2006-02-08 15:36 ` Patrick Börjesson
2006-02-08 15:49 ` K. Mike Bradley
0 siblings, 1 reply; 5+ messages in thread
From: Patrick Börjesson @ 2006-02-08 15:36 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]
On 2006-02-08 10:08, K. Mike Bradley uttered these thoughts:
> Hello,
> I am running latest Gentoo.
> I want to start my app as a daemon.
> This app has a script to do so.
>
> webservice.sh
>
> I copied this file to /etc/init.d/
>
> I made a link:
>
> /etc/runlevels/default/webctrl ---> /etc/init.d/webservice.sh
>
> If I start manually it's ok:
>
> /etc/init.d/webservice.sh start
>
> But when I re-boot I get:
>
>
> *WARNING: /etc/init.d/webctrl missing ... Skipping [ok]
I would imagine that the init system of Gentoo expects the links in
/etc/runlevels/... to have the same name as the script they link to.
So to get proper behaviour:
ln -sf /etc/init.d/webservice.sh /etc/runlevels/default/webservice.sh
(or "rc-update add webservice.sh default")
Then remove /etc/runlevels/default/webctrl
That should fix it...
--
/ Patrick Börjesson
\ -------------------
/ () The ASCII Ribbon Campaign - against HTML Email
\ /\ and proprietary formats.
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [gentoo-user] daemon start up problem
2006-02-08 15:36 ` Patrick Börjesson
@ 2006-02-08 15:49 ` K. Mike Bradley
0 siblings, 0 replies; 5+ messages in thread
From: K. Mike Bradley @ 2006-02-08 15:49 UTC (permalink / raw
To: gentoo-user
I tried rc-update originally but got an error message which is why I
manually made the link.
I removed the webctrl link and rc-update as you detailed and it worked this
time, but ...
When I boot I get:
Usage: /sbin/rc { start | stop}
And the service is not running.
Could this be a script error in the webservice.sh provided by the app
vendor?
Thanks for all your help.
-----Original Message-----
From: Patrick Börjesson [mailto:psycho@rift.ath.cx]
Sent: Wednesday, February 08, 2006 10:37 AM
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] daemon start up problem
On 2006-02-08 10:08, K. Mike Bradley uttered these thoughts:
> Hello,
> I am running latest Gentoo.
> I want to start my app as a daemon.
> This app has a script to do so.
>
> webservice.sh
>
> I copied this file to /etc/init.d/
>
> I made a link:
>
> /etc/runlevels/default/webctrl ---> /etc/init.d/webservice.sh
>
> If I start manually it's ok:
>
> /etc/init.d/webservice.sh start
>
> But when I re-boot I get:
>
>
> *WARNING: /etc/init.d/webctrl missing ... Skipping [ok]
I would imagine that the init system of Gentoo expects the links in
/etc/runlevels/... to have the same name as the script they link to.
So to get proper behaviour:
ln -sf /etc/init.d/webservice.sh /etc/runlevels/default/webservice.sh
(or "rc-update add webservice.sh default")
Then remove /etc/runlevels/default/webctrl
That should fix it...
--
/ Patrick Börjesson
\ -------------------
/ () The ASCII Ribbon Campaign - against HTML Email
\ /\ and proprietary formats.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-02-09 5:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-08 16:04 [gentoo-user] daemon start up problem K. Mike Bradley
2006-02-09 4:54 ` Ryan Tandy
-- strict thread matches above, loose matches on Subject: below --
2006-02-08 15:08 K. Mike Bradley
2006-02-08 15:36 ` Patrick Börjesson
2006-02-08 15:49 ` K. Mike Bradley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox