old-www/HOWTO/Automount-5.html

50 lines
2.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Automount mini-Howto: The long wait for unmounting</TITLE>
<LINK HREF="Automount-6.html" REL=next>
<LINK HREF="Automount-4.html" REL=previous>
<LINK HREF="Automount.html#toc5" REL=contents>
</HEAD>
<BODY>
<A HREF="Automount-6.html">Next</A>
<A HREF="Automount-4.html">Previous</A>
<A HREF="Automount.html#toc5">Contents</A>
<HR>
<H2><A NAME="s5">5. The long wait for unmounting</A></H2>
<P>Some of you may be eyeing that 60 second timeout and thinking, <EM>that's a long
time to wait to eject a floppy.. Maybe I'll just sync the disks and pop
it out mounted and nobody will notice.</EM> Let me suggest <CODE>saner alternatives</CODE>.
First of all, you can change the timeout. But that could be a little
inefficient; telling the system to unmount stuff after only 15 seconds or
whatever. Depending on your setup, you may be able to simply run the umount
command as a normal user. But there is actually a way to ask the automount program to umount.
If you send (with the program kill) the signal <CODE>SIGUSR1</CODE> to the automount process,
it will unmount everything it can. But before people start making unmount
buttons on their window managers, there's a little problem.
<P>The automount process is run by root, and it will only accept signals from
root. Half of the reason you're probably doing automounting is so you can
mount and unmount without being root. It would be easy to make a suid-root
C program which does the dirty deed. However, by using sudo it is possible
to allow users to send the proper kill signal. The only problem is that
sudo will not let you use to process subcommands, which you would have to
do to find the current PID. You should have a program called killall, which
will let you do this:
<P>
<PRE>
ALL ALL=NOPASSWD:/usr/bin/killall -USR1 automount
</PRE>
Otherwise, you would have to allow your users to send -SIGUSR1 to all processes.
That has various effects on programs; it will recycle some window managers,
but kills xemacs. So here's hoping there's no buffer overruns in killall...
<P>
<HR>
<A HREF="Automount-6.html">Next</A>
<A HREF="Automount-4.html">Previous</A>
<A HREF="Automount.html#toc5">Contents</A>
</BODY>
</HTML>