0

I would like to start an ntpd on my MacOSX 10.8. ntpd is configured correctly and runs when started manually. I would like to start it on boot time with lauchdaemon.

I created this com.stefan.ntp.plist file in /Library/LaunchDaemons:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.stefan.ntpd</string>
        <key>Program</key>
        <string>/usr/sbin/ntpd</string>
        <key>ProgramArguments</key>
        <array>
            <string></string>
        </array>
    </dict>
</plist>

Added it to the Launchdaemon with

launchctl load /Library/LaunchDaemons/com.stefan.ntpd.plist

However, it does not start.

sh-3.2# launchctl list | grep ntpd
-   0   com.stefan.ntpd
sh-3.2# launchctl start com.stefan.ntpd
sh-3.2# launchctl list | grep ntpd
-   0   com.stefan.ntpd

Any ideas?

  • Maybe try to use launchd to run a simple shell script which appends a timestamp to /tmp/hello.txt first and then try to include ntpd in a second step. – nohillside Aug 5 '13 at 13:11
1

There should be an ntpd process started by /System/Library/LaunchDaemons/org.ntp.ntpd.plist by default in 10.8.

The plist is also missing <key>RunAtLoad</key><true/>, but I couldn't get this to work either:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.stefan.ntpd</string>
  <key>Program</key>
  <string>/usr/sbin/ntpd</string>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>
| improve this answer | |
  • 1
    It works wit <key>Program</key> <string>/usr/libexec/ntpd-wrapper</string> <key>RunAtLoad</key> – Stef Aug 5 '13 at 13:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .