Recently I have been setting up a few new boxes that have an LSI MegaRAID controller. As of FreeBSD 8.0, there is a much more friendly tool included called mfiutil. It saves from having to install sysutils/megacli and using its rather complicated arguments (well, at first, after using it for a little while they make sense). Now, I know I setup a RAID10 that spans 3, 2 disk arrays. However, mfiutil is reporting it as a RAID1 volume.
Category Archives: FreeBSD
Allow users to use rabbitmqctl
RabbitMQ is our message queue of choice for Celery. One of its main commands is rabbitmqctl
; it lets you manage your rabbit nodes. The command itself is just a shell script that uses sudo -u rabbitmq
to run an the Erlang rabbitmqctl program. It has to use sudo so that can it run as the rabbitmq user to use the same Erlang cookie that the broker is running with.
If you want to allow more than root or wheel group members to use the command, just use this sudoers privilege specification:
ALL=(rabbitmq) SETENV: NOPASSWD: /usr/local/bin/erl
(rabbitmq) assumes your RabbitMQ broker runs as the ‘rabbitmq’ user. It also assume you have Erlang installed in /usr/local
Apache Cassandra FreeBSD rc.d script
We are a FreeBSD shop, so naturally we run our Apache Cassandra cluster on it. Unfortunately, there isn’t an rc.d script for it. Using cassandra/bin/cassandra -p /var/run/cassandra.pid
has been working fine without any grief. However, it would be nice to utilize the rc system built into FreeBSD. I took the Tomcat 6.0 rc script that it is in the port system (www/tomcat6) and adapted it for cassandra.
Reset file’s modification time to their birth time
NOTE:This only works for FreeBSD.
This will change the modification time (ls -l
) of the current directory and all files and directories under it back to their “birth time” (creation time). If you want to limit this use man find
to figure out the proper arguments.
find . -exec sh -c 'touch -t $(date -r $(stat -f %B {}) "+%Y%m%d%H%M.%S") {}' \;
Enable logging in HAProxy on FreeBSD
This may apply to more than just FreeBSD, but it’s been tested and working on FreeBSD. I wanted to keep the syslogd locked down while letting HAProxy still log. All the example configurations I could find use a network interface to syslogd, which I have completely disabled. So this details using a local socket (which isn’t all that much different).
Continue reading
FreeBSD Hardware RAID Information
When trying to develop plans to repurpose machines and not being the sys admin that setup the machines is a difficult task. Part of the plan is to audit the hardware and their current configuration.
Memory, CPU, partitions, etc are easy parameters to determine in FreeBSD; hardware RAID on the other is not so simple.
Continue reading
Setting up a FreeBSD time server
It is a very simple process, however it does take a bit of patience. The NTP standard is quite complex and large, so I know I only scratched the surface.
Continue reading