Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 May 1997 14:16:56 -0700
From:      Jeff Newton <jeff@datapark.com>
To:        freebsd-questions@FreeBSD.ORG
Cc:        Daniel Zborovski <daniel@moonlighting.net>
Subject:   Re: running a program on startup
Message-ID:  <336E4E48.BEC@datapark.com>
References:  <Pine.UW2.3.95.970505132332.5249G-100000@cedb>

next in thread | previous in thread | raw e-mail | index | archive | help
Dan Busarow wrote:
> 
> On Mon, 5 May 1997, Daniel Zborovski wrote:
> > Is there a way to run a program on startup.  As it is now everytime I
> > want to start my apache server I need to type:
> >
> > /usr/local/apache_1.1.1/src/httpd -f
> > /usr/local/apache_1.1.1/conf/http.conf
> 
> For 2.1.5R and up, create the directory
> 
>         /usr/local/etc/rc.d
> 
> When the system boots it looks for files with a .sh extension
> in this directory and executes them.  So you want to create
> a file named /usr/local/etc/rc.d/apache.sh containing
> 
> #!/bin/sh
> /usr/local/apache_1.1.1/src/httpd -f /usr/local/apache_1.1.1/conf/http.conf
> 
> Chmod +x it and you are all set.
> 

Or simply add /usr/local/apache_1.1.1/src/httpd -f to /etc/rc.local

Creating a /usr/local/etc/rc.d directory and seperate scripts is perhaps
a little cleaner (sys V style) but I find /etc/rc.local just as
managable.

Cheers,

-- 
Jeff Newton
Network Administrator
Tantalus Communications
Datapark Advanced Communications
(604) 664-7454
-----------------
"It's the world, not a call I can screen out"- Headstones



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?336E4E48.BEC>