OSX remote desktop pause app after disconnecting

Hi guys
I have some mac computers, i use one of theese as a server for my services. The web applications written in xojo works fine, but the desktop apps dont.
When I access the computer via screen share I can see the application is running, but when I close the screen sharing, the application pause, and stops updating.
Its a timesheet application. Every night the application checks and logs the daily worktime of my co-workers.
The apps and webservices worked on windows vm, but I had to switch to osx.

tldr: after remote access (osx) the desktop apps pause

May the applications pause because I “log out” (closing the screen share window) from the other mac?

Absolutely. If there’s no user logged in they probably get put to sleep. What you’ll need if you want to log out is to create a daemon.

Just out of curiosity… are you saying that this wasnt a problem when logging out when it was on a windows server? I would have expected that to behave the same.

Not if it ran as a Windows Service. These run as Administrator pre-login.

True, but if you read his comments, he’s talking about desktop apps.

You’re right, I was thinking of WebApps.

The desktop app works fine on windows (logs users, gets data from usb device, uploads to database). Somehow this is not working on osx. The web services work on both but the desktop app does not work on osx.

i will try to log in with teamviewer.

[quote=301621:@Roland Maszlag]The desktop app works fine on windows (logs users, gets data from usb device, uploads to database). Somehow this is not working on osx. The web services work on both but the desktop app does not work on osx.

i will try to log in with teamviewer.[/quote]
But on Windows, are you actually logging off? or just closing the window?

Closing the windows remote desktop (so the os goes back to login screen)

Same goes for osx (with screen share)

[quote=301760:@Roland Maszlag]Closing the windows remote desktop (so the os goes back to login screen)

Same goes for osx (with screen share)[/quote]
Yes, but whether ir not you’re actually logging off makes a huge difference. When using Microsoft’s Remote Desktop, just closing the app does not close the terminal services session. It asks for your password, (like it would if you’d walked away and the screensaver had kicked in) but your apps continue to run. On OS X you need to be using their paid Remote Desktop app, just close the window when you leave and you must choose to connect to the already running session. There may also be a setting to leave the session running in the preferences. It’s been a while since I’ve had to configure that.

On OS X, if you close screen sharing, on the client side, the server side keeps running… You can even do multiple people connected to one server… Any apps you have running will keep running, unless you log out of that account, on the server (Apple Menu > Logout)… I usually just put my server back to the login screen, as I use a different account to do the screen sharing…

Thats what im trying to do, i have a timer which do events at an exact time (logs user informations, sends mails, updates db), but it looks like the timer is not working when i close the screenshare.
Im connecting to the virtual machine osx from my mac osx.

[quote=301989:@Roland Maszlag]Thats what im trying to do, i have a timer which do events at an exact time (logs user informations, sends mails, updates db), but it looks like the timer is not working when i close the screenshare.
Im connecting to the virtual machine osx from my mac osx.[/quote]
Aha! That’s the missing piece! Your app is observing Apple’s AppNap policy. I’d bet that the timer does fire, but at a greatly decelerated rate.

This thread has some code for turning it off for your app.

https://forum.xojo.com/10898-mavericks-is-putting-my-app-to-sleep/p2#p78698

That said, App Nap is designed to save power. You may still want to consider making your app into a global daemon so it can run when users are not logged in. That would require that the main code of your app be a console app however and that any desktop interface simply communicate with it.

[quote=302027:@Greg O’Lone]Aha! That’s the missing piece! Your app is observing Apple’s AppNap policy. I’d bet that the timer does fire, but at a greatly decelerated rate.

This thread has some code for turning it off for your app.

https://forum.xojo.com/10898-mavericks-is-putting-my-app-to-sleep/p2#p78698

That said, App Nap is designed to save power. You may still want to consider making your app into a global daemon so it can run when users are not logged in. That would require that the main code of your app be a console app however and that any desktop interface simply communicate with it.[/quote]
Thank you, i will check this.