Consulte /apple//a/102105/1860 para saber por su
que não funciona em todos os aplicativos.
bsexec do launchd
Versões recentes do launchd
têm a capacidade de iniciar aplicativos dentro da sessão de outro usuário; embora os engenheiros da Apple não tenham recomendado seu uso geral.
Use a bsexec
opção no launchctl para direcionar a sessão de usuário apropriada:
bslist [PID | ..] [-j]
This prints out Mach bootstrap services and their respective states. While the namespace
appears flat, it is in fact hierarchical, thus allowing for certain services to be only avail-
able to a subset of processes. The three states a service can be in are active ("A"), inactive
("I") and on-demand ("D").
If [PID] is specified, print the Mach bootstrap services available to that PID. If [..] is
specified, print the Mach bootstrap services available in the parent of the current bootstrap.
Note that in Mac OS X v10.6, the per-user Mach bootstrap namespace is flat, so you will only
see a different set of services in a per-user bootstrap if you are in an explicitly-created
bootstrap subset.
If [-j] is specified, each service name will be followed by the name of the job which regis-
tered it.
bsexec PID command [args]
This executes the given command in the same Mach bootstrap namespace hierachy as the given
PID.
bstree [-j]
This prints a hierarchical view of the entire Mach bootstrap tree. If [-j] is specified, each
service name will be followed by the name of the job which registered it. Requires root priv-
ileges.
A abordagem recomendada é escrever um tíquete de trabalho iniciado e reiniciar o Mac - ou solicitar ao usuário que efetue logout e logon novamente.
su
se não se desejasudo
. Obrigado!