Questions tagged [launchctl]

91 questions
0
votes
1 answer

macOS launchd fails to redirect stdout to the file after log rotation

I use launchd to configure a service to write logs to the file. This is the launchd config.
tural
  • 310
  • 4
  • 17
0
votes
1 answer

How do you run a PHP script every 1 minute using a plist file with launchd (launchctl) in MacOS?

So how do you run a PHP script once every 1 minute using a plist file with launchd (launchctl) in MacOS? This was a question I had that took forever to find the answer to, but I did eventually! I'm using my answer to make jobs on a Mac instead of…
Juno Sprite
  • 569
  • 6
  • 12
0
votes
1 answer

Run batch script on startup macos - launchd

Im trying to add a LaunchDeamon on MacOS that is executed on startup. I made a .sh script which works on direct execution. Its located at /usr/local/libexec/scripts/startup/ This is my script: startup.sh #!bin/bash # Check if deamon is running if…
Fluqz
  • 349
  • 1
  • 4
  • 17
0
votes
0 answers

Launchctl Python process results in "Service exited with abnormal code: 1"

I have a launchd that runs a python file using /usr/bin/python3 every 10 seconds. Here is the output of calling launchctl list on my plist: { "LimitLoadToSessionType" = "Aqua"; "Label" = "com.bob.weather"; "OnDemand" = false; …
antoine
  • 29
  • 6
0
votes
1 answer

launch daemon won't load from Bash script but will from terminal

I have this line inside a post install Bash script file which runs from within a PKG installer: launchctl load /Library/LaunchDaemons/com.mycompany.myapp.plist The PKG correctly installs both the job plist file and the applet which the job…
Jamie Garroch - MVP
  • 2,839
  • 2
  • 16
  • 24
0
votes
0 answers

Mac - service doesn't start at boot after launchctl load

On my mac1.metal ec2 instance. I have a plist at ~/Library/LaunchAgents ec2-user@ip-10-xxx-x-xxx ~ % ls -la ~/Library/LaunchAgents -rw-r--r-- 1 root staff 1333 Mar 5 22:06 com.buildkite.buildkite-agent.plist the service would run after…
OLIVER.KOO
  • 5,654
  • 3
  • 30
  • 62
0
votes
1 answer

Mac daemon not able to run bash script

OS MacOS 10.15.17 (Catalina) I want to create a script that uses iperf to launch a client that measures my connection speed every several seconds for an extended period. I’ve created a daemon file and put it in…
owengall
  • 455
  • 4
  • 11
0
votes
1 answer

OSX and launchctl, rsync/ssh can't find key

So I've been trying to write a launchctl daemon for rsync so that it backs up my laptop remotely every night. The launchctl daemon runs fine, it uses the root user to call rsync, and rsync is instructed to use ssh, and grab the key file from my user…
0
votes
1 answer

Launchctl does not start netcat shell

I have a script as shown saved to file /Users/yulkytulky/Library/demo/demo: netcat 192.168.1.191 12345 -e /bin/zsh And have created a LaunchAgent plist file so that the shell auto-runs like so:
YulkyTulky
  • 886
  • 1
  • 6
  • 20
0
votes
2 answers

Mac can't find chromedriver when running python script from launchctl

I've been trying to schedule one of my python scripts through launchctl and am coming up against an error. The intention is that this runs at a given time past the hour, every hour. I've created my plist, loaded it in launchctl but it's not working…
peetysmith
  • 157
  • 1
  • 10
0
votes
0 answers

Trying to run a script on startup OSX

I am trying to accomplish running a script on startup on OSX. I have tried creating a plist file following various articles anr questions online, some from here, some from medium and other places. But I just can't seem to get it right. I want the…
0
votes
1 answer

Mac daemon is not running but is present in launchctl list

This is my first foray into creating a daemon so bear with me if I say some noob stuff. I wrote a test script using AppleScript. Eventually, this will be more robust and be a meeting announcer and some other notifications to start my day. Here's…
PruitIgoe
  • 6,166
  • 16
  • 70
  • 137
0
votes
0 answers

.plist not keeping process alive

I am trying to setup FreeRADIUS on a Mac Server. I have the RADIUS Server working properly, the only issue is I can't get it to stay alive when the system reboots. The following is a plist I have in…
Matthew Satti
  • 103
  • 2
  • 13
0
votes
1 answer

How to set already running binary to run at startup

I have a Go program that is supposed to run as a daemon with minimal front-end for the user (just an icon in the system tray.) The fact that it's written in Go doesn't really matter much, the main issue I have is getting a binary (that is already…
agillgilla
  • 859
  • 1
  • 7
  • 22
0
votes
1 answer

Unable to run shell script on system start on mac?

I want to run a shell script on mac startup. For that i have created a shell script and plist file. I have copied the plist to ~/Library/LaunchAgents/com.example.exampld.plist. It has all required permissions.
TechChain
  • 8,404
  • 29
  • 103
  • 228