LaunchDaemon loading but not starting

daemonslaunchd

I created a LaunchDaemon to automatically start a mining client when the computer boots. Here is the .plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.example.miner</string>
    <key>ProgramArguments</key>
    <array>
        <string>/bin/sh</string>
        <string>/library/start.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>StandardOutPath</key>
    <string>/tmp/com.example.minerout</string>
</dict>
</plist>

The goal of this LaunchDaemon is to start and keep a cryptocurrency miner running when the computer boots. The miner start script is inside the Library folder, and the miner is in the same folder.

Why is the LaunchDaemon loading, but not starting?

Best Answer

Well I figured out the issue after 30 minutes of adjusting the LaunchDaemon. The issue was in the start.sh file. I had forgotten to correctly set the location of the miner.