LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Can't run openoffice from bash-script with udev (http://www.linuxquestions.org/questions/programming-9/cant-run-openoffice-from-bash-script-with-udev-546497/)

krisealv 04-16-2007 11:00 AM

Can't run openoffice from bash-script with udev
 
I've made a script that copies an impress presentation from a thumbdrive, kills running openoffice and starts a new instance of openoffice in fullscreen.

The problem is, when I start the script in a root terminal in X (X running as the normal user), everything goes fine. But when it is excecuted from udev, openoffice will not start

Script goes as follows (more of a dramatation then a reproduction of the scipt)
#!/bin/bash
>- copies file from device
>- umounts device
>- kills any running openoffice using ps -A | grep something and kill
>- starts openoffice with su user -c "openoffice -show presentation.odt"

How can I start a program from this script?

macemoneta 04-16-2007 11:17 AM

You need to use fully qualified paths would be my guess. The environment that udev runs with probably doesn't include any PATH.

/bin/cp
/bin/umount
/bin/ps
/bin/grep
/usr/bin/kill
/bin/su
/usr/bin/openoffice


All times are GMT -5. The time now is 07:20 AM.