From owner-freebsd-questions@FreeBSD.ORG Tue Oct 18 15:44:13 2005 Return-Path: X-Original-To: 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 4532716A41F for ; Tue, 18 Oct 2005 15:44:13 +0000 (GMT) (envelope-from algould@datawok.com) Received: from smtpauth08.mail.atl.earthlink.net (smtpauth08.mail.atl.earthlink.net [209.86.89.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED96D43D45 for ; Tue, 18 Oct 2005 15:44:12 +0000 (GMT) (envelope-from algould@datawok.com) Received: from [206.255.31.21] (helo=grokwell.org) by smtpauth08.mail.atl.earthlink.net with asmtp (TLSv1:AES256-SHA:256) (Exim 4.34) id 1ERtdI-0001hG-0b; Tue, 18 Oct 2005 11:44:08 -0400 Date: Tue, 18 Oct 2005 10:44:52 -0500 From: "Andrew L. Gould" To: "Foo JH" Message-ID: <20051018104452.1d70f831@grokwell.org> In-Reply-To: <001c01c5d3f9$69b0f790$640a0a0a@gypsy> References: <001c01c5d3f9$69b0f790$640a0a0a@gypsy> X-Mailer: Sylpheed-Claws 1.9.11 (GTK+ 2.6.8; i386-portbld-freebsd5.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-ELNK-Trace: ee791d459e3d6817d780f4a490ca69563f9fea00a6dd62bc04e8160faa2b66370adcced59187ce63350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 206.255.31.21 Cc: questions@freebsd.org Subject: Re: why my daemon did not start 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: Tue, 18 Oct 2005 15:44:13 -0000 On Tue, 18 Oct 2005 23:34:15 +0800 "Foo JH" wrote: > Hi all, I'm trying to write a simple RC script to run my little Perl > script as a daemon. The script is as follows: > > #!/bin/sh > > portal_enable=${portal_enable-"NO"} > portal_flags=${portal_flags-""} > portal_pidfile="/var/run/portald.pid" > > . /etc/rc.subr > > name="portald" > rcvar=`set_rcvar` > command="/home/admin/perfectportal/portald.pl &" > > load_rc_config $name > pidfile="${portal_pidfile}" > start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} > ${portal_flags} ${command_args}" stop_cmd="kill `cat /var/run/ > portald.pid`" run_rc_command "$1" > > If I were to run this manually via > /usr/local/etc/rc.d/portald.sh start > it works. but in a reboot, it does not start. > > Can anyone guide me where to find the error message, or (even better) > what may be the problem? Thanks. I haven't studied up on the rc.subr stuff; but I've noticed that many of the scripts that use it require that an enable line be put in /etc/ rc.conf. Have you tried adding the following line to /etc/rc.conf: portal_enable="YES" Best of luck, Andrew Gould