From owner-freebsd-rc@FreeBSD.ORG Sat Oct 6 16:12:31 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83BEC16A41A for ; Sat, 6 Oct 2007 16:12:31 +0000 (UTC) (envelope-from prvs=0799e52d77=jay-b@quest4.org) Received: from zebra.esosoft.net (zebra.esosoft.net [66.241.145.10]) by mx1.freebsd.org (Postfix) with ESMTP id 6758113C468 for ; Sat, 6 Oct 2007 16:12:31 +0000 (UTC) (envelope-from prvs=0799e52d77=jay-b@quest4.org) Received: from [12.5.189.253] (helo=4BANKS) by zebra.esosoft.net with esmtpa (Exim 4.68) (envelope-from ) id 1IeBtA-0005u9-MP for freebsd-rc@freebsd.org; Sat, 06 Oct 2007 08:48:25 -0700 Message-ID: <004d01c80830$5447e770$90bd050c@4BANKS> From: "Jay Banks" To: Date: Sat, 6 Oct 2007 10:47:54 -0500 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Getting a script to run at boot X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jay Banks List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Oct 2007 16:12:31 -0000 I'm having a lot of trouble getting scripts to run on startup. It seems = like a simple concept, but I reboot and reboot and reboot, and the = script isn't running. I've had to fight with stuff before but I can = usually get it going (arpwatch, mpd, etc.). Now I'm trying to get sntop = to run now and I'm getting nowhere. Here is my sntop setup. I created /usr/local/etc/rc.d/sntop.sh (with chmod 755 as per the docs). Here is the script, which I got from the FreeBSD handbook: #!/bin/sh # # PROVIDE: sntop # REQUIRE: DAEMON # KEYWORD: shutdown #!/bin/sh # # PROVIDE: sntop # REQUIRE: DAEMON # KEYWORD: shutdown # # DO NOT CHANGE THESE DEFAULT VALUES HERE # SET THEM IN THE /etc/rc.conf FILE # sntop_enable=3D${sntop_enable-"NO"} sntop_flags=3D${sntop_flags-""} sntop_pidfile=3D${sntop_pidfile-"/var/run/sntop.pid"} . /etc/rc.subr name=3D"sntop" rcvar=3D`set_rcvar` command=3D"/usr/local/bin/sntop" load_rc_config $name pidfile=3D"${sntop_pidfile}" start_cmd=3D"echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} = ${sntop_flags } ${command_args}" run_rc_command "$1" Here is what I added to /etc/rc.conf sntop_enable=3D"YES" sntop_flags=3D"-d -r 30 -f /etc/sntoprc/sntoprc -w -e = /usr/home/mysites/www/data/e tb/index.html" If I change directory to /usr/local/etc/rc.d and do: perl sntop.sh start The sntop will start and show up running in the system processes. It = seems to refresh and all of the other flags seem to work. However, if I = close the terminal session, that's it, it's dead.=20 And if I reboot, it will not show up to be running in the system = processes. Considering that sntop would be a type of script that one would want to = make sure it is always running, I wish this could be addressed in the = man pages.=20 Also, giving my issues here, I just tried to create a cron job to run = it. That didn't work because it gets an error regarding fping. I'm really a big advocate of FreeBSD, but for the love of all things = holy, I could have a program start up on a Windows 2003 server in less = than 10 minutes.=20