juliansoares
(usa Debian)
Enviado em 28/08/2012 - 14:30h
Boa tarde linuxer's
preciso de uma ajuda com udev, preciso que ao colocar o pendrive não seja montado o pendrive e executado o script, e depois do script colocar em background, tipo p/ deixar o script rodando sem o udev.
ACTION=="add" KERNEL=="sdb", NAME="pendrive01" ,SYMLINK+="pendrive%n" , RUN+="/root/pendrive.sh"
pendrive.sh é isso :
#! /bin/bash
sudo mount -t vfat /dev/sdb1 /tmp/pendrive
if [ -d /tmp/pendrive ]; then
sudo cp -Rv /home/julian/documentos /tmp/pendrive
#dd if=/home/julian/cflex.iso of=/dev/sdb1
md5sum /dev/sdb1
sudo umount /dev/sdb1
echo "Pendrive desmontado!"
fi
logs do syslog :
Aug 28 14:26:42 zeus kernel: [95619.873265] sdb: sdb1
Aug 28 14:26:42 zeus kernel: [95619.877325] sd 44:0:0:0: [sdb] No Caching mode page present
Aug 28 14:26:42 zeus kernel: [95619.877329] sd 44:0:0:0: [sdb] Assuming drive cache: write through
Aug 28 14:26:42 zeus kernel: [95619.877331] sd 44:0:0:0: [sdb] Attached SCSI removable disk
Aug 28 14:26:42 zeus udevd[32059]: kernel-provided name 'sdb' and NAME= 'pendrive01' disagree, please use SYMLINK+= or change the kernel to provide the proper name
Aug 28 14:26:42 zeus kernel: [95620.243478] FAT-fs (sdb1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
Aug 28 14:26:46 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:26:56 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:27:06 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:27:16 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:27:26 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:27:36 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:27:43 zeus udevd[32059]: timeout: killing '/root/pendrive.sh' [32107]
Aug 28 14:27:43 zeus udevd[32059]: '/root/pendrive.sh' [32107] terminated by signal 9 (Killed)
Aug 28 14:27:46 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:27:56 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:28:06 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:28:16 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:28:26 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:28:36 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:28:46 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:28:56 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:29:06 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:29:16 zeus ippl: port 9091 connection attempt from 127.0.0.1
Aug 28 14:29:23 zeus minissdpd[3376]: 6 devices removed (good-bye!)
Aug 28 14:29:24 zeus minissdpd[3376]: device not found for removing : uuid:6c4f904a-8d41-4a82-b2f8-d7c886eab1ff::upnp:rootdevice
Aug 28 14:29:24 zeus minissdpd[3376]: device not found for removing : uuid:6c4f904a-8d41-4a82-b2f8-d7c886eab1ff
Aug 28 14:29:24 zeus minissdpd[3376]: device not found for removing : uuid:6c4f904a-8d41-4a82-b2f8-d7c886eab1ff::urn:schemas-upnp-org:service:ConnectionManager:1
Aug 28 14:29:24 zeus minissdpd[3376]: device not found for removing : uuid:6c4f904a-8d41-4a82-b2f8-d7c886eab1ff::urn:schemas-upnp-org:device:MediaServer:1
Aug 28 14:29:24 zeus minissdpd[3376]: device not found for removing : uuid:6c4f904a-8d41-4a82-b2f8-d7c886eab1ff::urn:schemas-upnp-org:service:ContentDirectory:1
Aug 28 14:29:24 zeus minissdpd[3376]: device not found for removing : uuid:6c4f904a-8d41-4a82-b2f8-d7c886eab1ff::urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1