Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
strano comportamento udev (nulla è più utile del superfluo)
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
otaku
Guru
Guru


Joined: 16 Dec 2004
Posts: 428
Location: Rho (MI)

PostPosted: Tue Jan 11, 2005 12:48 am    Post subject: strano comportamento udev (nulla è più utile del superfluo Reply with quote

smanettando con udev ho voluto creare uno script che riproduce un suono quando connetto la fotocamera usb , funziona tutto, tranne che il suono viene riprodotto 2 volte, inzialmente pensavo si trattasse di un appesantimento del sistema, visto che vengono caricati e rimossi tutti i moduli del caso, poi aggiungendo un
Code:
cat dindon >> test

alla fine dello script mi ritrovo ad avere due dindon nel file, quindi lo script viene eseguito 2 volte... volevo sapere da qualche anima pia se questo comportamento è normale oppure sono io ad aver sbagliato qualche cosa nel configurare udev, attendendo una vostra risposta cerco di mettere un controllo che limiti l'esecuzione del suono a una volta sola
_________________
Ventiquattr'ore al giorno in preda a una follia contorta...


Last edited by otaku on Tue Jan 11, 2005 12:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Tue Jan 11, 2005 1:36 am    Post subject: Reply with quote

sarebbe utile vedere COME hai configurato udev.. :roll:
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
otaku
Guru
Guru


Joined: 16 Dec 2004
Posts: 428
Location: Rho (MI)

PostPosted: Tue Jan 11, 2005 1:55 am    Post subject: Reply with quote

ecco i 2 file che ho modificato:
Code:
$ cat /etc/udev/rules.d/camera.rules
BUS="scsi", SYSFS{vendor}="Sony    ", SYSFS{model}="Sony DSC        ", NAME="camera"

Code:
$ cat /etc/dev.d/camera/sound.dev
#!/bin/bash

if [ "$ACTION" == "add" ] ; then
  /usr/bin/aplay /usr/share/sounds/Windows\ XP\ Hardware\ Insert.wav
fi


if [ "$ACTION" == "remove" ] ; then
  /usr/bin/aplay /usr/share/sounds/Windows\ XP\ Hardware\ Remove.wav
fi

in mancanza d'altro ho preso i suoni dal pc di mio padre :P
esiste anche un file modules.dev nella stessa cartella di sound.dev, originariamente era tutto incluso in uno script, poi ho preferito dividerli per gestire meglio eventuali problemi
_________________
Ventiquattr'ore al giorno in preda a una follia contorta...
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Tue Jan 11, 2005 2:08 am    Post subject: Reply with quote

quante partizioni ha la MMC/SD della camera? 1 vero? :)
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
otaku
Guru
Guru


Joined: 16 Dec 2004
Posts: 428
Location: Rho (MI)

PostPosted: Tue Jan 11, 2005 11:33 am    Post subject: Reply with quote

si una partizione sola
Code:
 Dispositivo Boot      Start         End      Blocks   Id  System
/dev/camera1   *           1         990       63340+   1  FAT12

_________________
Ventiquattr'ore al giorno in preda a una follia contorta...
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Tue Jan 11, 2005 12:16 pm    Post subject: Reply with quote

Quanti sono i dispositivi creati quando attacchi la fotocamera?
(lo vedi dal dmesg o dai log del kernel....)
_________________
Ciao da me!
Back to top
View user's profile Send private message
otaku
Guru
Guru


Joined: 16 Dec 2004
Posts: 428
Location: Rho (MI)

PostPosted: Tue Jan 11, 2005 12:43 pm    Post subject: Reply with quote

Code:
ohci_hcd 0000:00:02.2: wakeup
usb 1-1: new full speed USB device using ohci_hcd and address 21
Initializing USB Mass Storage driver...
scsi19 : SCSI emulation for USB Mass Storage devices
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 21
usb-storage: waiting for device to settle before scanning
  Vendor: Sony      Model: Sony DSC          Rev: 4.10
  Type:   Direct-Access                      ANSI SCSI revision: 00
usb-storage: device scan complete
SCSI device sda: 126848 512-byte hdwr sectors (65 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
SCSI device sda: 126848 512-byte hdwr sectors (65 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
 sda: sda1
Attached scsi removable disk sda at scsi19, channel 0, id 0, lun 0

dmesg mi dice solo questo quando connetto la fotocamera e
Code:
usb 1-1: USB disconnect, address 21
usbcore: deregistering driver usb-storage

quando viene rimossa
_________________
Ventiquattr'ore al giorno in preda a una follia contorta...
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Tue Jan 11, 2005 1:36 pm    Post subject: Reply with quote

controlla i file di configurazione di hotplug, nella fattispecie che udev non sia listato due volte (a volte aggiornando con etc-update ..)
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
otaku
Guru
Guru


Joined: 16 Dec 2004
Posts: 428
Location: Rho (MI)

PostPosted: Tue Jan 11, 2005 4:05 pm    Post subject: Reply with quote

essendo parzialmente ignorante in materia, ho trovato questo documento nel wiki italiano, ma non credo di aver capito bene cosa controllare...
Quote:
Se per caso avete installato "udev" vedrete con in /etc/hotplug.d/default esiste anche un link chiamato udev.hotplug che punta ad "udevsend", infatti anche udev utilizza hotplug.

controllando in /etc/hotplug.d/default vedo che solo questo file punta a udevsend
Code:
lrwxrwxrwx  1 root root   22 23 dic 04:06 10-udev.hotplug -> ../../../sbin/udevsend

quindi il link è solo uno ... ammesso che abbia capito bene cosa intendesse quella frase :roll:
_________________
Ventiquattr'ore al giorno in preda a una follia contorta...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum