From owner-freebsd-questions@FreeBSD.ORG Wed Dec 24 15:46:33 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2386016A4CE for ; Wed, 24 Dec 2003 15:46:33 -0800 (PST) Received: from Vitsch.net (b74143.upc-b.chello.nl [212.83.74.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47ED843D45 for ; Wed, 24 Dec 2003 15:46:30 -0800 (PST) (envelope-from Danovitsch@Vitsch.net) Received: from FreeBSD.Danovitsch.LAN (b83007.upc-b.chello.nl [212.83.83.7]) by Vitsch.net (8.12.3p2/8.11.3) with ESMTP id hBONkPXe097859; Thu, 25 Dec 2003 00:46:26 +0100 (CET) (envelope-from Danovitsch@Vitsch.net) Content-Type: text/plain; charset="iso-8859-1" From: "Daan Vreeken [PA4DAN]" To: "gffds fsdff" Date: Thu, 25 Dec 2003 00:47:08 +0100 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200312250047.08843.Danovitsch@Vitsch.net> cc: FreeBSD-questions@FreeBSD.org Subject: Re: The Booting Process X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Dec 2003 23:46:33 -0000 On Thursday 25 December 2003 00:25, gffds fsdff wrote: > Is there a way, when booting, to have an application launch? > Ex: > exec /usr/servers/bots/zDSBot3/zDSBot3 & Have a look at /usr/local/etc/rc.d All scripts that are executable and end in ".sh" in that directory get=20 executed at boot-time. You could create your own scripts in that director= y=20 that starts your application. On boot the scripts are executed with the first agrument being "start". O= n=20 shutdown the scripts are executed with "stop" as first argument. By check= ing=20 the argument in your script you can determine if you should start the=20 application or not. (Don't start it at shutdown :) A simple rc.d-script could look something like this : --- cut here --- #!/bin/sh case "$1" in start) =09/some/dir/some-app && echo -n ' some-app' ;; stop) ;; *) echo "Usage: `basename $0` {start|stop}" >&2 ;; esac exit 0 --- cut here --- The "echo -n" line is the output you see when you boot your system after = : "Local package initialization :" This only works on applications that daemonize (dissapear into the backgr= ound=20 when you start them). If your program doesn't daemonize, you should start= it=20 with an "&" sign behind it... grtz, Daan