You are not logged in.

#1 2013-10-15 09:07:57

WonkoDV
Member
Registered: 2013-01-17
Posts: 2

xlock started with udev closes after 3 seconds

Hi,

I want to start xlock when I pull my USB key out. It works far enough to see xlock for 3 seconds or even a minute but then it allways dies without comment

#cat /etc/udev/rules.d/50-unlock.rules

SUBSYSTEM=="usb", ACTION=="remove", ENV{ID_VENDOR_ID}=="foo", ENV{ID_SERIAL_SHORT}=="bar", RUN+="/root/bin/udevlock"
SUBSYSTEM=="usb", ACTION=="add",    ENV{ID_VENDOR_ID}=="foo", ENV{ID_SERIAL_SHORT}=="bar", RUN+="/root/bin/udevunlock"

I tried various ways to start xlock some last about 3 seconds, some almost 1 minute but then xlock disappears

cat /root/bin/udevlock 
#!/bin/sh

case 6 in

1)
{
	{
		/usr/bin/nohup /usr/bin/su -l mr -c 'DISPLAY=:0 xlock -mode pacman' # 3 sec
	} &
} </dev/null &>/dev/null &
;;

2)
exec 0>&-
exec 1>&-
exec 2>&-
/usr/bin/nohup /usr/bin/su -l mr -c 'DISPLAY=:0 xlock -mode pacman' # 1 min
;;

3)
/usr/bin/nohup /usr/bin/env -i 'PATH=/usr/bin' 'DISPLAY=:0' sudo -u mr xlock -mode pacman & # 3 sec
;;

4)
/usr/bin/su -l mr -c 'DISPLAY=:0 xlock -mode pacman' &  # holds 3 sec
;;

5)
/usr/bin/nohup /usr/bin/su -l mr -c 'DISPLAY=:0 xlock -mode pacman' &  # holds 3 sec
;;

6)
(  /usr/bin/su -l mr -c 'DISPLAY=:0 /usr/bin/xlock -mode pacman' & ) &> /dev/null # 3 secs
;;
esac

instead of starting xlock i allso started a script that prints 1 number every 100ms to a tmp file, it also died after the same time.

Any good ideas?

Thanks

Offline

Board footer

Powered by FluxBB