[Techtalk] remote testing of automount service

Sarah Newman newmans at sonic.net
Wed Oct 29 15:35:19 UTC 2008


In perl, could you fork a new process to run ssh? Then have the main 
thread alternately sleep / do a non blocking check on the child with 
waitpid until the child should be done.  If the child is not done at 
that point then you can send a signal to kill it.

There's probably a better way of doing it, but that should work.

Meryll Larkin wrote:
> Hi All,
> 
> I'm the Linux Sys Admin responsible for 32 linux workstations that all get
> their home directories from a Linux file server, through the automount
> service.  I have root authority on all.
> 
> I've written a script that I run through cron that pings the workstations
> and makes sure they are powered on and connected to the network.  It pages
> me when there is a problem.  I used perl and Net::Ping to create this script
> so it doesn't hang when ping isn't responding.
> 
> I wish I could do similar for automount.  The problem is that if automount
> (autofs) is NOT running, then ssh hangs forever.  The reason ssh hangs is
> because I closed off the opportunity to ssh as root (for security purposes)
> and if I ssh using my automounted user login and automount isn't running,
> then ssh can't find my ssh keyfile and it hangs asking for a password.
> 
> I've written scripts that check ssh, automount, who - and they all work fine
> provided I run them on the command line and if they encounter trouble (which
> is what they are trying to detect); I kill the script and then test that
> host manually.  I can do that because each time I start testing a new host,
> I print out a line that indicates "Now testing host 'hostname'".  If it
> hangs, I just kill the script, test that host manually, and rewrite the
> input list to eliminate the hosts I've already tested and rerun the script.
> 
> Maybe someone on this list knows a trick or switch I can use with ssh so it
> will return rather than hang or somehow get around my having to put a plain
> text password in a file or maybe there is a Perl module I don't know about
> that can do for ssh what Net::Ping does for ping?
> 
> Any suggestions along those lines would be very helpful.  My users are
> writing programs in C++ and compiling them with g++ and some error that new
> users make (rarely, but enough that it can be a problem) seems to crash the
> automount service, while allowing everything else to run.
> 
> TIA,
> Meryll
> 
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/techtalk
> 


More information about the Techtalk mailing list