* [gentoo-dev] java and start-stop-daemon [repost]
@ 2006-08-22 7:42 paul kölle
2006-08-22 9:54 ` Roy Marples
0 siblings, 1 reply; 3+ messages in thread
From: paul kölle @ 2006-08-22 7:42 UTC (permalink / raw
To: gentoo-dev
[posted on gentoo-java without luck, I hope those rc-stuff questions are
not too off topic here...]
Hi all,
I'm trying to write a startup script for helma (http://helma.org) but
start-stop-daemon gives me trouble here (I briefly looked at the jboss
and jetty scripts but they don't use start-stop-daemon). As far as I can
tell I run the exact same command from my init-script and via
commandline, nevertheless the former fails with no error and the one
issued from the prompt succeeds. Is java+start-stop-daemon a no-go?
works from command prompt:
gentoo ~ # start-stop-daemon -v --start --chuid helma --background
--pidfile /var/run/helma-default.pid --make-pidfile --startas
/opt/sun-jdk-1.5.0.08/bin/java -- -Djava.headless=True -Xmx64m -Xms64m
-jar /opt/helma-1.5.1/launcher.jar -h /opt/helma-1.5.1/ -w 8080
-> app is running
gentoo ~ # /etc/init.d/helma start
* Starting checkconfig with instance default
* This is passed to java: -Djava.headless=True -Xms64m -Xmx64m -jar
/opt/helma-1.5.1/launcher.jar -h /opt/helma-1.5.1/ -w 8080
* Starting helma instance default. ...
Starting /opt/sun-jdk-1.5.0.08/bin/java...
Detatching to start /opt/sun-jdk-1.5.0.08/bin/java...done.
[ ok ]
-> app not running
I'm mostly interested in changing the user at startup and pid file
handling. If start-stop-daemon won't work I'd need to add sudo to
RDEPEND and grab the PID from "ps U" or similar... I'd prefer doing it
in a more "standard" way though.
thanks
Paul
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] java and start-stop-daemon [repost]
2006-08-22 7:42 [gentoo-dev] java and start-stop-daemon [repost] paul kölle
@ 2006-08-22 9:54 ` Roy Marples
2006-08-22 12:21 ` paul kölle
0 siblings, 1 reply; 3+ messages in thread
From: Roy Marples @ 2006-08-22 9:54 UTC (permalink / raw
To: gentoo-dev
On Tuesday 22 August 2006 08:42, paul kölle wrote:
> works from command prompt:
> gentoo ~ # start-stop-daemon -v --start --chuid helma --background
> --pidfile /var/run/helma-default.pid --make-pidfile --startas
> /opt/sun-jdk-1.5.0.08/bin/java -- -Djava.headless=True -Xmx64m -Xms64m
> -jar /opt/helma-1.5.1/launcher.jar -h /opt/helma-1.5.1/ -w 8080
>
> -> app is running
>
>
> gentoo ~ # /etc/init.d/helma start
> * Starting checkconfig with instance default
> * This is passed to java: -Djava.headless=True -Xms64m -Xmx64m -jar
> /opt/helma-1.5.1/launcher.jar -h /opt/helma-1.5.1/ -w 8080
> * Starting helma instance default. ...
> Starting /opt/sun-jdk-1.5.0.08/bin/java...
> Detatching to start /opt/sun-jdk-1.5.0.08/bin/java...done.
> [ ok ]
>
> -> app not running
>
> I'm mostly interested in changing the user at startup and pid file
> handling. If start-stop-daemon won't work I'd need to add sudo to
> RDEPEND and grab the PID from "ps U" or similar... I'd prefer doing it
> in a more "standard" way though.
What is /opt/sun-jdk-1.5.0.08/bin/java ? Does it change it's process name at
all? Maybe you need to use the --name option.
I ask as for init scripts we have a bash wrapper around s-s-d that is a lot
more strict than s-s-d itself. For example it should only be used for
daemons - ie what you call is expected to be a daemon. Thus it is useless for
shell scripts that call daemons. See the courier-imap fiasco for details on
this.
For hints on what we do, checkout /lib/rcscripts/sh/rc-daemon.sh
Thanks
--
Roy Marples <uberlord@gentoo.org>
Gentoo/Linux Developer (baselayout, networking)
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] java and start-stop-daemon [repost]
2006-08-22 9:54 ` Roy Marples
@ 2006-08-22 12:21 ` paul kölle
0 siblings, 0 replies; 3+ messages in thread
From: paul kölle @ 2006-08-22 12:21 UTC (permalink / raw
To: gentoo-dev
Roy Marples wrote:
> On Tuesday 22 August 2006 08:42, paul kölle wrote:
[ snipp ]
>> Starting /opt/sun-jdk-1.5.0.08/bin/java...
>> Detatching to start /opt/sun-jdk-1.5.0.08/bin/java...done.
>> [ ok ]
>>
>> -> app not running
>>
>> I'm mostly interested in changing the user at startup and pid file
>> handling. If start-stop-daemon won't work I'd need to add sudo to
>> RDEPEND and grab the PID from "ps U" or similar... I'd prefer doing it
>> in a more "standard" way though.
>
> What is /opt/sun-jdk-1.5.0.08/bin/java ? Does it change it's process name at
> all? Maybe you need to use the --name option.
Hmm, I think it is the java "interpreter" and it doesn't seem to change
its name. "cat /proc/<pid>/stat shows "java" as the process name, so
--name would be the same for all running java apps.
[...poking around..]
Ok, fixed ;) Apparently s-s-d doesn't like linebreaks (not even escaped)
between "--startas $command", and "-- $args".
>
> I ask as for init scripts we have a bash wrapper around s-s-d that is a lot
> more strict than s-s-d itself. For example it should only be used for
> daemons - ie what you call is expected to be a daemon. Thus it is useless for
> shell scripts that call daemons. See the courier-imap fiasco for details on
> this.
I'm pretty sure I do not understand the details here ;) I just thought
about s-s-d as something you can use as a wrapper for backgrounding and
pid stuff...
thanks again,
Paul
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-08-22 12:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-22 7:42 [gentoo-dev] java and start-stop-daemon [repost] paul kölle
2006-08-22 9:54 ` Roy Marples
2006-08-22 12:21 ` paul kölle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox