19 Sept 2010

rm -rf in EndUserLand + POLFU - a definition of a new acronym

This is an "old problem" that some sysadmins are plagued with more than others, but we all do it sooner or later. With so many ex-MS eager-cut-and-paste admins rising up through the ranks faster nowadays, it will affect us all, directly or indirectly, sooner or later.


I'm not really a fan of aliasing rm to strange stuff in the /etc/bashrc (conflicts and frustrations can occur at strange times and scenarios with various users), though I do have a healthy set of aliases that I rsync across and merge into my own .kshrc or .bashrc files. Some of them irritate other people, just as theirs irritate me if I watch them work piped via an adhoc fifo + script -f session.


POLP in  EndUserLand1  (as distinct from  bellEndUserLand2)  best practice means sudo with a carefully configured /etc/sudoers on most machines that have multiple admins. Normal users users, of course, should never need superuser privs at any time. 

So, enter my newly invented acronym : Principle Of Least Fugg Up - POLFU

So why can't we take POLFU approach to rm?

I chanced upon this golden gem a while back: http://www.safe-rm.org.nz/

This allows you to configure a blacklist for rm, for both users and site-wide. It has matured nicely and I urge you to take a look, but to actually USE rm-safe, you need to set the symlink appropriately, so RTFMP3 and adjust for your system layout. Don't forget to test properly to get the expected results.

Everyone has bad days. Sometimes you just need to cover your ass so you don't look stupid. Much kudos can be gained from preventing other people screwing up too.




1 I think I've just introduced  EndUserLand to the WWW too, although that's been in my head for (too many) years. EndUserLand is always written as PascalCase, whereas...

2 the troublesome neighbour state, bellEndUserLand, is always camelCase, to differentiate it from the Country Formerly Known As MaBelLand (CFKAMBL). In late 2001 CFKAMBLE changed designator to HQWOT, HeadQuartersWarOnTerror.Ironically, in a breach of it's own Counter-Terrorism embargoes, HQWOT it has exported millions of copies of XP and Vista since. Windows7 is excluded from the restrictions because of it's use of /Users, yet somehow is shipped to both EndUserLand and bellEndUserLand without the safety pins in.


3 Read The Fugging Man Pages