Questions tagged [launch-daemon]

On Apple macOS, a launch daemon is a system service which runs as a regular process, but independently of login/windowing sessions in the background, and frequently with root/administrator privileges. This is in contrast to launch agents, which are linked to sessions, and to system extensions, which run in special sandboxed environments and runtimes.

83 questions
2
votes
1 answer

Configuring the mongod service: launch daemon or launch agent?

I'm installing MongoDB on OS X, using the 10gen builds. But their installation tutorial proves to be a bit scarce for me. So far I've found examples of mongod installed as a launch agent and as a launch daemon. Based on my understanding of launch…
Marius Butuc
  • 17,781
  • 22
  • 77
  • 111
2
votes
2 answers

Daemon with python 3

I am writing a script in python3 for Ubuntu that should be executed all X Minutes and should automatic start after logging in. Therefore I want to create a daemon (is it the right solution for that?) but I haven't found any modules / examples for…
Eknoes
  • 508
  • 1
  • 11
  • 24
1
vote
1 answer

pthread_mutex_lock and an abandoned shared mutex

Pardon me if I'm asking the obvious. I come from years of programming under Windows. Currently I'm working on a project that is running under macOS. (And I believe it uses Free BSD under the hood.) So I need to synchronize access to a shared…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
1
vote
1 answer

How to adjust what is displayed in the Login Items list for my launch daemon/agent in macOS?

My launch daemon (and the launch agent) are installed system-wide on macOS. I use the following plist file (say, for the daemon) that is placed into the following file /Library/LaunchDaemons/com.example.MyDaemon.plist:
c00000fd
  • 20,994
  • 29
  • 177
  • 400
1
vote
1 answer

Which frameworks am I allowed to link to from a macOS launch daemon?

I'm writing a macOS launch daemon (in C++). It works for the most part, except that I am noticing some random crashes via SIGABRT (in the log.) I've asked earlier about the use of the Core Graphics framework, which it turns out was not allowed in a…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
1
vote
1 answer

macOS, call uninstall script when drag-and-drop app to trash icon

I'm working on some app that has LaunchDaemon running on the background, and thus it requires some operations to be removed, prior to deleting the data/exe files. Is there an option to call an uninstall script upon drag-and-drop my app into the…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
1
vote
1 answer

CGEventPost is not working in (MacOS) launchd daemon

i want to simulate the keyboard with CGEventPost in the user session (MacOS). CGEventRef keyEvent = CGEventCreateKeyboardEvent( NULL, keyCode, down ) ; CGEventPost( kCGHIDEventTap, keyEvent ) ; CFRelease( keyEvent ) ; when i use this code in a…
1
vote
1 answer

How to run/debug open-source macOS `Privileges` app w/ XPC service/daemon and DockTile plugin

I'm attempting to try out some modifications in SAP's Privileges.app. Unfortunately, their (understandable) Support policy is This project is 'as-is' with no support, no changes being made. You are welcome to make changes to improve it but we are…
bruth
  • 61
  • 1
  • 9
1
vote
1 answer

Why does codesigned Go binary get tagged as “Unknown Developer” on macOS 13?

The current macOS 13 beta has a feature in which it displays all application-installed Login Items in a System Preferences panel, including LaunchDaemons. My app has a LaunchDaemon written in Go that I codesign with my Developer ID as part of the…
fsctl
  • 161
  • 8
1
vote
1 answer

Stuck with daemon calling bash script on macos; any ideas?

I am new to scripts and daemons and, after toying for a while, find myself stuck. Here is the situation: on macos, I have a program called "maza" which updates my hosts file using online blocklists. I want to run this program, say, once a week to…
KenMatsuo
  • 11
  • 3
1
vote
1 answer

Mac launchDaemon service is launching my bash script repeatedly

I have been setting up a launch daemon that launch a bash script on demand. However, once I load my launch agent and communicate via socket, then it keep running my bash script every 10 seconds.I've even set KeepAlive flag as false in plist and…
Dass
  • 326
  • 1
  • 11
1
vote
0 answers

What should be my entry point if my MacOS app has no UI?

i have a macos app that has no UI, its a Launch Daemon, and since this is my first app i wanted to check if im doing things right. Is it ok to start running my code in the AppDelegate method applicationDidFinishLaunching or should i make another…
Santiago Alvarez
  • 167
  • 1
  • 12
1
vote
0 answers

macOS 11 Launch Agent can't access NFS shares

I am trying to set up a launch agent on macOS 11 to run a script on an NFS share. My launch agent works when the script is located on the local computer but fails with Operation not permitted when the script is located on NFS. Is it possible to give…
RegedUser00x
  • 2,313
  • 5
  • 27
  • 34
1
vote
1 answer

Launch Daemon is not able to access keychain entries

I have a command line process which is calling an API and fetching tokens from keychain. When I am running this process standalone with/without sudo from terminal, it is able to access the keychain entries. Now I have converted this into a launch…
1
vote
0 answers

LaunchControl for Mac giving me errors

I've been trying to schedule a Python script running with LaunchControl for Mac. My script contains f strings, new in Python 3.6. For some reason, my I keep getting a syntax error on the f strings, and nothing will run.
Toby
  • 21
  • 3