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
3
votes
4 answers

Uninstalling items installed by an .app when user deletes it, including SMJobBless helpers

The short version: is it possible to delete helper tools which were set up by the app (SMJobBless() etc.) when the app is deleted? If so, how? The long version: The Mac app we are developing unfortunately requires admin privileges to perform an…
pmdj
  • 22,018
  • 3
  • 52
  • 103
3
votes
1 answer

How To Do Privilege Elevation on OSX with Objective C

My custom Cocoa-based setup.app on Mac OSX that I made in Objective C needs to install a LaunchDaemon for doing elevated privilege tasks such as an antivirus program that needs to scan the entire hard drive and therefore needs root privileges. How…
Volomike
  • 23,743
  • 21
  • 113
  • 209
3
votes
1 answer

OS X - Truly 'On Demand' Privileged Helper Tool

My application needs to write files to restricted places on the filesystem. To do so, I use a helper tool that is run as root. Everything is working correctly, following this example, my helper tool is correctly installed and run. I use this…
Vince
  • 525
  • 1
  • 3
  • 19
3
votes
1 answer

OSX - where to put my command line binary launchdaemon and dependant dylibs

I have a command line application (not .app bundle), a single executable file. It runs from e.g. usr/bin/myapp . This should be accessible by all users in the mac. It is a LaunchDaemon and run as a as root user. If I keep it in usr/bin it works…
karim
  • 15,408
  • 7
  • 58
  • 96
3
votes
1 answer

Executing Keyboard Events from Daemon in Mac using CFEvents

I have the following code in a Daemon (Root Process) which simulates Keyboard events in OSX. CGEventRef keyEvent = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)keyCode, keyDown); CGEventPost(kCGHIDEventTap, keyEvent); CFRelease(keyEvent); When I am…
Shanti K
  • 2,873
  • 1
  • 16
  • 31
3
votes
2 answers

Playing audio from OS X launchd daemon

I am trying to execute an Apple Script from my launchd daemon. My script has just one line and it is given below. say "Message From Daemon!" This always fails and throws this error message "File some object wasn't found". Any idea why this is…
Seema Kadavan
  • 2,538
  • 1
  • 16
  • 31
2
votes
0 answers

Issues creating multiple timers with CFRunLoopTimerCreate

I'm trying to create multiple periodic timers for my macOS launch daemon. I've written the following class to deal with the timer object: struct MyTimer { MyTimer() { } ~MyTimer() { stopTimer(); } bool setTimer(size_t nmsPeriod, //Period in…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
2
votes
1 answer

How to convert existing macOS command line tool (for a launch daemon) into a bundled app for code signing & stapling?

I have a macOS command line tool project for my launch daemon (written in C++). It compiles into a single Mach-O binary file. I need to code sign and notarize it for distribution (outside of the App Store.) For that, it seems like I need to convert…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
2
votes
1 answer

LaunchDaemon service on MacOS not running until user signs in

I have an app service I want to start at system startup with a plist file: Label
Sean
  • 2,033
  • 2
  • 23
  • 28
2
votes
2 answers

Can I open a DriverKit user client with a daemon?

I'm building a virtual HID device in Driver Kit. I was wanting to communicate with the virtual device driver from a daemon, as the daemon is necessary for generating the HID events that would be sent from the driver. I'm matching on my driver…
Chris
  • 7,996
  • 11
  • 66
  • 98
2
votes
1 answer

How to forget a MacOS bundle to prevent invalid installation

Background I'm developing some Mac OS daemon. Some times I'm starting it as a application in my repository to test some things. So far so good. I'm able to create installation package which can be used by others no problems at all. Problem When I'm…
Marek R
  • 32,568
  • 6
  • 55
  • 140
2
votes
1 answer

Running mac os x application as a user does not stop by its own

I am creating a macOS installer package. For this I am using a post-install script file that launches an application and then loads a LaunchDaemon plist. Here is the post-install script: #!/bin/bash cd /usr/local/TestApp USER_NAME=$(who | head -1…
2
votes
2 answers

Launchd runs with manual "launchctl start", but not on StartCalendarInterval

I have a very simple Launch Daemon, com.daily.vocab.plist, which simply runs a basic script. It is supposed to run every day at a certain time (using StartCalendarInterval), but I can't get that to happen. Many posts online are saying it runs a…
mgs
  • 57
  • 7
2
votes
2 answers

Creating a LaunchDaemon for Gitblit

I want to create a LaunchDaemon on OSX Mavericks for my Gitblit, this is my file (org.gitblit.plist):
UnsafePointer
  • 726
  • 6
  • 25
2
votes
2 answers

Launch Daemons in MAC OSX

I have written a daemon is MAC OS 10.8. I copied the Unix executable file to startup items. I have created a .plist file which has Label,KeepAlive flag set to YES and progrrammArguments array's Item0 as /Libray/StartupItems/updaterDaemon. I want…
subhash Amale
  • 325
  • 3
  • 4
  • 14