🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2248

Re: Starting process as Service

#2248
From: kkaal
Date: Sat, 07 Apr 2001 15:47
68 lines
3200 bytes
Thank you, Joi, it helped me a lot!

Klaus

"Joi Ellis [TeamB]" <joi@aravox.com> schrieb im Newsbeitrag
news:3ace43b3_1@dnews...
> kkaal <kkaal@t-online.de> wrote:
> > Joi,
> > I really tried hard to find a daemon routine - no success. As I am not
> > experienced on linux, I have no idea how to make my program a daemon
> > process. But I have to make it.
> > Any other idea???
>
> Here's a simple system startup script I created for launching tomcat at
boot
> time on my development machine.
>
> [joi@joi init.d]$ more /etc/rc.d/init.d/tomcat
>
> #!/bin/sh
> export JAVA_HOME=/usr/local/java/jdk1.3
> export TOMCAT_HOME=/usr/local/src/jakarta-tomcat-3.2.1
> #su - nobody -c "$TOMCAT_HOME/bin/tomcat.sh $@"
> $TOMCAT_HOME/bin/tomcat.sh $@
>
> This runs tomcat as root. (Not a good idea, but this is my private
development
> machine.)  You'd want to use the 'su' variant and replace 'nobody' with
the
> username under which your daemon should run, assuming it isn't root.
>
> The 'daemon' thing I mentioned before is a shell script function found
> in file /etc/rc.d/init.d/functions.  It is called from many of Red Hat's
> system startup scripts in /etc/rc.d/init.d. I could probably have written
> my own script as (untested):
>
> #!/bin/sh
>
> .. /etc/rc.d/init.d/functions
>
> export JAVA_HOME=/usr/local/java/jdk1.3
> export TOMCAT_HOME=/usr/local/src/jakarta-tomcat-3.2.1
>
> case "$1" in
>   start)
>     echo -n "Starting tomcat: "
>     daemon $TOMCAT_HOME/bin/tomcat.sh $@
>     ;;
>   stop)
>     echo -n "Shutting down tomcat: "
>     killproc tomcat
>     ;;
>   restart)
>     $0 stop
>     $0 start
>     ;;
>   *)
>     echo "Usage: $0 {start|stop|restart}"
>     exit 1
> esac
>
> exit 0
>
> --
> Joi Ellis (TeamB)
> No direct email, please.
> For best results, post on news server newsgroups.borland.com!
> Newsgroup Info: http://www.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <9ancvi$4cp$02$1@news.t-online.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!btnet-peer!btnet!diablo.netcom.net.uk!netcom.net.uk!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail
References: <9adbit$sqk$06$1@news.t-online.com> <3aca39b1_2@dnews> <3acadd42_2@dnews> <3acb2f33_2@dnews> <9akmtb$gh6$05$1@news.t-online.com> <3ace43b3_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,aa0d76ffc55efaf3
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-04-07 08:52:05 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!btnet-peer!btnet!diablo.netcom.net.uk!netcom.net.uk!newsfeed.icl.net!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail
From: "kkaal" <kkaal@t-online.de>
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: Starting process as Service
Date: Sat, 7 Apr 2001 17:47:38 +0200
Organization: T-Online
Lines: 70
Message-ID: <9ancvi$4cp$02$1@news.t-online.com>
References: <9adbit$sqk$06$1@news.t-online.com> <3aca39b1_2@dnews> <3acadd42_2@dnews> <3acb2f33_2@dnews> <9akmtb$gh6$05$1@news.t-online.com> <3ace43b3_1@dnews>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.t-online.com 986658610 02 4505 mweSSAGSS-YBez 010407 15:50:10
X-Complaints-To: abuse@t-online.com
X-Sender: 520067114078-0001@t-dialin.net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400