LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-27-2004, 05:25 AM   #1
alexrait1
Member
 
Registered: Jul 2003
Location: Israel
Distribution: slackware current kernel 2.6.9
Posts: 70

Rep: Reputation: 15
hotplug configuration


hello,
I am trying to find out how to make this service work for me.
I believe it's installed correctly (I have morphix debian), since all the files in
/etc/hotplug are in place.

My final goal is to get it work like in Suse 9.1 or Mandrake 10 with usb memory sticks. Namely, when I insert that device into the usb slot, an icon appears on my kde desktop with the mounted device, and it disappears again after I plug it out.

I am not sure my hotplug service is running, though when I write
Code:
hotplug start
it just moves to the next line.
the same with
Code:
hotplug status
The modules for the memory stick are loaded correctly so that
Code:
mount -t vfat /dev/sda1 /mnt/usb
works ok.

Now, I read the file /etc/hotplug/usb.rc which (as I believe) contains what I need.
Code:
maybe_start_usb ()
{

 local COUNT SYNTHESIZE
 COUNT=0
 SYNTHESIZE=true
    if [ ! -d /proc/bus/usb ]; then
        SYNTHESIZE=false
    fi
modprobe -q usbcore >/dev/null 2>&1
    if [ -d /proc/bus/usb ]; then
        # if it's not mounted, try to mount it
        if [ ! -f /proc/bus/usb/devices ]; then
         if grep -q -E      "^[^#][^[:space:]]+[[:space:]]+/proc/bus/usb/?[[:space:]]" /etc/fstab; th
                mount /proc/bus/usb
            else
                if grep -q usbfs /proc/filesystems; then
                    mount -t usbfs usbfs /proc/bus/usb
                else
                    mount -t usbdevfs usbdevfs /proc/bus/usb
                fi
            fi
        fi
    fi
.
.
.
the output of mount contains this line:
Code:
usbfs on /proc/bus/usb type usbfs (rw)
but it is there regardless of the memory stick.

what can be done?
where can I say to it to open my application whenever it sees the memory stick plugged in?

thanx to everybody.
 
Old 07-27-2004, 09:45 AM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
/proc/bus/usb is only losely related to usb stick. It is an interface where you can check your system for different usb devices.
 
Old 07-27-2004, 10:37 AM   #3
alexrait1
Member
 
Registered: Jul 2003
Location: Israel
Distribution: slackware current kernel 2.6.9
Posts: 70

Original Poster
Rep: Reputation: 15
Thanx for the remark..
Ok, I did have some progress :
I noticed that when I write
Code:
modprobe usb-storage
and then plug in my memory stick (DOK), the module is unloaded!
so I looked at /etc/hotplug/usb/usb-storage and found this:
Code:
if (not $attached and $unattached) {
           system 'rmmod usb-storage';
        }
I commented this line, and the usb-storage was no longer unloaded.
Now there are three files: usb-storage,usb-agent and usb.rc.
I tried to find out what is the order of execution and the result is (with "echo")
usb.rc->usb.agent->usb-storage
though I guess that might not be correct since they are built of many functions..
Anyway, after these files run, I can easily mount my usb drive with
mount -t /dev/sda1 /mnt/usb
but, if I put this line in usb-agent, and direct the ouput to some file, It contains this message:
Code:
mount: /dev/sda1 is not a valid block device
So I still wonder where to put this line....(though I am happy these files are been exectued at least).

according to this post:

post

Quote:
Watch a file in a timeout. (We had hotplug for USB storage
devices in Red Hat 7.1 working quite nicely by watching
/etc/fstab for changes; kudzu added new entries in
response to hotplug events. magicdev noticed the
changes, signaled mc which added icons on the desktop.)
I guess I have to make something similar...

Last edited by alexrait1; 07-27-2004 at 12:57 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
no more hotplug-ng? ParticleHunter Linux - Software 4 09-14-2005 05:45 PM
rc.hotplug Jeebizz Slackware 9 08-31-2004 08:56 AM
Firmware/Hotplug problem with Hauppauge DEC2540-T, Hotplug and MythTV bezoomny Linux - Hardware 0 05-17-2004 02:37 PM
Dual / Hotplug Pointing Devices - GPM Configuration muzicman82 Linux - Hardware 1 12-16-2003 05:52 PM
Hotplug Astro Slackware 1 03-15-2003 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration