Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Feb 2008 10:43:17 -0500
From:      Jerry McAllister <jerrymc@msu.edu>
To:        Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>
Cc:        navneet Upadhyay <navneet.upadhyay@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: script to be executed on system startup.
Message-ID:  <20080206154317.GC18883@gizmo.acns.msu.edu>
In-Reply-To: <20080206152833.U3736@wojtek.tensor.gdynia.pl>
References:  <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <20080206152833.U3736@wojtek.tensor.gdynia.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 06, 2008 at 03:29:14PM +0100, Wojciech Puchar wrote:

> >     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.
> 
> you have to
> 
> 1) make your own service started in /etc/rc.d (look at others for example)
> 
> 2) simply add what's needed to rc.local

No, don't add anything to rc.local.   

Putting the script in /usr/local/etc/rc.d and making it executable
is all you want to do.    

In the script it should check for being passed a 'start' or a 'stop'.
If you want to pass it other information or conditions, you may also 
want to make it to check for an environment variable which you can
set in rc.conf and have your script read up (source) rc.conf. 

////jerry

> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"



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