DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 29th July 2008
starbuck's Avatar
starbuck starbuck is offline
Port Guard
 
Join Date: Apr 2008
Location: Eugene, OR
Posts: 31
Default rc.conf questions

I have a couple rc.conf questions, probably n00bish, but curious.

Can I use bash variables within rc.conf? Like:

Code:
IP="192.168.0.1"
ListenAddress $IP
Is there anyway to include another text file in rc.conf so that those commands get parsed? I'm thinking specifically jail config parameters. Or do I have to use something like "sed" to modify rc.conf directly?

Basically I want to write a bash script that will set up my jails for me (I may just end up using ezjail, but I want to try myself first).
Reply With Quote
  #2   (View Single Post)  
Old 29th July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

If you want to use shell script code, place them in /etc/rc.local and keep the code /bin/sh compliant.



A little poking around in the system will show you exactly what you can *legally* do in rc.conf -- what you should do is a bit of a different story. rc(8) and the files themselves are the best place to start in understanding the things you want to tinker with.


In regards to including other files:

Quote:
Originally Posted by rc.conf(5)
The purpose of rc.conf is not to run commands or perform system startup
actions directly. Instead, it is included by the various generic startup
scripts in /etc which conditionalize their internal actions according to
the settings found there.

The /etc/rc.conf file is included from the file /etc/defaults/rc.conf,
which specifies the default settings for all the available options.
Options need only be specified in /etc/rc.conf when the system adminis-
trator wishes to override these defaults. The file /etc/rc.conf.local is
used to override settings in /etc/rc.conf for historical reasons. See
the rc_conf_files variable below.

Options are set with ``name=value'' assignments that use sh(1) syntax.
The following list provides a name and short description for each vari-
able that can be set in the rc.conf file:
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.

Last edited by TerryP; 29th July 2008 at 12:42 AM.
Reply With Quote
  #3   (View Single Post)  
Old 29th July 2008
starbuck's Avatar
starbuck starbuck is offline
Port Guard
 
Join Date: Apr 2008
Location: Eugene, OR
Posts: 31
Default

Quote:
Originally Posted by TerryP View Post
If you want to use shell script code, place them in /etc/rc.local and keep the code /bin/sh compliant.



A little poking around in the system will show you exactly what you can *legally* do in rc.conf -- what you should do is a bit of a different story. rc(8) and the files themselves are the best place to start in understanding the things you want to tinker with.


In regards to including other files:
Hey thanks for the start! I just got into work, so I'm going to do a bit of poking through the man page for rc(8). I'll let you know if I get it worked out.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
some login.conf questions gosha OpenBSD General 2 5th July 2009 12:43 PM
pf.conf lumiwa FreeBSD Security 11 20th September 2008 01:01 AM
difference between rc.conf and loader.conf disappearedng FreeBSD General 5 3rd September 2008 05:54 AM
wine.conf bsdnewbie999 OpenBSD General 6 15th July 2008 04:08 PM
libmap.conf ccc FreeBSD General 1 20th June 2008 01:09 AM


All times are GMT. The time now is 11:22 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick