Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to create a launchd plist that causes vpnd to launch at startup. vpnd works fine when invoked from the command line, but I can't figure out how to make a plist that does the same thing. Can anyone help? Here's what I've cobbled together so far:

<?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.apple.ppp.l2tp</string>
 <key>OnDemand</key>
 <false/>
 <key>Program</key>
  <string>/usr/sbin/vpnd</string>
 <key>ProgramArguments</key>
  <array>
   <string>vpnd</string>
  </array>
 <key>RunAtLoad</key>
 <true/>
</dict>
</plist>

Running it with launchctl -w has no effect, triggers no errors, and outputs nothing to the console. Does the XML look right?

share|improve this question
1  
This does not answer your question, but have you tried Lingon? It hasn't been updated for a year but still works well for 10.6. sourceforge.net/projects/lingon/files – fideli Dec 31 '09 at 5:57
    
actually, this is just fine. it works perfectly for my needs. thanks very much! – michaelmichael Jan 4 '10 at 20:52
up vote 3 down vote accepted

I grabbed this from a 10.4 server...

/System/Library/LaunchDaemons/com.apple.ppp.l2tp.plist

<?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.apple.ppp.l2tp</string>
    <key>OnDemand</key>
    <false/>
    <key>Program</key>
    <string>/usr/sbin/vpnd</string>
    <key>ProgramArguments</key>
    <array>
        <string>vpnd</string>
        <string>-x</string>
        <string>-i</string>
        <string>com.apple.ppp.l2tp</string>
    </array>
    <key>ServiceIPC</key>
    <false/>
</dict>
</plist>
share|improve this answer

Looking at the some other plist files in /System/Library/LaunchDaemons, the ProgramArguments entry seems to wrong; you need the full path of the program here.

Remove the Program key and Try something like this:

<key>ProgramArguments</key>
<array>
        <string>/usr/sbin/vpnd</string>
</array>

Also, you might want to add a KeepAlive key as well.

man launchd.plist can help.

share|improve this answer

You must log in to answer this question.

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