{"action":"opened","issue":{"url":"https://api.github.com/repos/garbageface/stuff/issues/7","labels_url":"https://api.github.com/repos/garbageface/stuff/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/garbageface/stuff/issues/7/comments","events_url":"https://api.github.com/repos/garbageface/stuff/issues/7/events","html_url":"https://github.com/garbageface/stuff/issues/7","id":61328902,"number":7,"title":"[CLOSED] Make use of Pre-login Agent","user":{"login":"garbageface","id":11468585,"avatar_url":"https://avatars.githubusercontent.com/u/11468585?v=3","gravatar_id":"","url":"https://api.github.com/users/garbageface","html_url":"https://github.com/garbageface","followers_url":"https://api.github.com/users/garbageface/followers","following_url":"https://api.github.com/users/garbageface/following{/other_user}","gists_url":"https://api.github.com/users/garbageface/gists{/gist_id}","starred_url":"https://api.github.com/users/garbageface/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garbageface/subscriptions","organizations_url":"https://api.github.com/users/garbageface/orgs","repos_url":"https://api.github.com/users/garbageface/repos","events_url":"https://api.github.com/users/garbageface/events{/privacy}","received_events_url":"https://api.github.com/users/garbageface/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/garbageface/stuff/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/garbageface/stuff/labels/duplicate","name":"duplicate","color":"cccccc"},{"url":"https://api.github.com/repos/garbageface/stuff/labels/help%20wanted","name":"help wanted","color":"159818"},{"url":"https://api.github.com/repos/garbageface/stuff/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-14T01:05:08Z","updated_at":"2015-03-14T01:05:08Z","closed_at":null,"body":"<a href=\"https://github.com/darwingr\"><img src=\"https://avatars.githubusercontent.com/u/6166398?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [darwingr](https://github.com/darwingr)**\n_Sunday Nov 23, 2014 at 22:50 GMT_\n_Originally opened as https://github.com/darwingr/Boot2Plex/issues/7_\n\n----\n\nSee [Apple docs](https://developer.apple.com/library/mac/samplecode/PreLoginAgents/Introduction/Intro.html#//apple_ref/doc/uid/DTS10004414-Intro-DontLinkElementID_2).\r\n\r\nEDIT: after hashing out whats below, its become clear to me that learning the pre-login agent stuff might not be necessary. This issue-solution will likely be tossed and the solution below moved to the proper bug ticket.\r\n\r\nPossible solution for launch on system startup failures.\r\n\r\nWay to allow launching a process needing the WindowServer (gui) before any users have logged in locally.\r\n\r\nThe likely culprit that must be accommodated can be found here:\r\n`/Applications/Plex Media Server.app/Contents/Resources/English.lproj/PMSApplications.nib`\r\nI'm not a cocoa developer so I might be wrong.\r\n\r\nStrategy: \r\n0.  I think the best for the project workflow would be to create a separate \"LaunchAgent\" script.\r\n1.  So our current LaunchDaemon(com.groskleg.plexserverd.plist) would be run by root, ordering _plex to start the server app.\r\n2.  The same launchdaemon script could also order the _plex user to run a LaunchAgent; thus running said agent as a user from startup!\r\n3.  Now given the agent's ability to handle the gui needs (daemons can't), we might have a chance at solving this.\r\n4. ???\r\n\r\n! Be on the look out for the possibility that anything literally pops on the login screen, \r\nit may or may not be a security concern(context?).\r\nAlthough this is hard to pry over as the menubar icon will show up and be actionable for any user logged in to a windowed session on the local machine.\n"}}