Date: Wed, 6 Feb 2008 16:54:47 +0100 From: "Zbigniew Szalbot" <zszalbot@gmail.com> To: freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: script to be executed on system startup. Message-ID: <94136a2c0802060754k601dcd87x464e32a5453c9c4b@mail.gmail.com> In-Reply-To: <20080206154858.GD18883@gizmo.acns.msu.edu> References: <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <fochm5$gre$1@ger.gmane.org> <20080206163423.E4029@wojtek.tensor.gdynia.pl> <94136a2c0802060739l4cd1b290wc720339737079bb1@mail.gmail.com> <20080206154858.GD18883@gizmo.acns.msu.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello, 2008/2/6, Jerry McAllister <jerrymc@msu.edu>: > On Wed, Feb 06, 2008 at 04:39:40PM +0100, Zbigniew Szalbot wrote: > > > Hello, > > > > 2008/2/6, Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>: > > > > (for example: "/etc/rc.d/myscript") > > > > 2. chmod a+x the script > > > > 3. you're done. > > > > > > > > This will work for the recent versions of FreeBSD (you didn't say for > > > > which version do you need it). > > > > > > you need to make that script react for "start" and "stop" commands at > > > least > > > > I just symlinked my sh script to /usr/local/etc/rc.d/ and it works > > quite well without even touching rc.conf. > > If your script dosn't have need of any information or configuration > from outside, then you don't need to put anything in /etc/rc.conf. > But, it is available if you need it. > > As for start and stop, the system will pass start on a bootup and > stop on a shutdown. It is appropriate to check at least for start > in your script and only startup if it is set so you don't try to start > it at shutdown. But, if there is something you would like to do > at shutdown, then also make a section of the script for shutdown and > then check for 'stop' and run that part when it is present and 'start' > is not present. If both are set, then it is a bad error somewhere. Thank you Jerry - I find your posts very informative and valuable! As for my api, all other configs are defined in a separate properties file (including when and how it should die/stop), so it is enough for me. Zbigniew Szalbot
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?94136a2c0802060754k601dcd87x464e32a5453c9c4b>