Como posso executar o Dropbox no Mac OS X Mountain Lion sem fazer login?

1

Estou usando o Dropbox para sincronizar arquivos com meu site, que está sendo executado no Mac OS X Mountain Lion. O problema é que, se eu não estou logado, o Dropbox não está rodando e como resultado qualquer alteração que eu faça no meu site em outro computador ligado ao Dropbox, o site não atualiza.

Eu tentei resolver o problema fazendo o Dropbox rodar como um daemon na inicialização. Eu criei uma entrada launchd em / Library / LaunchDaemons usando a chave UserName para executar o Dropbox como eu, e ele inicia, mas nada é atualizado. Quando eu redireciono a saída do executável do Dropbox para um arquivo, vejo o seguinte erro, embora não seja óbvio para mim que é fatal, e ainda vejo o Dropbox na lista de processos.

/Applications/Dropbox.app/Contents/Resources/lib/python2.7/lib-ol_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
2013-09-15 17:42:20.592 Dropbox[267:707] Unable to simultaneously satisfy constraints:

(
    <NSLayoutConstraint:0x5636c30 H:[_NSAlertContentView:0x56319e0(<=0)]>,
    <NSLayoutConstraint:0x5636b70 H:[_NSAlertContentView:0x56319e0(>=420)]>
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x5636c30 H:[_NSAlertContentView:0x56319e0(<=0)]>

Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens.  And/or, break on objc_exception_throw to catch this in the debugger.
2013-09-15 17:42:20.593 Dropbox[267:707] Unable to simultaneously satisfy constraints:

(
    <NSLayoutConstraint:0x5637240 V:[_NSAlertContentView:0x56319e0(<=0)]>,
    <NSLayoutConstraint:0x5637180 V:[_NSAlertContentView:0x56319e0(>=131)]>
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x5637240 V:[_NSAlertContentView:0x56319e0(<=0)]>

Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens.  And/or, break on objc_exception_throw to catch this in the debugger.
2013-09-15 17:42:20.612 Dropbox[267:707] Error (1000) creating CGSWindow on line 259
2013-09-15 17:42:20.614 Dropbox[267:707] (
0   CoreFoundation                      0x98598e8b __raiseError + 219
1   libobjc.A.dylib                     0x987e152e objc_exception_throw + 230
2   CoreFoundation                      0x98598d21 -[NSException raise] + 17
3   _objc.so                            0x02b30b2f PyObjCErr_ToObjCWithGILState + 63
4   _objc.so                            0x02b11501 PyObjCFFI_BuildResult + 4673
5   _objc.so                            0x02b0254f ffi_closure_SYSV_inner + 127
6   _objc.so                            0x02b02352 ffi_closure_SYSV + 34
7   libobjc.A.dylib                     0x987ee5d3 -[NSObject performSelector:withObject:] + 70
8   Foundation                          0x90d9d326 __NSThreadPerformPerform + 395
9   CoreFoundation                      0x9846f04f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
10  CoreFoundation                      0x9846ea79 __CFRunLoopDoSources0 + 233
11  CoreFoundation                      0x98494826 __CFRunLoopRun + 934
12  CoreFoundation                      0x9849401a CFRunLoopRunSpecific + 378
13  CoreFoundation                      0x98493e8b CFRunLoopRunInMode + 123
14  HIToolbox                           0x9107af5a RunCurrentEventLoopInMode + 242
15  HIToolbox                           0x9107acc9 ReceiveNextEventCommon + 374
16  HIToolbox                           0x9107ab44 BlockUntilNextEventMatchingListInMode + 88
17  AppKit                              0x9907693a _DPSNextEvent + 724
18  AppKit                              0x9907616c -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 119
19  AppKit                              0x9906c5cc -[NSApplication run] + 855
20  _objc.so                            0x02b022ad ffi_call_SYSV + 29
21  _objc.so                            0x02b025c9 ffi_call + 89
22  _objc.so                            0x02b1b2e9 PyObjCFFI_Caller + 2809
23  _objc.so                            0x02b4006a PyObjCSelector_GetClass + 698
24  Python                              0x02209918 PyObject_Call + 88
25  Python                              0x022be2cf PyEval_EvalFrameEx + 5663
26  Python                              0x022c4571 PyEval_EvalCodeEx + 2081
27  Python                              0x022c20d3 PyEval_EvalFrameEx + 21539
28  Python                              0x022c4571 PyEval_EvalCodeEx + 2081
29  Python                              0x022c20d3 PyEval_EvalFrameEx + 21539
30  Python                              0x022c4571 PyEval_EvalCodeEx + 2081
31  Python                              0x0223b3d2 PyClassMethod_New + 1138
32  Python                              0x02209918 PyObject_Call + 88
33  Python                              0x022bea8c PyEval_EvalFrameEx + 7644
34  Python                              0x022c4571 PyEval_EvalCodeEx + 2081
35  Python                              0x022c20d3 PyEval_EvalFrameEx + 21539
36  Python                              0x022c2fb2 PyEval_EvalFrameEx + 25346
37  Python                              0x022c2fb2 PyEval_EvalFrameEx + 25346
38  Python                              0x022c2fb2 PyEval_EvalFrameEx + 25346
39  Python                              0x022c4571 PyEval_EvalCodeEx + 2081
40  Python                              0x022c46f7 PyEval_EvalCode + 87
41  Python                              0x022e8fa5 PyRun_SimpleFileExFlags + 789
42  Python                              0x022e90f8 PyRun_SimpleFile + 40
43  Dropbox                             0x000067f1 start + 17777
44  Dropbox                             0x00006f89 main + 1481
45  Dropbox                             0x00002382 start + 258
46  Dropbox                             0x000022a9 start + 41

'

    
por Michael 16.09.2013 / 01:00

2 respostas

0

Parece que um monte de trabalho para algo que pode ser realizado com Mercurial / Git em execução na máquina de destino sem fazer o login. Com isso você tem a vantagem adicional de controle de origem.

tração automática do Mercurial

    
por 28.01.2014 / 09:40
0

O " Erro (1000) criando o CGSWindow na linha 259 " mostra que o aplicativo interno do Python precisa de alguma forma de interface gráfica necessária (talvez a tela flash ou o pop-up de menu). Por padrão, os LaunchAgents / Daemons não têm acesso gráfico, pode até não ser ativado ainda.

Na página launchctl man:

Currently known session types include: Aqua, LoginWindow, Background, StandardIO and System.

No arquivo plst launchd, tente adicionar o requisito LimitLoadToSessionType do tipo de sessão "Aqua" e "LoginWindow".

<key>LimitLoadToSessionType</key>
  <array>
    <string>LoginWindow</string>
    <string>Aqua</string>
  </array>

Cuidado, que um aplicativo provavelmente será desativado e reiniciado ao fazer login. A partir do Apple Daemon technote :

If you set LimitLoadToSessionType to an array, be aware that each instance of your agent runs independently. For example, if you set up your agent to run in LoginWindow and Aqua, the system will first run an instance of your agent in the loginwindow context. When a user logs in, that instance will be terminated and a second instance will launch in the standard GUI context.

    
por 28.01.2014 / 09:33