Questions tagged [launchctl]

91 questions
4
votes
1 answer

Is it possible to evaluate an expression in launchd's ProgramArguments array?

I have a ~/Library/LaunchAgents/setenv.JAVA_HOME.plist file which contains a /bin/launchctl call as follows:
Adil Hussain
  • 30,049
  • 21
  • 112
  • 147
4
votes
1 answer

launchd: Managing a Java Jar

I have the following launchd configuration (stored in acme.plist) which I load and start using launchctl load acme.plist and launchctl start acme.plist respectively.
abhillman
  • 3,942
  • 1
  • 20
  • 21
3
votes
2 answers

Running Launchd Services with Non Root User on macOS

I am building a launchctl service which can run a java service. I am able to create launchctl service with root user and test start/stop/status/automatic start at reboot use cases. I am struggling with running same launchctl service with non root…
SRJ
  • 2,092
  • 3
  • 17
  • 36
3
votes
1 answer

With launchctl 2, how can I infer the domain from a service that is already running on macOS >= 10.10?

launchctl 2 takes a specifier which indicates the target domain. According to the manual of the command, this specifier may take one of the following…
Polymedes
  • 31
  • 4
3
votes
2 answers

How to restart docker-machine after startup?

I'm using MacBook Pro 2009 which doesn't support the latest Docker for Mac. So, I'm using Docker Machine approach to get the Docker up and running for my machine. Here are the commands I use to install Docker in my machine: $ brew install docker…
Zulhilmi Zainudin
  • 9,017
  • 12
  • 62
  • 98
3
votes
2 answers

Setting maxfile on OS X/MacOS Programmatically

If I look at the maxfiles option using launchctl's limit command (on my OS X El Cap machine) $ launchctl limit cpu unlimited unlimited filesize unlimited unlimited data unlimited unlimited …
Alana Storm
  • 164,128
  • 91
  • 395
  • 599
3
votes
2 answers

OS X 10.10.3 launchctl Permission denied

I execute launchctl start com.xxx.xxx.plist I can find AutoMakeLog.err and the content : Traceback (most recent call last): File "/Users/xxxx/Downloads/Kevin/auto.py", line 67, in output = open(file_name, 'w') IOError: [Errno 13] Permission…
KevinLee
  • 45
  • 1
  • 5
2
votes
2 answers

List All Loaded/Unloaded or Both Launch Agents On macOS

I am trying to figure out how many launch agents are loaded right now using following command the it find /System/Library/Launch* /Library/Launch* ~/Library/Launch* -name '*.plist' -exec sh -c '/usr/libexec/PlistBuddy -c "Print Label" {} && echo {}'…
Vikram Sinha
  • 581
  • 1
  • 10
  • 25
2
votes
0 answers

textract.process works fine when called via terminal but fails when the same code is launched via launchctl

Summary : I am trying to parse a PDF using textract. textract.process works fine when called via terminal but fails when the same code is launched via launchctl (Note : xxxxxxxxxx is my username crossed out) Error Message : The command…
2
votes
1 answer

Load .plist with launchctl on High Sierra via command line

Overview: I'm trying to do the following for a suite of MacMini's to run in a teach suite. After a clean install (Using Apple remote desktop and bash scripts) Install some applications (Chrome, Logic, Imovie) Create a User (u:p student/student for…
Alex Hellier
  • 435
  • 1
  • 7
  • 15
2
votes
0 answers

launchctl getenv command returns an empty PATH

When I run launchctl getenv PATH in the terminal, I always get an empty string as a response. I tried using sudo launchctl getenv PATH since with sudo, the system environment is queried, but I still get an empty string. Am I missing something ? …
ghlecl
  • 3,127
  • 1
  • 16
  • 15
2
votes
0 answers

OSX - Set Environment Variable for Android Studio via launchctl - works only after second launch

This is in my ~/.bash_profile, since I need Android Studio / Gradle to have access to this variable. #CCACHE export USE_CCACHE=1 export NDK_CCACHE=/usr/local/bin/ccache launchctl setenv NDK_CCACHE $NDK_CCACHE Interestingly, the variable is not set…
keyboard
  • 2,137
  • 1
  • 20
  • 32
2
votes
0 answers

Remove Launchd service when an app bundle is removed on osx

The app needs to run a binary (service) with root permission and avoid asking privilege at each start but only at install. To do so, at first start the app will set-up the service on launchd. The problem is how to remove that service when the app…
Damien
  • 1,492
  • 10
  • 32
2
votes
1 answer

fastlane: command not found when running from launchtl job

Hi I made an integration to create the builds of one IOS project using fastlane. Everything works as expected except the moment I try to launch a script to run the fastlane command on my Mac Computer using launchctl. When I run the job I get the…
Programmer Hugo
  • 135
  • 2
  • 7
2
votes
0 answers

Can I set the loading order of processes in launchctl

This relates to an OSX local server development environment using nginx, mysql and php. Problem: Each reboot OSX loads nginx and mysql using launchctl. On reboot, nginx loads before mysql creating an error when my browser re-opens (mysql is not…
jdk
  • 143
  • 7