vorta icon indicating copy to clipboard operation
vorta copied to clipboard

Mac M1 : Vorta does not automatically start at login

Open uselpa opened this issue 4 years ago • 8 comments

Describe the bug Vorta does not start at login, even if the corresponding checkmark is set.

To Reproduce Manually adding Vorta to "Preferences / Users & Groups / Login Items" appears to work for a second or two, but the Vorta disappears again from the list.

Environment (please complete the following information):

  • Macbook Air (M1, 2020)
  • OS: Big Sur 11.5.2
  • Vorta version: 0.7.8 / borg 1.1.7
  • Installed from: homebrew

uselpa avatar Sep 12 '21 12:09 uselpa

Hello @uselpa , Im not familiar with Mac, In Misc Vorta did you check "Automatically start Vorta at login" ?

bastiencyr avatar Sep 15 '21 14:09 bastiencyr

Yes indeed (see attached).

On 15 Sep 2021, at 16:24, Bastien @.***> wrote:

Hello @uselpa https://github.com/uselpa , Im not familiar with Mac, In Misc Vorta did you check "Automatically start Vorta at login" ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/borgbase/vorta/issues/1064#issuecomment-920066963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM4YVACFI4J7UIYDY7UDG4LUCCUBBANCNFSM5D4BZC4Q. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

uselpa avatar Sep 15 '21 14:09 uselpa

Logs would be useful. I suspect there is something in the system logs.

We use PyObjC to edit login items. Maybe something changed here. It's in autostart.py

m3nu avatar Sep 15 '21 16:09 m3nu

Also, still works on my 2017 Intel Mac. So someone else would need to debug this.

m3nu avatar Sep 15 '21 16:09 m3nu

Hi, attached the log I suppose you expect. At 10:00 am I deactivated/reactivated the startup but it does not show in the logs, nor anywhere else I looked. I suppose that manually creating a launchd User Agent starting /Applications/Vorta.app/Contents/MacOS/vorta-darwin should do? Regards, -Patrick

On 15 Sep 2021, at 18:47, Manu @.***> wrote:

Also, still works on my 2017 Intel Mac. So someone else would need to debug this.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/borgbase/vorta/issues/1064#issuecomment-920189122, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM4YVAC37JIERKAGXLEHIOTUCDEYJANCNFSM5D4BZC4Q. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

uselpa avatar Sep 16 '21 08:09 uselpa

Regarding autostart.py, it says: "On macOS, this function adds/removes the current app bundle from Login items". Manually adding Vorta to Login Items does not work (I tried that at first, see my initial message).

I now manually created a plist in ~/Library/LaunchAgents, loaded it vie launchctl, and this appears to work (and should work on any macOS and both Intel and M1 Macs).

uselpa avatar Sep 16 '21 08:09 uselpa

I believe launchctl is different from user login items?

m3nu avatar Sep 16 '21 11:09 m3nu

Yes indeed. I just came across this explanation: https://eclecticlight.co/2021/09/16/how-to-run-an-app-or-tool-at-startup/

FWIW, here's my config file for launchctl. For a normal deployment, KeepAlive should probably be false, and the Label should be different of course. (Disclaimer: I am not an expert on the subject).

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>KeepAlive</key>    <true/>
	<key>Label</key>        <string>lu.usel.Vorta.plist</string>
	<key>ProcessType</key> 	<string>Interactive</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Applications/Vorta.app/Contents/MacOS/vorta-darwin</string>
	</array>
	<key>RunAtLoad</key>    <true/>
</dict>
</plist>

uselpa avatar Sep 16 '21 11:09 uselpa

I tested this on M1 Air, Monterey 12.2.1 with vorta version 0.8.11, also installed with homebrew and this feature is working fine for me.

jetchirag avatar May 29 '23 00:05 jetchirag

Thanks for testing, @jetchirag . The code for this feature was also adjusted to avoid alerts every time. So there shouldn't be an issue any more.

Closing this, since it's also 2 years old.

m3nu avatar May 29 '23 09:05 m3nu