Ubuntu Pastebin

Paste from notevenandrew at Thu, 11 Jun 2015 18:22:42 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Contents I added in /etc/udev/rules.d/85-my_rule.rules

SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="1004", ATTR{idProduct}=="61f9", ENV{XAUTHORITY}="/home/andrew/.Xauthority", ENV{DISPLAY}=":0", OWNER="andrew", RUN+="/usr/local/bin/usb-lg-in_udev"



Contents in /usr/local/bin/usb-lg-in_udev

#!/bin/bash
nohup /usr/local/bin/usb-lg-in &



Contents in /usr/local/bin/usb-lg-in

setsid /home/andrew/syncscript/sync.sh



The /home/andrew/syncscript/sync.sh file is a bash file I made that automatically locates and backs up the files.

If I comment out 
nohup /usr/local/bin/usb-lg-in &
in
/usr/local/bin/usb-lg-in_udev
nautilus automatically mounts the file
else the process gets blocked, udev is waiting for sync.sh to finish before letting naitulus mount, and sync.sh is waiting for nautilus to mount before quitting.

How do I detach the processes?
Download as text