Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2009 16:45:16 -0400
From:      John Almberg <jalmberg@identry.com>
To:        freebsd-questions@freebsd.org
Subject:   Newbie discovers two useful apps...
Message-ID:  <87C694DA-8C7F-4DC2-A1B4-6C38542D14D9@identry.com>

next in thread | raw e-mail | index | archive | help
Even after a year or so of administering a number of FreeBSD servers,  
I still consider myself to be a newbie (see my various posts for  
evidence of this fact!)

I've been hoping to have something useful to contribute back, and I  
suddenly realized there are probably newbies that are even newbier  
than I. Hard to believe, but true!

You pros can flip to the next post, there's nothing here for you, but  
my fellow newbies may find this interesting...

Anyway, this weekend I 'discovered' two VERY useful utilities:

1. The 'at' command: http://tinyurl.com/nzz5a9

I don't know about you, but I am constantly promising clients that  
something will happen at an odd hour of the day or night. A typical  
example is someone who wants some promotion to end at 7:30 am.  
Accomplishing this is pretty simple, but has required me to log into  
the server to manually execute some command, or write some tiny  
script and have it execute by cron in some tortured way.

Super inconvenient, or a waste of time, or worse (if you forget).

But this weekend I discovered the 'at' command. The man page gives  
you the details, but basically it allows you to say "execute that  
command or set of commands at this time on this day". You can set up  
the 'at' command to do what you need to do at 2am on Tuesday and  
forget it. No more setting alarms or forgetting. And it's dead easy  
to set up. I can't believe I haven't found this sooner. Fantastic.

2. DJB Daemontools: http://thedjbway.org/daemontools.html

Lots of programs that are meant to run as daemons come packaged with  
a nice rc.d script. You just configure them in /etc/rc.d and they  
come up automatically when you reboot.

But not all, and frankly I have never had time to figure out how to  
write a rc.d script. I really, really needed to get a linux-oriented  
daemon to work this weekend -- rubycas-server, if you are interested.  
But it doesn't have an rc.d script. Bummer.

However, I run tinydns as my dns server, and that program doesn't use  
rc.d scripts, either. DJB has his own way of doing things,  
apparently. The standard way to install tinydns has you install  
another DJB product called daemontools. Daemontools is good for,  
well, getting daemons to run at boot time, in a fairly platform  
independent way (UNIX only, of course).

Anyway, I dimly remembered this and dug into the DJB docs. Some will  
wonder why I found it easier to read a DJB doc than to read how to  
write a rc.d script... An excellent question, but in 5 minutes, I had  
my rubycas-server running under daemontools. It is that easy. I still  
don't know how to write an rc.d script, but I have to believe it  
would take me more than 5 minutes to learn and write. If you have  
daemons running, that you started manually from the command line, and  
are just hoping you'll remember to re-start them the next time you  
reboot, you should really check out daemontools...

Much better than putting a reminder in your MOD (Me??? I would never  
do that!!!)

-- John




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87C694DA-8C7F-4DC2-A1B4-6C38542D14D9>