From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Sommer Date: Wed, 17 Sep 2003 15:55:12 +0000 Subject: Re: Weird environment for usb-storage script? Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org begin "Michael Hale" wrote: > Hello, > > I am having a problem with my /etc/hotplug/usb/usb-storage script. As > you can see below it attempts to start the ssh server and eject the > cdrom when I insert my usb drive and then stop the ssh server and any > connections and unject the cdrom when I remove the drive. The cd pops > in and out when I remove insert and remove the drive, but nothing > happens with ssh. I have run usb-storage from the command line and it > has the desired behavior, but when hotplug runs the script it doesn't > start/stop ssh. Any suggestions? Maybe the environment is broken. > #!/bin/sh exec >/tmp/foo.$$ 2>&1 set -x > /etc/init.d/ssh start invoke-rc.d ssh start (would be better, if your system have invoke-rc.d) > eject > > echo "#!/bin/sh" > $REMOVER > echo "/etc/init.d/ssh stop" >> $REMOVER > echo "killall -9 sshd" >> $REMOVER > echo "eject -t" >> $REMOVER echo '#!/bin/sh /etc/init.d/ssh stop killall -9 sshd eject -t' > $REMOVER > chmod 777 $REMOVER J=F6rg. end. --=20 Man(n) sollte nie einer Frau wiedersprechen ! Man(n) sollte immer warten, bis sie es selbst erledigt. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel