I have a plist in /Library/LaunchDaemons/
that should run as root on startup.
When I run sudo launchctl load /Library/LaunchDaemons/com.apple.pfctl.plist
, it works. However on reboot it does not work.
Interestingly, after reboot, when I run that command it says /Library/LaunchDaemons/com.apple.pfctl.plist: service already loaded
but it is not functioning. However, if I unload and load it works normally.
Nothing appears in my error reporting /tmp/pfctl.err
.
My plist is here:
<?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.apple.pfctl</string>
<key>ProgramArguments</key>
<array>
<string>pfctl</string>
<string>-e</string>
<string>-f</string>
<string>/etc/pf.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/tmp/pfctl.err</string>
<key>StandardOutPath</key>
<string>/tmp/pfctl.out</string>
</dict>
</plist>
pfctl
by issuing the commanddmesg | grep -i pfctl
We need to see what errors are being generated, if any.<string>pfctl</string>
to<string>/sbin/pfctl</string>
or add<key>Program</key>
and<string>/sbin/pfctl</string>
beforeProgramArguements
.dmesg | grep -i pfctl
didn't show any output