launchdagent

LaunchAgent - Is there something like RunAtScreenSaver?

家住魔仙堡 提交于 2020-01-15 09:32:06
问题 I am looking for a way to execute my app (it's a background task) at times, where the machine is "idle". A good incident would be when the screensaver launches. I already read the manual auf launchd and already use a LaunchAgent to lauch my app at certain intervals, but I found nothing that might help me launching my app when the screensaver is active. Is there any possibility to do that? Thanks in advance! Josh 回答1: Have another process that runs in the background and listens for distributed

OSX: Syntax for loading a single launchagent for current user

ぃ、小莉子 提交于 2019-12-11 14:22:41
问题 I am trying to load a single user's LaunchAgent plist. All existing plist files in the directory have the permissions of the user and the user's default group, If I use those permissions for my plist file and try to load, I get $ sudo launchctl load -w -F $HOME/Library/LaunchAgents/com.ionic.python.ionic-fs-watcher.startup.plist /Users/timothy/Library/LaunchAgents/com.ionic.python.ionic-fs-watcher.startup.plist: Path had bad ownership/permissions If I set the permissions to root:wheel the

OS X - Communication between launch daemon and launch agent

ⅰ亾dé卋堺 提交于 2019-12-06 05:13:36
问题 I am new to OS X and have to create an application having 2 parts - launch daemon and launch agent. The daemon is going to do stuff such as command execution, logging, etc and has to somehow communicate these results to launch agent (which would transfer them to a login item displaying a GUI, although that is a future step). My question: How do I achieve this communication?. From what I have been able to gather so far after reading Apple docs is that my best bet is using CFSockets. Is there

OS X - Communication between launch daemon and launch agent

柔情痞子 提交于 2019-12-04 11:36:42
I am new to OS X and have to create an application having 2 parts - launch daemon and launch agent. The daemon is going to do stuff such as command execution, logging, etc and has to somehow communicate these results to launch agent (which would transfer them to a login item displaying a GUI, although that is a future step). My question: How do I achieve this communication?. From what I have been able to gather so far after reading Apple docs is that my best bet is using CFSockets. Is there any alternate(simpler) way ? Does anybody have any sample tutorial/example/code that shows how to use

Starting/stopping a launchd agent for all users with GUI sessions

喜欢而已 提交于 2019-11-27 22:20:47
I need to be able to start/stop a per-session GUI agent from a root level daemon. Similar issues are discussed here , here and here . What I want to be able to do is basically for num in `ps ax | grep [s]bin/launchd | cut -c 1-5`; do if [ $num -ne 1 ]; then sudo launchctl bsexec $num launchctl (un)load -S Aqua /Library/LaunchAgents/com.mycompany.mydaemon.plist; fi; done but this only starts/stops one instance and it runs as root in the current GUI session. If I leave the sudo off there start I get task_for_pid() (os/kern) failure Couldn't switch to new bootstrap port: (ipc/send) invalid port

Starting/stopping a launchd agent for all users with GUI sessions

故事扮演 提交于 2019-11-26 23:10:17
问题 I need to be able to start/stop a per-session GUI agent from a root level daemon. Similar issues are discussed here, here and here. What I want to be able to do is basically for num in `ps ax | grep [s]bin/launchd | cut -c 1-5`; do if [ $num -ne 1 ]; then sudo launchctl bsexec $num launchctl (un)load -S Aqua /Library/LaunchAgents/com.mycompany.mydaemon.plist; fi; done but this only starts/stops one instance and it runs as root in the current GUI session. If I leave the sudo off there start I