LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-16-2007, 11:00 AM   #1
krisealv
Member
 
Registered: Jan 2004
Location: Hareid, Norway
Distribution: Ubuntu
Posts: 111

Rep: Reputation: 15
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?
 
Old 04-16-2007, 11:17 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run-parts gives error on bash script ChoKamir Programming 9 04-11-2017 07:18 AM
Run my bash script as a daemon. jaimese Linux - Newbie 12 02-10-2011 03:28 PM
Run Bash Script @ login XaViaR Linux - General 5 01-26-2006 10:05 PM
how to run one bash script from within another? babag Programming 9 04-28-2005 12:12 AM
Run script at login instead of bash uzi4u Linux - General 2 04-28-2004 02:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration