Newbie discovers two useful apps...

2009-08-24 Thread John Almberg
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

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Newbie discovers two useful apps...

2009-08-24 Thread Paul Schmehl
--On Monday, August 24, 2009 15:45:16 -0500 John Almberg jalmb...@identry.com 
wrote:


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


[snip]


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, I have tried to convert linux startups scripts over to rc.d scripts for 
some of my ports.  Frankly, it's easier to start from scratch.  In some cases 
it's barely possible at all, especially when the software was written for Linux 
with no consideration at all for other unix platforms.  This particular tip 
will save a lot of people a lot of grief, I can assure you.


Thanks for sharing it.

--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead. Thomas Jefferson

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org