Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

squidmunk

macrumors newbie
Original poster
Jul 29, 2024
4
0
I have this in /Library/LaunchDaemons/org.cons.rc-local.plist:
Code:
<?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>org.cons.rc-local</string>
        <key>WorkingDirectory</key>
        <string>/tmp</string>
        <key>ProgramArguments</key>
        <array>
                <string>/bin/sh</string>
                <string>/etc/rc.local</string>
        </array>
        <key>StandardErrorPath</key>
        <string>/private/var/log/org.org.cons.rc-local.log</string>
        <key>StandardOutPath</key>
        <string>/private/var/log/org.org.cons.rc-local.log</string>
</dict>
</plist>

/etc/rc.local is a sh script that leaves a mark in /tmp so that I verify that it gets invoked. It does not. The script is mode 755 and owned by root.

I activated it with launchctl.

No logfile mentions anything about this, no error messages, it is like no plist is present at all.

Can anybody spot what is wrong? How do I debug this? How do I get macOS to log anything about this?

Thank you.
 
As soon as you run sudo chown root:wheel /Library/LaunchDaemons/org.cons.rc-local.plist, sh should appear in System Settings - General - Login Items. Do you have it? Is it enabled?
 
The launchctl cmd has a number of subcommands that tell you various things about the launchd state. The simplest is probably 'list'; the most extensive 'dumpstate'. The dumpstate output is probably most usefull if redirected into a text file for further breakdown or analysis. I'd start by seeing if your task's label appears at all in the 'list' output.

The builtin help for launchctl gives summaries:
Code:
launchctl help
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.