Date: Wed, 28 Aug 2002 12:42:52 +0300 From: Ari Suutari <ari.suutari@syncrontech.com> To: dan_256@yahoo.com, Greg Lewis <glewis@eyesbeyond.com>, Ernst de Haan <znerd@FreeBSD.ORG> Cc: dan_256@yahoo.com, K.J.Koster@kpn.com, freebsd-java@FreeBSD.ORG Subject: Re: Jboss3ctl update (I think I know the problem) Message-ID: <200208281242.52123.ari.suutari@syncrontech.com> In-Reply-To: <20020828091158.46733.qmail@web13403.mail.yahoo.com> References: <20020828091158.46733.qmail@web13403.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--------------Boundary-00=_GBSJCVQZOH4PP5NTH4AB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, On Wednesday 28 August 2002 12:11, Dan Hulme wrote: > Ari is right. This will work. Ernst, the patch is really simple. Jus= t > put the "setuid(geteuid())" in main before the strcmp. One other littl= e > bug in the daemonctl.c (from tomcat) is on line 325 where it has > "%%PORTREVISION%%" rather than "%%PORTVERSION%%" which will keep it fro= m > being replaced, and will print out something funny when you get the err= or > "[program] is already running." > > I included these changes in a daemonctl.c taken from > $portsdir/www/jakarta-tomcat4/files/. Ari, tell me if I got it wrong. =09Your code is similar to mine. Btw, I have also modified version =09of daemonctl.c which doesn't rely on replacing of strings =09during installation time. Instead, it has a separate configuration =09file for settings, ie. one has tomcat4ctl and tomcat4ctl.conf. =09I'll include the modified version also in case somebody is interested =09it. I have been using it myself, because I needed a way to =09pass other parameters to java command (like: java -Dsomething=3Dvalue = =2E...) =09The program checks under which name it has been installed=20 =09looks up the configuration file in /usr/local/etc based on that. =09(ie. tomcat4ctl read tomcat4ctl.conf and jboss3ctl reads jboss3ctl.con= f, =09they can all be the same binary, however). =09=09Ari S. --------------Boundary-00=_GBSJCVQZOH4PP5NTH4AB Content-Type: text/x-csrc; charset="iso-8859-1"; name="daemonctl.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="daemonctl.c" LyoKICogLSotIG1vZG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lub2RlID0gbm9kZS0+bmV4dDsKCX0KCglmcHJpbnRmIChzdGRl cnIsICJDb25maWd1cmF0aW9uIHZhbHVlIG1pc3NpbmcgZm9yICVzXG4iLCBuYW1lKTsKCWV4aXQg KEVSUl9DT05GSUdfTUlTU0lORyk7CglyZXR1cm4gTlVMTDsKfQoKaW50IGdldENvbmZJbnQoY2hh ciogbmFtZSkKewoJcmV0dXJuIGF0b2koZ2V0Q29uZlN0cihuYW1lKSk7CgkKfQo= --------------Boundary-00=_GBSJCVQZOH4PP5NTH4AB Content-Type: text/plain; charset="iso-8859-1"; name="tomcat4ctl.conf" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="tomcat4ctl.conf" QVBQX0hPTUU9L3Vzci9sb2NhbC9qYWthcnRhLXRvbWNhdDQuMC4zCkpBVkFfSE9NRT0vdXNyL2xv Y2FsL2pkazEuMy4xClNURE9VVF9MT0c9L3Vzci9sb2NhbC9qYWthcnRhLXRvbWNhdDQuMC4zL2xv Z3Mvc3Rkb3V0LmxvZwpTVERFUlJfTE9HPS91c3IvbG9jYWwvamFrYXJ0YS10b21jYXQ0LjAuMy9s b2dzL3N0ZGVyci5sb2cKU1RPUF9USU1FT1VUPTUKUElEX0ZJTEU9L3Zhci9ydW4vdG9tY2F0NC5w aWQKUE9SVFZFUlNJT049NC4wLjMKQVBQX1RJVExFPUpha2FydGEgVG9tY2F0CkpBVkFfQ01EPWJp bi9qYXZhCkpBUl9GSUxFPWJpbi9ib290c3RyYXAuamFyCkpBVkFfQVJHUz0tRGNhdGFsaW5hLmhv bWU9L3Vzci9sb2NhbC9qYWthcnRhLXRvbWNhdDQuMC4zCkpBUl9BUkdTPXN0YXJ0Cg== --------------Boundary-00=_GBSJCVQZOH4PP5NTH4AB-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208281242.52123.ari.suutari>