Shirt Pocket Discussions

Shirt Pocket Discussions (https://www.shirt-pocket.com/forums/index.php)
-   General (https://www.shirt-pocket.com/forums/forumdisplay.php?f=6)
-   -   Script failing to start application with 'open' (https://www.shirt-pocket.com/forums/showthread.php?t=1698)

tegg 10-10-2006 10:48 AM

Script failing to start application with 'open'
 
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 11:42 AM

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 07: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 09:29 AM

Ah, good idea -- that'll certainly work! :-)


All times are GMT -4. The time now is 05:05 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.