如果我的机器(OSX 10.9.2)未连接到Internet,并且我想通过使用pppd建立pptp连接:
$ sudo /usr/sbin/pppd serviceid 5BE14D3A-7B94-4704-ADE0-9883B189199E debug logfile /tmp/ppp.log plugin /System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp plugin pptp.ppp remoteaddress 11.22.33.44 redialcount 1 redialtimer 5 idle 1800 mru 1500 mtu 1448 receive-all novj 0:0 noipdefault ipcp-accept-local ipcp-accept-remote user bbbbbb password cccccc hide-password noaskpassword looplocal defaultroute usepeerdns mppe-128 nodetach logfd 1
pppd输出:
Thu Mar 27 15:09:30 2014 : publish_entry SCDSet() failed: Success!
Thu Mar 27 15:09:30 2014 : publish_entry SCDSet() failed: Success!
并以退出代码25终止:
$ echo $?
25
Why pppd returns with exit code which is not documented? Expected exit codes are in the range [0, 19]. Where does this exit code come from? Does this exit code have description? Are there any other "hidden" exit codes for pppd?
如果我连接到Internet并运行相同的命令,则会建立pptp连接。
dtruss输出的最后两行是:
$ /usr/bin/sudo dtruss /usr/sbin/pppd serviceid 5BE14D3A-7B94-4704-ADE0-9883B189199E debug logfile /tmp/ppp.log plugin /System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp plugin pptp.ppp remoteaddress 11.22.33.44 redialcount 1 redialtimer 5 idle 1800 mru 1500 mtu 1448 receive-all novj 0:0 noipdefault ipcp-accept-local ipcp-accept-remote user bbbbbbb password cccccccc hide-password noaskpassword looplocal defaultroute usepeerdns mppe-128 nodetach logfd 1
Fri Mar 28 10:31:10 2014 : publish_entry SCDSet() failed: Success!
Fri Mar 28 10:31:10 2014 : publish_entry SCDSet() failed: Success!
Fri Mar 28 10:31:10 2014 : PPTP connecting to server '11.22.33.44' (77.75.123.187)...
Fri Mar 28 10:31:10 2014 : PPTP connect errno = 49 Can't assign requested address
SYSCALL(args) = return
close(0x3) = 0 0
getuid(0x0, 0x1103, 0x7FFF772B14E0) = 0 0
getgid(0x0, 0x1103, 0x0) = 0 0
getuid(0x7FDEA8D00A80, 0x0, 0x1) = 0 0
seteuid(0x0, 0x0, 0x0) = 0 0
open_nocancel("/var/root/.ppprc\0", 0x0, 0x1B6) = -1 Err#2
seteuid(0x0, 0x7FFF76AB4430, 0xFFFFFFFFFFFFFFFF) = 0 0
open("/tmp/ppp.log\0", 0xA09, 0x1A4) = -1 Err#17
open("/tmp/ppp.log\0", 0x9, 0xFFFFFFFFFFFFFFFF) = 3 0
open_nocancel("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp\0", 0x1100004, 0x7FDEA8D00D70) = 4 0
__sysctl(0x7FFF54902F38, 0x2, 0x7FFF76AB4180) = 0 0
fstatfs64(0x4, 0x7FFF54902F88, 0x0) = 0 0
getdirentries64(0x4, 0x7FDEAA000600, 0x1000) = 88 0
getdirentries64(0x4, 0x7FDEAA000600, 0x1000) = 0 0
close_nocancel(0x4) = 0 0
open_nocancel("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents\0", 0x1100004, 0x7FDEA8D01173) = 4 0
fstatfs64(0x4, 0x7FFF54902F58, 0x0) = 0 0
getdirentries64(0x4, 0x7FDEAA000600, 0x1000) = 240 0
getdirentries64(0x4, 0x7FDEAA000600, 0x1000) = 0 0
close_nocancel(0x4) = 0 0
open("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/Info.plist\0", 0x0, 0x1B6) = 4 0
fstat64(0x4, 0x7FFF54903218, 0x0) = 0 0
read(0x4, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n\n\n\tBuildMachineOSBuild\n\t13C40z\n\tCFBundleDevelopmentReg", 0x4F1) = 1265 0
close(0x4) = 0 0
stat64("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x7FFF54903C08, 0x7FFF54904156) = 0 0
stat64("/usr/lib/libesp.dylib\0", 0x7FFF549031C8, 0x7FFF54904070) = -1 Err#2
stat64("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x7FFF54902E88, 0x7FFF54903D30) = 0 0
stat64("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x7FFF54903B18, 0xF9A90) = 0 0
open("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x0, 0x1FF) = 4 0
read(0x4, "\317\372\355\376\a\0", 0x200) = 512 0
close(0x4) = 0 0
stat64("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x7FFF54902E68, 0x7FFF54903D10) = 0 0
open("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x0, 0x0) = 4