Questions tagged [launchd]

Launchd is a process management daemon, similar to "init". It is commonly used on Darwin-based systems.

640 questions
7
votes
2 answers

Removing mysql using launchctl

I am trying to uninstall my old sql so that I can install a new one. I am following this post but stuck at launchctl unload. [~/Library/LaunchAgents]$ ls…
Ava
  • 5,783
  • 27
  • 58
  • 86
7
votes
2 answers

Checkpoint Secure Client: "Connectivity with VPN services is lost" on Mac OS 10.8

When I install the secure client from Checkpoint (from here) on my Mac OS X 10.8, it works. However, as soon as I restart the Laptop for 1-2 times, it won't work anymore displaying the error: Connectivity with VPN services is lost whenever…
kadrian
  • 4,761
  • 8
  • 39
  • 61
7
votes
1 answer

Can SMJobSubmit() be used to execute a privileged helper installed by SMJobBless?

I have been reading documentation and the SMJobBless example and various discussions on the Internet. My app now installs a privileged helper using SMJobBless(), but the helper doesn't run at all. The whole purpose of the helper is to load a kext,…
mtrbean
  • 903
  • 7
  • 15
6
votes
1 answer

How can you start a LaunchAgent for the first time without rebooting, when your code runs as a LaunchDaemon?

I have a LaunchDaemon. When it runs, it checks if SIMBL is installed. If SIMBL is not installed, it uses NSTask to run /usr/sbin/installer on the SIMBL.pkg. SIMBL's postflight script then tries to run a launchctl load command to start SIMBL's…
jbrjake
  • 174
  • 1
  • 8
6
votes
1 answer

SMJobBless - documentation on when it asks for admin password

I cannot seem to locate any documentation on this, so hopefully someone can confirm the behavior I am seeing with Apple's sample SMJobBless code. I was under the impression that it would only ask for an admin password if it detected a that a new…
ericg
  • 8,413
  • 9
  • 43
  • 77
6
votes
4 answers

Running python script in Mac OSX launchd permission issue

I have a simple python script which is moving files from my download folder. The script works fine when I running it via terminal. The issue happens when it gets run through launchd: Traceback (most recent call last): File…
xpollcon
  • 525
  • 1
  • 6
  • 9
6
votes
2 answers

Using launchd on IOS to restart app

I am using some iPads in a museum exhibition, running an app developed by others. Even though we've covered the Home button, I'm finding that occasionally the app crashes, leaving the user at the Home screen. From here they can access other…
Joe Coleman
  • 61
  • 1
  • 2
6
votes
1 answer

LaunchAgent script can't write to external drive

macOS Catalina I have a python script that should write a file to an external drive. This works if I run the script manually. However, if the script is kicked off from a LaunchAgent bash script, it doesn't have permission to do so. Simplified python…
brewcrazy
  • 623
  • 13
  • 30
6
votes
2 answers

What is CFErrorDomainLaunchd error 2?

I can't find CFErrorDomainLaunchd in any of the headers. I used the find command to grep every header file in the 10.11 SDK. I also tried google: site:opensource.apple.com CFErrorDomainLaunchd SMJobBless passes the error back when I try to install…
Mike Crawford
  • 2,232
  • 2
  • 18
  • 28
6
votes
2 answers

Relative Path in launchd plist

I am currently using a plist to run a shell script.
6
votes
1 answer

Launchd OSX not running bash with teamcity agent

I have a shell script startup.sh that does the following (create a RAM disk and start the teamcity agent): #!/bin/bash DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://16777216` /usr/sbin/diskutil erasevolume HFS+ "RamDiskCache"…
Chris Kooken
  • 32,730
  • 15
  • 85
  • 123
6
votes
3 answers

OSX: How to check the return value of launchctl command

On OSX using launchctl to start and stop a service seems great however I don't see anyway to check the return value to make sure it really did start. Return value always seems to come back as zero even when the service failed to start This plist…
user495126
6
votes
2 answers

Can I import a Golang package based on the OS I'm building for?

Say I have a go project that based on which OS, and in some cases which distro, I want to use say a Systemd client package vs an Upstart client package vs a sysv client package vs a launchd client package. Is it possible to selectively import each…
Christian Grabowski
  • 2,782
  • 3
  • 32
  • 57
6
votes
1 answer

Launchd.plist with WatchPaths key: How to set a minimum interval?

How would one set a minimum interval for a launchd.plist script with a WatchPath key? For example, I want to run a script every time new files appear in a directory, but I would like it to only run once an hour at maximum. The launchd.plist might…
jkyle
  • 2,002
  • 1
  • 18
  • 23
6
votes
2 answers

How to check for a launched process is loaded or not in MAC OS X from shell script?

I have a launchd process to unload, the command I have used is launchctl unload /System/Library/LaunchDaemons/costomscript.plist it works fine if the process is already loaded. But if it is not loaded and I executed the command it gives a message…
Govind Karmakar
  • 131
  • 1
  • 3
  • 8