From owner-freebsd-questions@FreeBSD.ORG Thu Mar 23 20:45:17 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 2901016A455 for ; Thu, 23 Mar 2006 20:45:17 +0000 (UTC) (envelope-from norgaard@locolomo.org) Received: from strange.daemonsecurity.com (59.Red-81-33-11.staticIP.rima-tde.net [81.33.11.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id A307D43D8E for ; Thu, 23 Mar 2006 20:45:13 +0000 (GMT) (envelope-from norgaard@locolomo.org) Received: from [192.168.0.16] (unknown [192.168.0.16]) by strange.daemonsecurity.com (Postfix) with ESMTP id 777842E041; Thu, 23 Mar 2006 21:45:20 +0100 (CET) Message-ID: <442308D2.1050808@locolomo.org> Date: Thu, 23 Mar 2006 21:45:06 +0100 From: =?ISO-8859-1?Q?Erik_N=F8rgaard?= Organization: Locolomo.ORG User-Agent: Thunderbird 1.5 (X11/20060312) MIME-Version: 1.0 To: wc_fbsd@xxiii.com References: <6.2.5.6.2.20060323151634.033f1248@xxiii.com> In-Reply-To: <6.2.5.6.2.20060323151634.033f1248@xxiii.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: How to start a script running at boot time? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2006 20:45:17 -0000 wc_fbsd@xxiii.com wrote: > Hi, > > I have a script I would like to launch at boot time, as a non-root > user, to remain running in the background. What is the best way to > accomplish this? I looked through the rc* stuff, and it looks like > overkill for what I need, plus my scripting isn't that strong either. > > I know I can do something like: su - user -c "script_to_run" > But I don't even know what's the best place to include that. > > Any suggestions, or examples? A sample script could be /etc/rc.d/sysctl, it contains a block sysctl_start() which is executed when you run # /etc/rc.d/sysctl start Using that as a sample you can insert you custom startup code. Cheers, Erik -- Ph: +34.666334818 web: www.locolomo.org S/MIME Certificate: www.daemonsecurity.com/ca/8D03551FFCE04F06.crt Subject ID: 9E:AA:18:E6:94:7A:91:44:0A:E4:DD:87:73:7F:4E:82:E7:08:9C:72 Fingerprint: 5B:D5:1E:3E:47:E7:EC:1C:4C:C8:3A:19:CC:AE:14:F5:DF:18:0F:B9