Motherboard Forums


Reply
Thread Tools Display Modes

launchd and Tomcat

 
 





















Tom Davies
Guest
Posts: n/a

 
      02-11-2006, 12:28 AM


The default tomcat distribution has startup.sh and shutdown.sh shell
scripts. The startup.sh script returns once it has started Tomcat.

Is there any way to:

- use launchd with a process which forks and terminates? (I know the
launchd docs specifically say that launchd managed processes shouldn't
do that, so I'm assuming no, but thought I would ask)

- use launchd with a process which needs special shutdown handling?

Should I be wrapping Tomcat like this? (pseudocode)

startup.sh
wait for tomcat to terminate (if it dies unexpectedly, launchd will
restart it, which is good) or a signal from launchd to shut down (how
does launchd communicate that? kill -SIGINT?

if we caught a signal, run shutdown.bat

Thanks,
Tom
 
Reply With Quote
 
Tom Harrington
Guest
Posts: n/a

 
      02-11-2006, 05:00 PM
In article <>,
Tom Davies <> wrote:

> The default tomcat distribution has startup.sh and shutdown.sh shell
> scripts. The startup.sh script returns once it has started Tomcat.
>
> Is there any way to:
>
> - use launchd with a process which forks and terminates? (I know the
> launchd docs specifically say that launchd managed processes shouldn't
> do that, so I'm assuming no, but thought I would ask)


I think the "RunAtLoad" setting would handle this. However...

> - use launchd with a process which needs special shutdown handling?


I don't think so. I see that Apache has yet to be migrated to launchd
management. If you're familiar with Apache at all, the startup item
configuration at /System/Library/StartupItems/Apache/ would probably be
a useful example of doing it the "old fashioned" way.

--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT. The time now is 03:32 PM.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43