Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Feb 2008 20:03:37 +0530
From:      "navneet Upadhyay" <navneet.upadhyay@gmail.com>
To:        "Derek Ragona" <derek@computinginnovations.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: script to be executed on system startup.
Message-ID:  <1563a4fd0802060633s2bb0569cwdc9feea96709fa3c@mail.gmail.com>
In-Reply-To: <6.0.0.22.2.20080206081827.02516d20@mail.computinginnovations.com>
References:  <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <6.0.0.22.2.20080206081827.02516d20@mail.computinginnovations.com>

next in thread | previous in thread | raw e-mail | index | archive | help
i dont want to go with the rename option, as if tomorrow i want to add more
scripts to run at startup i will be in a mess.

I will tell in detail so that it would be easy for you to understand my
problem :-

Intention is that the script file should be called at both startup and
shutdown.

In Linux after doing :- 1. Copying the script to /etc/rc.d directory.
2. /sbin/chkconfig --add "scriptname"

While startup scriptfile is called with parameter *start* and while shutdown
it is called with parameter *stop.*

So i check the parameter value in the script and if it is start , i run my
executables and if it is stop i gracefully exit from my executables.


I want to achie same thing in FreeBSD.

Thanks,
Navneet




On 2/6/08, Derek Ragona <derek@computinginnovations.com> wrote:
>
>  At 08:09 AM 2/6/2008, navneet Upadhyay wrote:
>
> Hi,
>       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 don't need any command.  Depending on the version of FreeBSD, put your
> script in /usr/local/etc/rc.d and if you are using earlier than 6.XFreeBSD name the script
> chckconfig.sh
>
> You can name it in the same in 6.X and 7.X and it will work.
>
> Be sure the script is chmod'd (usually 755) to execute.  Since your script
> runs without a known environment be sure to either use full pathnames for
> executables or set the path in your script.
>
>         -Derek
>
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
> MailScanner thanks transtec Computers <http://www.transtec.co.uk/>; for
> their support.



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