Re: GENERIC make buildkernel error / fails - posix_fadvise

看板FB_stable作者時間14年前 (2012/01/23 03:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串17/20 (看更多)
On 12.01.2012 15:52, Doug Barton wrote: >>> chflags -R noschg /usr/obj/usr >>> rm -rf /usr/obj/usr > > It's much faster to do: > > /bin/rm -rf ${obj}/* 2> /dev/null || /bin/chflags -R 0 ${obj}/* && > /bin/rm -rf ${obj}/* If I could just add one thing here, for those who might be tempted to immediately cut and paste that elegant command line: Consider, how does that command evaluate if the shell variable "obj" is not set, and you're running that literal string as root? A: You will very systematically wipe your entire server, starting at the root, and doing a second pass to get any protected files you missed. I'd recommend something safer like approximately this (untested): if ["X${obj}" != "X" -a -d ${obj}]; then cd ${obj} && (rest of cmds); fi Sorry for the wasted bandwidth, for those to whom it was obvious, but anybody who has ever had to clean up after a junior admin's attempt to do something a little too clever will appreciate why I'm posting this. On the efficiency front, for the core file deletion operators, I've had good results with this trick (requires Perl and makes use of its implicit-operand idioms): find ${obj} | perl -nle unlink If rm had an option to take files from standard input, or if there's another program I'm not aware of which does this, it could serve as the right-hand side of this. -- Clifton -- Clifton Royston -- cliftonr@iandicomputing.com / cliftonr@volcano.org Custom programming, network design, systems and network consulting services _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"
文章代碼(AID): #1F76Gotn (FB_stable)
討論串 (同標題文章)
完整討論串 (本文為第 17 之 20 篇):
文章代碼(AID): #1F76Gotn (FB_stable)