Michael's Daemonic Doodles

...blogging bits of BSD

service(8) - a useful little gem

Most services in FreeBSD are - or at least should be - controlled through rc scripts. So if you want to reload your pf rules, you would usually use /etc/rc.d/pf reload instead of using pfctl(8) directly. For restarting the apache web server /usr/local/etc/rc.d/apache22 restart instead of using apachectl directly. To figure out which services are enabled, you would check /etc/rc.conf.

Fortunately there is a new command in FreeBSD called service(8), which helps you to manage services in a convenient and more sophisticated way.

Read more...

Configure sendmail to forward root's email without DNS

For most of my professional life I tried to avoid sendmail whenever possible. Ever since qmail (and the myriad patches to it) got released I ran a couple of large scale setups for various ISPs successfully.

However, up to this day sendmail is FreeBSD's default MTA and I use it on all machines as the local mail delivery mechanism for system email (like the ones created by cron and periodic). So instead of trying to replace sendmail on all hosts I just tweak the configuration, so I can receive admin email in a centralized account without too much pain. For a couple of machines changing /etc/aliases might be enough, but there are some machines without DNS or public Internet access, for those the setup gets a little bit more complicated. This blog post obviously isn't for the sendmail savvy system administrator, but for people like me, who want to spend as little time as possible with sendmail and have it just in the background and do its job.

Read more...

Setting up FreeBSD on ZFS raidz2 using mfsBSD

As I explained in an earlier post, we had issues with one of our backup servers. I decided to do a complete reinstall and ended up using an LSI SAS 9211 controller running in initiator-target mode (IT firmware), so all eight disks show up as plain HBAs and can be used to form a zpool. After considering my options I decided to go with raidz2, which will provide a good balance of storage space and safety.

Read more...