### Problem ###
I'm usually comfortable around my system but I've come across a problem that I just can't figure out. I have a server which runs headless that handles a samba share for the house. The only issue I have is that my brother occasionally unplugs the device. At first I just used to use an fstab entry but that only helps at boot time and isn't ideal as the system is ocasionally booted without the harddrive. My idea is now to launch a script using udev rules mount the drive. I've been running into issues and have reduced my problem to as basic a form as is possible and am now testing it on my own system and I still can't solve it.
### My attempt ###
My first step was to create the file /etc/udev/rules.d/03-mountNex.rules:
This should launch the script "/home/daniel/script" when I plug in a third hard drive.
The script itself is for now rudimentary:
The script just opens up an instance of dolphin. Nothing fancy.
I now restart my computer with the device not plugged in. Login in and then plug the device in.
Some other useful info is my permissions on the udev file and script:
### Intended Result ###
When I plug the device in then dolphin should launch
### Actual Result ###
Absolutely nothing happens except the normal KDE dialog pop-ups asking what I want to do with the drive.
### Suspected issue ###
Something to do with permissions but I'm not sure.
### System Info ###
Kubuntu 12.04 with Kubuntu-Backports ppa and latest available KDE.
Thanks a ton for any help you can provide.
I'm usually comfortable around my system but I've come across a problem that I just can't figure out. I have a server which runs headless that handles a samba share for the house. The only issue I have is that my brother occasionally unplugs the device. At first I just used to use an fstab entry but that only helps at boot time and isn't ideal as the system is ocasionally booted without the harddrive. My idea is now to launch a script using udev rules mount the drive. I've been running into issues and have reduced my problem to as basic a form as is possible and am now testing it on my own system and I still can't solve it.
### My attempt ###
My first step was to create the file /etc/udev/rules.d/03-mountNex.rules:
Code:
ERNEL=="sdc", ACTION=="add", RUN+="/home/daniel/script"
The script itself is for now rudimentary:
Code:
#! /usr/bin/sh /usr/bin/dolphin
I now restart my computer with the device not plugged in. Login in and then plug the device in.
Some other useful info is my permissions on the udev file and script:
Code:
daniel@linux-w365:/etc/udev/rules.d> ls -l total 292 -rw-r--r-- 1 root root 57 Jan 5 16:36 03-mountNex.rules ........
Code:
ls -l total 17400 ........ -rwxr-xr-x 1 daniel users 32 Jan 5 16:28 script ........
When I plug the device in then dolphin should launch
### Actual Result ###
Absolutely nothing happens except the normal KDE dialog pop-ups asking what I want to do with the drive.
### Suspected issue ###
Something to do with permissions but I'm not sure.
### System Info ###
Kubuntu 12.04 with Kubuntu-Backports ppa and latest available KDE.
Thanks a ton for any help you can provide.
Comment