| Commit | Line | Data |
|---|---|---|
| f3ba8890 | 1 | ## 6.10 Configuration Files |
| 2 | ||
| 3 | ### 6.10.1 /etc Layout | |
| 4 | ||
| 5 | There are a number of directories in which configuration information is kept. These include: | |
| 6 | ||
| b790f880 C |
7 | [[!table data=""" |
| 8 | | `/etc` | Generic system configuration information; data here is system-specific. | |
| 9 | `/etc/defaults` | Default versions of system configuration files. | |
| f3ba8890 | 10 | `/etc/mail` | Extra [sendmail(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=sendmail§ion=8) configuration, other MTA configuration files. |
| b790f880 | 11 | `/etc/ppp` | Configuration for both user- and kernel-ppp programs. |
| 0d8beeac | 12 | `/etc/namedb` | Default location for [named(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=named§ion=8) data. Normally `named.conf` and zone files are stored here. |
| b790f880 C |
13 | `/usr/local/etc` | Configuration files for installed applications. May contain per-application subdirectories. |
| 14 | `/usr/local/etc/rc.d` | Start/stop scripts for installed applications. | |
| f3ba8890 | 15 | `/var/db` | Automatically generated system-specific database files, such as the package database, the locate database, and so on | |
| 16 | ||
| 17 | """]] | |
| 18 | ||
| 19 | ||
| 20 | ||
| 21 | ### 6.10.2 Hostnames | |
| 22 | ||
| 23 | #### 6.10.2.1 /etc/resolv.conf | |
| 24 | ||
| 25 | `/etc/resolv.conf` dictates how DragonFly's resolver accesses the Internet Domain Name System (DNS). | |
| 26 | ||
| 27 | ||
| 28 | ||
| 29 | The most common entries to `resolv.conf` are: | |
| 30 | ||
| b790f880 C |
31 | [[!table data=""" |
| 32 | | `nameserver` | The IP address of a name server the resolver should query. The servers are queried in the order listed with a maximum of three. | |
| 33 | `search` | Search list for hostname lookup. This is normally determined by the domain of the local hostname. | |
| f3ba8890 | 34 | `domain` | The local domain name. | |
| 35 | ||
| 36 | """]] | |
| 37 | ||
| 38 | ||
| 39 | ||
| 40 | A typical `resolv.conf`: | |
| 41 | ||
| 42 | ||
| 43 | ||
| b790f880 | 44 | |
| b790f880 | 45 | |
| f3ba8890 | 46 | search example.com |
| 47 | ||
| 48 | nameserver 147.11.1.11 | |
| 49 | ||
| 50 | nameserver 147.11.100.30 | |
| 51 | ||
| 52 | ||
| 53 | ||
| 54 | **Note:** Only one of the `search` and `domain` options should be used. | |
| 55 | ||
| 56 | ||
| 57 | ||
| 58 | If you are using DHCP, [dhclient(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=dhclient§ion=8) usually rewrites `resolv.conf` with information received from the DHCP server. | |
| 59 | ||
| 60 | ||
| 61 | ||
| 62 | #### 6.10.2.2 /etc/hosts | |
| 63 | ||
| 64 | `/etc/hosts` is a simple text database reminiscent of the old Internet. It works in conjunction with DNS and NIS providing name to IP address mappings. Local computers connected via a LAN can be placed in here for simplistic naming purposes instead of setting up a [named(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=named§ion=8) server. Additionally, `/etc/hosts` can be used to provide a local record of Internet names, reducing the need to query externally for commonly accessed names. | |
| 65 | ||
| 66 | ||
| 67 | ||
| b790f880 | 68 | |
| f3ba8890 | 69 | |
| 70 | # | |
| 71 | ||
| 72 | # | |
| 73 | ||
| 74 | # Host Database | |
| 75 | ||
| 76 | # This file should contain the addresses and aliases | |
| 77 | ||
| 78 | # for local hosts that share this file. | |
| 79 | ||
| 80 | # In the presence of the domain name service or NIS, this file may | |
| 81 | ||
| 82 | # not be consulted at all; see /etc/nsswitch.conf for the resolution order. | |
| 83 | ||
| 84 | # | |
| 85 | ||
| 86 | # | |
| 87 | ||
| 88 | ::1 localhost localhost.my.domain myname.my.domain | |
| 89 | ||
| 90 | 127.0.0.1 localhost localhost.my.domain myname.my.domain | |
| 91 | ||
| 92 | # | |
| 93 | ||
| 94 | # Imaginary network. | |
| 95 | ||
| 96 | #10.0.0.2 myname.my.domain myname | |
| 97 | ||
| 98 | #10.0.0.3 myfriend.my.domain myfriend | |
| 99 | ||
| 100 | # | |
| 101 | ||
| 102 | # According to RFC 1918, you can use the following IP networks for | |
| 103 | ||
| 104 | # private nets which will never be connected to the Internet: | |
| 105 | ||
| 106 | # | |
| 107 | ||
| 108 | # 10.0.0.0 - 10.255.255.255 | |
| 109 | ||
| 110 | # 172.16.0.0 - 172.31.255.255 | |
| 111 | ||
| 112 | # 192.168.0.0 - 192.168.255.255 | |
| 113 | ||
| 114 | # | |
| 115 | ||
| 116 | # In case you want to be able to connect to the Internet, you need | |
| 117 | ||
| 118 | # real official assigned numbers. PLEASE PLEASE PLEASE do not try | |
| 119 | ||
| 120 | # to invent your own network numbers but instead get one from your | |
| 121 | ||
| 122 | # network provider (if any) or from the Internet Registry (ftp to | |
| 123 | ||
| 124 | # rs.internic.net, directory `/templates'). | |
| 125 | ||
| 126 | # | |
| 127 | ||
| 128 | ||
| 129 | ||
| 130 | `/etc/hosts` takes on the simple format of: | |
| 131 | ||
| 132 | ||
| 133 | ||
| b790f880 | 134 | |
| f3ba8890 | 135 | |
| 136 | [Internet address] [official hostname] [alias1] [alias2] ... | |
| 137 | ||
| 138 | ||
| 139 | ||
| 140 | For example: | |
| 141 | ||
| 142 | ||
| 143 | ||
| 144 | ||
| 145 | ||
| 146 | 10.0.0.1 myRealHostname.example.com myRealHostname foobar1 foobar2 | |
| 147 | ||
| 148 | ||
| 149 | ||
| 150 | Consult [hosts(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=hosts§ion=5) for more information. | |
| 151 | ||
| 152 | ||
| 153 | ||
| 154 | ### 6.10.3 Log File Configuration | |
| 155 | ||
| 156 | #### 6.10.3.1 syslog.conf | |
| 157 | ||
| 158 | `syslog.conf` is the configuration file for the [syslogd(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=syslogd§ion=8) program. It indicates which types of `syslog` messages are logged to particular log files. | |
| 159 | ||
| 160 | ||
| 161 | ||
| b790f880 | 162 | |
| f3ba8890 | 163 | |
| 164 | # | |
| 165 | ||
| 166 | # | |
| 167 | ||
| 168 | # Spaces ARE valid field separators in this file. However, | |
| 169 | ||
| 170 | # other *nix-like systems still insist on using tabs as field | |
| 171 | ||
| 172 | # separators. If you are sharing this file between systems, you | |
| 173 | ||
| 174 | # may want to use only tabs as field separators here. | |
| 175 | ||
| 176 | # Consult the syslog.conf(5) manual page. | |
| 177 | ||
| 178 | ||
| 179 | *.err;kern.debug;auth.notice;mail.crit /dev/console | |
| 180 | ||
| 181 | *.notice;kern.debug;lpr.info;mail.crit;news.err /var/log/messages | |
| 182 | ||
| 183 | ||
| 184 | security.* /var/log/security | |
| 185 | ||
| 186 | mail.info /var/log/maillog | |
| 187 | ||
| 188 | lpr.info /var/log/lpd-errs | |
| 189 | ||
| 190 | cron.* /var/log/cron | |
| 191 | ||
| 192 | ||
| 193 | *.err root | |
| 194 | ||
| 195 | *.notice;news.err root | |
| 196 | ||
| 197 | *.alert root | |
| 198 | ||
| 199 | *.emerg * | |
| 200 | ||
| 201 | ||
| 202 | # uncomment this to log all writes to /dev/console to /var/log/console.log | |
| 203 | ||
| 204 | #console.info /var/log/console.log | |
| 205 | ||
| 206 | # uncomment this to enable logging of all log messages to /var/log/all.log | |
| 207 | ||
| 208 | #*.* /var/log/all.log | |
| 209 | ||
| 210 | # uncomment this to enable logging to a remote log host named loghost | |
| 211 | ||
| 212 | #*.* @loghost | |
| 213 | ||
| 214 | # uncomment these if you're running inn | |
| 215 | ||
| 216 | # news.crit /var/log/news/news.crit | |
| 217 | ||
| 218 | # news.err /var/log/news/news.err | |
| 219 | ||
| 220 | # news.notice /var/log/news/news.notice | |
| 221 | ||
| 222 | !startslip | |
| 223 | ||
| 224 | ||
| 225 | *.* /var/log/slip.log | |
| 226 | ||
| 227 | !ppp | |
| 228 | ||
| 229 | ||
| 230 | *.* /var/log/ppp.log | |
| 231 | ||
| 232 | ||
| 233 | ||
| 234 | Consult the [syslog.conf(5)](http://leaf.dragonflybsd.org/cgi/web-man?command=syslog.conf§ion=5) manual page for more information. | |
| 235 | ||
| 236 | ||
| 237 | ||
| 238 | #### 6.10.3.2 newsyslog.conf | |
| 239 | ||
| 240 | `newsyslog.conf` is the configuration file for [newsyslog(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=newsyslog§ion=8), a program that is normally scheduled to run by [cron(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=cron§ion=8). [newsyslog(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=newsyslog§ion=8) determines when log files require archiving or rearranging. `logfile` is moved to `logfile.0`, `logfile.0` is moved to `logfile.1`, and so on. Alternatively, the log files may be archived in [gzip(1)](http://leaf.dragonflybsd.org/cgi/web-man?command=gzip§ion=1) format causing them to be named: `logfile.0.gz`, `logfile.1.gz`, and so on. | |
| 241 | ||
| 242 | ||
| 243 | ||
| 244 | `newsyslog.conf` indicates which log files are to be managed, how many are to be kept, and when they are to be touched. Log files can be rearranged and/or archived when they have either reached a certain size, or at a certain periodic time/date. | |
| 245 | ||
| 246 | ||
| 247 | ||
| 248 | ||
| 249 | ||
| 250 | # configuration file for newsyslog | |
| 251 | ||
| 252 | # | |
| 253 | ||
| 254 | # | |
| 255 | ||
| 256 | # filename [owner:group] mode count size when [ZB] [/pid_file] [sig_num] | |
| 257 | ||
| 258 | /var/log/cron 600 3 100 * Z | |
| 259 | ||
| 260 | /var/log/amd.log 644 7 100 * Z | |
| 261 | ||
| 262 | /var/log/kerberos.log 644 7 100 * Z | |
| 263 | ||
| 264 | /var/log/lpd-errs 644 7 100 * Z | |
| 265 | ||
| 266 | /var/log/maillog 644 7 * @T00 Z | |
| 267 | ||
| 268 | /var/log/sendmail.st 644 10 * 168 B | |
| 269 | ||
| 270 | /var/log/messages 644 5 100 * Z | |
| 271 | ||
| 272 | /var/log/all.log 600 7 * @T00 Z | |
| 273 | ||
| 274 | /var/log/slip.log 600 3 100 * Z | |
| 275 | ||
| 276 | /var/log/ppp.log 600 3 100 * Z | |
| 277 | ||
| 278 | /var/log/security 600 10 100 * Z | |
| 279 | ||
| 280 | /var/log/wtmp 644 3 * @01T05 B | |
| 281 | ||
| 282 | /var/log/daily.log 640 7 * @T00 Z | |
| 283 | ||
| 284 | /var/log/weekly.log 640 5 1 $W6D0 Z | |
| 285 | ||
| 286 | /var/log/monthly.log 640 12 * $M1D0 Z | |
| 287 | ||
| 288 | /var/log/console.log 640 5 100 * Z | |
| 289 | ||
| 290 | ||
| 291 | ||
| 292 | Consult the [newsyslog(8)](http://leaf.dragonflybsd.org/cgi/web-man?command=newsyslog§ion=8) manual page for more information. | |
| 293 | ||
| 294 | ||
| 295 | ||
| 296 | ### 6.10.4 sysctl.conf | |
| 297 | ||
| 298 | `sysctl.conf` looks much like `rc.conf`. Values are set in a `variable=value` form. The specified values are set after the system goes into multi-user mode. Not all variables are settable in this mode. | |
| 299 | ||
| 300 | ||
| 301 | ||
| 302 | A sample `sysctl.conf` turning off logging of fatal signal exits and letting Linux programs know they are really running under DragonFly: | |
| 303 | ||
| 304 | ||
| 305 | ||
| 306 | ||
| 307 | ||
| 308 | kern.logsigexit=0 # Do not log fatal signal exits (e.g. sig 11) | |
| 309 | ||
| 310 | compat.linux.osname=DragonFly | |
| 311 | ||
| 312 | compat.linux.osrelease=4.3-STABLE | |
| 313 | ||
| 314 | ||
| 315 |