From owner-freebsd-hackers Tue Jul 30 5:26:47 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D816D37B400 for ; Tue, 30 Jul 2002 05:26:44 -0700 (PDT) Received: from www.contentmedia.de (www.contentmedia.de [213.61.138.91]) by mx1.FreeBSD.org (Postfix) with SMTP id 4062E43E3B for ; Tue, 30 Jul 2002 05:26:43 -0700 (PDT) (envelope-from marc@informatik.uni-bremen.de) Received: (qmail 4655 invoked from network); 30 Jul 2002 12:24:51 -0000 Received: from unknown (HELO leeloo.intern.geht.de) (217.227.193.74) by www.contentmedia.de with SMTP; 30 Jul 2002 12:24:51 -0000 Date: Tue, 30 Jul 2002 14:25:17 +0200 From: Marc Recht To: Vijay Patel Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to keep java code running after logout Message-Id: <20020730142517.047c9459.marc@informatik.uni-bremen.de> In-Reply-To: <20020730061600.95733.qmail@web12201.mail.yahoo.com> References: <20020730061600.95733.qmail@web12201.mail.yahoo.com> X-Mailer: Sylpheed version 0.8.1 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="H:qK1,F=.gK)c9+o" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --H:qK1,F=.gK)c9+o Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > I have installed FreeBSD 4.5 on my machine. I am also > having 2 other machines running on linux. > We have developed a code in java which we need to run > in background for 24 hrs. In linux we use... > java Code1 & > > command to run our code in background. After starting > this command we just logout from that terminal window. > We have seen that on linux machine our code works fine > in background. IIRC this depends on the shell. But IMHO it is normal behaviour that the child (your program) gets killed if the parent (the shell) got killed. You should read nohup(1). nohup is your friend. :-) But for 24x7 you could also use init(8). Under SysV you could write your program in /etc/inittab and under *BSD in /etc/ttys. So the program gets automatically started by init _and_ restarted if it crashes. --H:qK1,F=.gK)c9+o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9RoW07YQCetAaG3MRAtqaAJ9f6PkofgGONNpzfh1RKxklIcFQtwCfeGB3 B+TtpUO8Ca4OFNnkTOFLgwI= =dNqX -----END PGP SIGNATURE----- --H:qK1,F=.gK)c9+o-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message