PDA

View Full Version : Script failing to start application with 'open'


tegg
10-10-2006, 11:48 AM
I'm trying to get an application to start once SD! has finished a backup, and having some problems getting it working.

I've set a shell script to be run once the backup completes, and it executes

open -b org.me.myappid

to try to start the application. This works fine if I execute the shell myself. However when SD! runs the script, it looks like open can't find the application. I get the following in the log:

open[2502] Couldn't launch application: (null)

As far as I understood it, open calls launch services to start applications, so I don't see why it would be able to find the application in an interactive shell, and not in the shell SD! starts.

Any ideas?

dnanian
10-10-2006, 12:42 PM
Not sure why that would fail, tegg -- we run the script authenticated, though, and perhaps "root" can't do that.

Try launching with the path instead.

tegg
10-11-2006, 08:28 AM
I think I worked at what is wrong here.

I was trying to avoid passing a full path to open, and we have a couple of users here and I was trying to create something flexible.

Looks like the launch servcies databases are per-user, (or at least root has a different one), so open couldn't find the application as the LS DB never gets updated for root.

I fixed this by changing the open... line to sudo -u $USER open..., and it looks like its working now

Pete

dnanian
10-11-2006, 10:29 AM
Ah, good idea -- that'll certainly work! :-)