LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-06-2007, 03:47 PM   #1
spaesani
LQ Newbie
 
Registered: Mar 2007
Posts: 13

Rep: Reputation: 0
Question launch application from hotplug agent


i am trying to launch an application from a shell script that is called via the hotplug agent mechanism.

the script is called from the usb.agent file
after checking against the vendor/product id etc...

when an attempt is made to launch an app from that script
in fact from the usb.agent script for that matter,
the app will not come into the foreground,
it does not launch at all.
??

when i call a script from the command line that it calls a script
etc..etc.. i have no problems.
the foreground job is replaced in the sequential order of execution of non backgrounded jobs.

i am not aware of how to trump the original caller of usb.agent
into allowing an application to be launched and assume 'foreground status'

anyone have any clues?

ps:
the script's purpose is to 'hot mount' hotplugged usb devices
and in some cases to launch a file manager.
eg: for cellphones where a usr might be expecting to use a specialized application to transfer data.
 
Old 03-06-2007, 10:47 PM   #2
ygloo
Member
 
Registered: Aug 2006
Distribution: slack
Posts: 323

Rep: Reputation: 30
hello,
are there any errors displayed when "hotplug" executes the script?
it sounds like "usb.agent" has different $PATH and can't
find some of the commands, or it can't find the script itself.

try adding this to usb.agent:
Code:
script.sh 2> ~/errors.tux
this redirects error output to "errors.tux" in your home directory

Last edited by ygloo; 03-06-2007 at 10:49 PM.
 
Old 03-08-2007, 12:49 AM   #3
spaesani
LQ Newbie
 
Registered: Mar 2007
Posts: 13

Original Poster
Rep: Reputation: 0
hotplug agent app launch

the mounting of the device(s) works well
(i have another question on this issues for later..)
it's the launching of a front end application that i am having trouble with.
that is, an application that outputs to the screen and looks to receive input from the user.
from what i can tell the hotplug agents are run as background jobs and ar not run interactively.
and so i guess the question is how to launch an application into the foreground from a background shell script?
)

try responses:
ygloo: the PATH usb.agent uses is short: /bin:/sbin:/usr/bin:/usr/sbin
yet i've been successfully calling scripts located elsewhere
using their full paths.
i put script.sh 2> ~/errors.tux in the usb.agent script
and got:
that's right, nothing.
the usb.agent script seems to not run with that inserted into it.
 
Old 03-09-2007, 01:40 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613
Please see this thread where two of us have made some progress on this.
http://www.linuxquestions.org/questi...ghlight=hotmnt
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
can't find ide.agent & block.agent for hotplug for 2.6 jg167 Linux - Newbie 1 06-23-2004 06:20 PM
Hotplug problems: RH 9, 2.6.6, PCMCIA-CS 3.2.7 (missing ide.agent & block.agent) jg167 Red Hat 1 06-23-2004 06:18 PM
autorun application program on hotplug kevinatkins Linux - Software 0 02-08-2004 08:44 AM
Hotplug usb agent "Cannot get config descriptor 0"? imk Linux - Networking 0 10-26-2003 01:48 PM
Error on boot /etc/hotplug/pci.agent: line 169: 156 Aborted Anibal Slackware 0 08-26-2003 01:45 PM

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

All times are GMT -5. The time now is 07:12 PM.

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