xterm -display в /etc/udev/scripts/ [SOLVED]
подскажите как правильно запустить xterm из udev - скрипта ?
пробовал так:
cat /etc/udev/scripts/getfoto
#!/bin/bash
LOG="/var/log/udev"
rm -f $LOG
echo "--- `date` ---" >> $LOG
sudo -u dmg /usr/bin/xterm -display :0 >>$LOG 2>>$LOG
#-e /bin/bash /home/dmg/scripts/getfoto
echo "--- `date` ---" >> $LOG
cat /var/log/udev
--- Sun Aug 19 14:11:47 MSD 2007 ---
/usr/bin/xterm Xt error: Can't open display: :0.0
/usr/bin/xterm: DISPLAY is not set
--- Sun Aug 19 14:11:53 MSD 2007 ---
и так:
cat /etc/udev/scripts/getfoto
#!/bin/bash
LOG="/var/log/udev"
rm -f $LOG
echo "--- `date` ---" >> $LOG
/usr/bin/xterm -display :0 >>$LOG 2>>$LOG
echo "--- `date` ---" >> $LOG
cat /var/log/udev
--- Sun Aug 19 15:29:32 MSD 2007 ---
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
/usr/bin/xterm Xt error: Can't open display: %s
/usr/bin/xterm: DISPLAY is not set
--- Sun Aug 19 15:29:32 MSD 2007 ---
второй скрипт из другого xterm - работает..
- Для комментирования войдите или зарегистрируйтесь
так работает
XAUTHORITY=/home/dmg/.Xauthority /usr/bin/xterm -display :0 -geometry 80x30 -e /usr/bin/sudo -u dmg /bin/bash /home/dmg/scripts/getfoto>>$LOG 2>>$LOG