<div dir="ltr">Does your own system have /dev/watchdog? Mine does, but I&#39;m in the <div>middle of a bunch of stuff so I&#39;m not going to go poking at it. </div><div><br></div><div>Also, did you read this: <a href="https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt">https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt</a></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>--</div>Wyatt Zacharias<div><br></div></div></div></div>
<br><div class="gmail_quote">On Mon, May 4, 2015 at 10:51 PM, Trevor Cordes <span dir="ltr">&lt;<a href="mailto:trevor@tecnopolis.ca" target="_blank">trevor@tecnopolis.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2015-05-04 Gilbert E. Detillieux wrote:<br>
&gt; A read on a file in /dev will almost always trigger an action<br>
&gt; (usually causing data to be read from a device, of course), but I<br>
<br>
</span>Hmm, that&#39;s a good point.  I suppose a read on a device could &quot;steal&quot;<br>
the input another program was expecting.<br>
<br>
It&#39;s strange though, because now that I think about it, when I run grep<br>
-r /, I&#39;m pretty sure it&#39;s not reading all the disk block files, etc,<br>
as it runs way too fast for that...<br>
<br>
Ah, I forgot I had this set as an alias to grep on every system I use:<br>
/bin/grep -s --devices=skip<br>
<br>
I just checked and this new Rackspace box indeed had my alias set!<br>
So the plot thickens!  So it&#39;s two possibly bugs: why was grep even<br>
reading that watchdog device in the first place; and why did reading it<br>
trigger a reboot?<br>
<span class=""><br>
&gt; can end up in symlink-induced loops.  I&#39;d also avoid going<br>
<br>
</span>I&#39;ve never actually ended up in a symlink loop, but I can see how it<br>
would be easy to run into.  I guess I don&#39;t use many dir symlinks on my<br>
systems.<br>
<br>
Or... I just RTFM and it looks like gnu grep solved the symlink problem<br>
already:<br>
<br>
       -r, --recursive<br>
              Read  all  files  under  each  directory,  recursively,<br>
following  symbolic links only if they are on the command line.  Note<br>
       that if no file operand is given, grep<br>
              searches the working directory.  This is equivalent to<br>
the -d recurse option.<br>
<br>
       -R, --dereference-recursive<br>
              Read all files under each directory, recursively.  Follow<br>
              all symbolic links, unlike -r.<br>
<br>
So that explains why I&#39;ve never hit a symlink loop: I&#39;ve never used -R<br>
(capital).<br>
<br>
Ah, even better:<br>
       -D ACTION, --devices=ACTION<br>
              If  an input file is a device, FIFO or socket, use ACTION<br>
to process it.  By default, ACTION is read, which means that devices are<br>
read just as if they were ordinary<br>
              files.  If ACTION is skip, devices are silently skipped.<br>
<br>
So that means my -D skips every &quot;weird&quot; file.  That means that I&#39;ve<br>
definitely, for sure, hit some bugs here.  There&#39;s absolutely nothing<br>
now that should stop anyone from safely doing a:<br>
<br>
grep -r -D skip /<br>
<br>
on any system with modern gnu grep.<br>
<br>
The main reason I want to be able to do grep -r / sometimes is that I<br>
need to find a string (like an IP address) that may be scattered<br>
literally anywhere on the fs.  In the past when I say to myself &quot;oh, it<br>
must only be in /etc or /var or /home&quot;, there ends up being some little<br>
file in /usr (not even /usr/local) or wherever that was changed ages ago<br>
for whatever reason to work around whatever problem, and it gets missed<br>
unless I just &quot;grep the whole darn thing&quot;.  And to ls / and go through<br>
the 10-15 items in my brain deciding if they are greppable or<br>
&quot;system/non-greppable&quot; takes time and is error/omission-prone, and to<br>
list each one on the command line is a pain.  Now this would be easier<br>
with a shell like zsh that has &quot;negative globs&quot; where I could specify<br>
&quot;* except /dev /sys&quot; (ie just make an &quot;exclude&quot; list, not an include<br>
list), but my beloved tcsh doesn&#39;t have that and I&#39;m not ready to switch<br>
to zsh yet.  And like I said before, each UNIX has its own different<br>
set of &quot;don&#39;t grep this&quot; dirs, and they change over time (even in<br>
Linux), so making a &quot;one-alias fits all&quot; is a non-solution.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Roundtable mailing list<br>
<a href="mailto:Roundtable@muug.mb.ca">Roundtable@muug.mb.ca</a><br>
<a href="http://www.muug.mb.ca/mailman/listinfo/roundtable" target="_blank">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br>
</div></div></blockquote></div><br></div>