An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Topic Options
#25289 - 03/07/13 12:23 PM launching apps from terminal
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
it seems that changes have been made in 10.8 that killed the "open" command in terminal.


iTech-Demo-2:~ root # open /Applications/Messages.app
LSOpenURLsWithRole() failed with error -10810 for the file /Applications/Messages.app.
iTech-Demo-2:~ root # open /Applications/Messages.app/Contents/MacOS/Messages
LSOpenURLsWithRole() failed with error -10810 for the file /Applications/Messages.app/Contents/MacOS/Messages.


It seems that Open no longer will open applications from terminal.


iTech-Demo-2:~ root # open /Library/Desktop\ Pictures/Blue\ Pond.jpg
LSOpenURLsWithRole() failed with error -10810 for the file /Library/Desktop Pictures/Blue Pond.jpg.

nor will it open documents.... so is Open completely broken? How do I launch an app? Anyone got an osascript handy? (I assume a tell to Finder or System events or something)
_________________________
I work for the Department of Redundancy Department

Top
#25290 - 03/07/13 12:36 PM Re: launching apps from terminal [Re: Virtual1]
artie505 Online


Registered: 08/04/09
Have you looked in "man" to see what may be up?
_________________________
The new Great Equalizer is the SEND button.

In Memory Of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Top
#25291 - 03/07/13 02:22 PM Re: launching apps from terminal [Re: artie505]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
nothing new there unless I'm missing something. according to man, what I am typing should (still) work.
_________________________
I work for the Department of Redundancy Department

Top
#25293 - 03/07/13 04:19 PM Re: launching apps from terminal [Re: Virtual1]
ganbustein Offline


Registered: 08/04/09
I'm not sure what Error -10810 is (it isn't listed in MacErrors.h), but it's pretty clear what the problem is. You're trying to open a GUI application while the GUI belongs to a different user. (In your case, you're trying to run Messages.app as root. What exactly do you think that's going to do?)

If you run exactly the same command from a shell running as the GUI's user, it works fine. Run it from any other user, and it fails.

Top
#25294 - 03/07/13 04:56 PM Re: launching apps from terminal [Re: ganbustein]
dkmarsh Offline

Moderator

Registered: 08/04/09
_________________________

dkmarsh • member, FineTunedMac Co-op Board of Directors

Top
#25296 - 03/07/13 05:06 PM Re: launching apps from terminal [Re: dkmarsh]
artie505 Online


Registered: 08/04/09
Out of curiosity (and maybe I'll learn something) what search term did you use to find that?

I searched and came up 100% empty.

Thanks.
_________________________
The new Great Equalizer is the SEND button.

In Memory Of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Top
#25300 - 03/07/13 05:43 PM Re: launching apps from terminal [Re: dkmarsh]
ganbustein Offline


Registered: 08/04/09
Originally Posted By: dkmarsh

Some info here:

That article starts by saying -10810 means Launch Services encountered an unknown error, mentions that exhausting your process table could be one cause of it, and then spends the rest of the article talking as if that was the only cause.

To see if you're even close to this limit, first find out how many processes are permitted with EITHER of the commands

getconf _CHILD_MAX
ulimit -u


That's a per-user limit, and is 709 on 10.8.2, up from 266 on 10.6.8. You can see how many a given user is using with:

# Count your processes
ps -x | wc -l

# Count some other user's processes (root's, for example)
ps -xu root | wc -l

# Count all processes
ps -xa | wc -l

I'm nowhere near the limit, yet got this error code trying to launch a GUI application from a different user and from root.

Top
#25301 - 03/07/13 09:15 PM Re: launching apps from terminal [Re: artie505]
dkmarsh Offline

Moderator

Registered: 08/04/09

My search string was "error -10810" including quotation marks. error -10810 doesn't work because Google uses the minus sign to signify NOT, so you're essentially telling it to find all results for the word error which don't include the number 10810.

Let's not get into a discussion of search techniques in this thread, though. wink
_________________________

dkmarsh • member, FineTunedMac Co-op Board of Directors

Top
#25302 - 03/07/13 10:10 PM Re: launching apps from terminal [Re: dkmarsh]
artie505 Online


Registered: 08/04/09
Very helpful; thanks! smile
_________________________
The new Great Equalizer is the SEND button.

In Memory Of Harv: Those who can make you believe absurdities can make you commit atrocities. ~Voltaire

Top
#25303 - 03/08/13 04:21 AM Re: launching apps from terminal [Re: ganbustein]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
I'm not encountering a launch limit, and it's an application from my /Applications folder that I ought to be able to launch.
_________________________
I work for the Department of Redundancy Department

Top
#25369 - 03/12/13 11:19 PM Re: launching apps from terminal [Re: Virtual1]
ganbustein Offline


Registered: 08/04/09
Originally Posted By: Virtual1
I'm not encountering a launch limit, and it's an application from my /Applications folder that I ought to be able to launch.


YOU ought to be able to launch it. "root" doesn't have a GUI environment to launch it in. Re-check your transcript. You're invoking open from a root shell.

Top

Moderator:  alternaut, dkmarsh, joemikeb