Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Feb 2008 10:37:11 -0500
From:      Jerry McAllister <jerrymc@msu.edu>
To:        Pietro Cerutti <gahr@gahr.ch>
Cc:        navneet Upadhyay <navneet.upadhyay@gmail.com>, User Questions <freebsd-questions@freebsd.org>
Subject:   Re: script to be executed on system startup.
Message-ID:  <20080206153711.GB18883@gizmo.acns.msu.edu>
In-Reply-To: <47A9C2A2.1070100@gahr.ch>
References:  <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <47A9C2A2.1070100@gahr.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 06, 2008 at 03:22:26PM +0100, Pietro Cerutti wrote:

> navneet Upadhyay wrote:
> > Hi,
> 
> Hello,
> 
> >       I have a script file, i want that script to be executed on system
> > startup.
> > 
> >  I am doing this on Linux in following two steps : -
> > 
> > 1. Copying the script to /etc/rc.d directory.
> > 2. /sbin/chkconfig --add "scriptname"
> > 
> > 
> > I want to achieve the same on FreeBSD
> > 
> > chckconfig file is not present, documentation says i have to add it to
> > rc.conf file.
> > 
> > How can i add it to rc.conf file, is there any command?
> 
> you just edit rc.conf and you add a line in the form
> 
> <your_script_name>_enable="YES"
> 
> Then you place the script <your_script_name> in /usr/local/etc/rc.d
> 
> at the bottom of the rc(8) man page there are a few examples on how to
> build such a script.

One more thing that may seem obvious, but is easy to forget.
The script must have execute permission set on the file.

////jerry


> -- 
> Pietro Cerutti
> 
> PGP Public Key:
> http://gahr.ch/pgp





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