Linux
未記錄的 pppd 退出程式碼
如果我的機器(OSX 10.9.2)沒有連接到網際網路,我想使用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
**為什麼 pppd 返回沒有記錄的退出程式碼?**預期的退出程式碼在範圍內
$$ 0, 19 $$. 這個退出程式碼來自哪裡?這個退出程式碼有描述嗎?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<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>BuildMachineOSBuild</key>\n\t<string>13C40z</string>\n\t<key>CFBundleDevelopmentReg", 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 0 pread(0x4, "\317\372\355\376\a\0", 0x1000, 0x0) = 4096 0 fcntl(0x4, 0x3D, 0x7FFF54901190) = 0 0 mmap(0x10B38C000, 0x2000, 0x5, 0x12, 0x4, 0x0) = 0x10B38C000 0 mmap(0x10B38E000, 0x1000, 0x3, 0x12, 0x4, 0x2000) = 0x10B38E000 0 mmap(0x10B38F000, 0x26F0, 0x1, 0x12, 0x4, 0x3000) = 0x10B38F000 0 close(0x4) = 0 0 open_nocancel("/System/Library/Extensions/pptp.ppp\0", 0x1100004, 0x7FDEA8D02370) = 4 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/Extensions/pptp.ppp/Contents\0", 0x1100004, 0x7FDEA8D02573) = 4 0 fstatfs64(0x4, 0x7FFF54902F58, 0x0) = 0 0 getdirentries64(0x4, 0x7FDEAA000600, 0x1000) = 232 0 getdirentries64(0x4, 0x7FDEAA000600, 0x1000) = 0 0 close_nocancel(0x4) = 0 0 open("/System/Library/Extensions/pptp.ppp/Contents/Info.plist\0", 0x0, 0x1B6) = 4 0 fstat64(0x4, 0x7FFF54903218, 0x0) = 0 0 geteuid(0x100000001103, 0x110000001100, 0x10B356308) = 0 0 setsid(0x50000000603, 0x60000000600, 0x7FFF772B15A8) = 3077 0 socket(0x22, 0x3, 0x1) = 3 0 connect(0x3, 0x7FFF549046B0, 0x8) = 0 0 fcntl(0x3, 0x3, 0x0) = 2 0 fcntl(0x3, 0x4, 0x6) = 0 0 socket(0x2, 0x2, 0x0) = 4 0 open_nocancel("/usr/sbin\0", 0x1100004, 0x7FFF922AEB6E) = 5 0 fstatfs64(0x5, 0x7FFF549031B8, 0x0) = 0 0 getdirentries64(0x5, 0x7FDEAA000600, 0x1000) = 4080 0 getdirentries64(0x5, 0x7FDEAA000600, 0x1000) = 4072 0 getdirentries64(0x5, 0x7FDEAA000600, 0x1000) = 648 0 getdirentries64(0x5, 0x7FDEAA000600, 0x1000) = 0 0 close_nocancel(0x5) = 0 0 stat64("/usr/sbin/Contents\0", 0x7FFF549039D8, 0x7FFF54903ABF) = -1 Err#2 stat64("/usr/sbin/Resources\0", 0x7FFF549039D8, 0x7FFF54903ABF) = -1 Err#2 stat64("/usr/sbin/Support Files\0", 0x7FFF549039D8, 0x7FFF54903ABF) = -1 Err#2 stat64("/usr/sbin\0", 0x7FFF54903F58, 0x7FFF5490406B) = 0 0 open_nocancel("/usr/sbin\0", 0x1100004, 0x7FFF922AEB6E) = 5 0 fstatfs64(0x5, 0x7FFF54903188, 0x0) = 0 0 getdirentries64(0x5, 0x7FDEAA000600, 0x1000) = 4080 0 getdirentries64(0x5, 0x7FDEAA000600, 0x1000) = 4072 0 getdirentries64(0x5, 0x7FDEAA000600, 0x1000) = 648 0 getdirentries64(0x5, 0x7FDEAA000600, 0x1000) = 0 0 close_nocancel(0x5) = 0 0 stat64("/usr/sbin/pppd\0", 0x7FFF54903DC8, 0x7FFF54903E7E) = 0 0 open("/usr/sbin/pppd\0", 0x0, 0x1FF) = 5 0 read(0x5, "\317\372\355\376\a\0", 0x200) = 512 0 close(0x5) = 0 0 geteuid(0x7FDEA8D00030, 0x7FFF76F80258, 0x49656E69) = 0 0 kevent64(0x5, 0x7FFF549043A8, 0x1) = 1 0 open("/dev/null\0", 0x2, 0x0) = 6 0 __sysctl(0x7FFF54903AC0, 0x2, 0x7FFF54903AD0) = 0 0 getuid(0x7FDEAA001743, 0x7FFF54903D60, 0x0) = 0 0 getgid(0x7FDEAA001748, 0x7FFF54903D60, 0x0) = 0 0 sigaction(0x1, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x2, 0x7FFF54904758, 0x0) = 0 0 sigaction(0xF, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x14, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x12, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x13, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x1E, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x1F, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x6, 0x7FFF54904758, 0x0) = 0 0 sigaction(0xE, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x8, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x4, 0x7FFF54904758, 0x0) = 0 0 sigaction(0xD, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x3, 0x7FFF54904758, 0x0) = 0 0 sigaction(0xB, 0x7FFF54904758, 0x0) = 0 0 sigaction(0xA, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x7, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x1B, 0x7FFF54904758, 0x0) = 0 0 sigaction(0xC, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x5, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x1A, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x18, 0x7FFF54904758, 0x0) = 0 0 sigaction(0x19, 0x7FFF54904758, 0x0) = 0 0 stat64("/System/Library/Frameworks/Security.framework/Security\0", 0x7FFF549040D0, 0x7FFF8E1A1463) = 0 0 stat64("/System/Library/Frameworks/Security.framework/Security\0", 0x7FFF54903188, 0x7FFF54904030) = 0 0 csops(0xC05, 0x7, 0x7FFF54904510) = 0 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 kevent64(0x5, 0x0, 0x0) = 1 0 kevent64(0x5, 0x10B3AC3C8, 0x1) = 1 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 kevent64(0x5, 0x0, 0x0) = 1 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 kevent64(0x5, 0x7FFF75519130, 0x1) = 1 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 kevent64(0x5, 0x10BC80D88, 0x1) = 1 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 __sysctl(0x7FFF54903A90, 0x2, 0x7FFF54903AA0) = 0 0 getuid(0x7FDEAA00170E, 0x7FFF54903D30, 0x0) = 0 0 getgid(0x7FDEAA001713, 0x7FFF54903D30, 0x0) = 0 0 csops(0x0, 0x0, 0x7FFF54903F04) = 0 0 issetugid(0x0, 0x0, 0x0) = 0 0 pread(0x3, "\312\376\272\276\0", 0x1000, 0x0) = 4096 0 pread(0x3, "\317\372\355\376\a\0", 0x1000, 0x1000) = 4096 0 fcntl(0x3, 0x3D, 0x7FFF54901350) = 0 0 mmap(0x10B357000, 0x2000, 0x5, 0x12, 0x3, 0x1000) = 0x10B357000 0 mmap(0x10B359000, 0x1000, 0x3, 0x12, 0x3, 0x3000) = 0x10B359000 0 mmap(0x10B35A000, 0x2050, 0x1, 0x12, 0x3, 0x4000) = 0x10B35A000 0 close(0x3) = 0 0 stat64("/usr/lib/libbsm.0.dylib\0", 0x7FFF54902D98, 0x7FFF54903C30) = 0 0 stat64("/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration\0", 0x7FFF54902D98, 0x7FFF54903C30) = 0 0 stat64("/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation\0", 0x7FFF54902D98, 0x7FFF54903C30) = 0 0 stat64("/usr/lib/libSystem.B.dylib\0", 0x7FFF54902D98, 0x7FFF54903C30) = 0 0 stat64("/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit\0", 0x7FFF54902D98, 0x7FFF54903C30) = 0 0 stat64("/System/Library/Frameworks/Security.framework/Versions/A/Security\0", 0x7FFF54902D98, 0x7FFF54903C30) = 0 0 stat64("/usr/lib/system/libcache.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libcommonCrypto.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libcompiler_rt.dylib\0", 0x7FFF54902908, 0x7FFF549037A0 = 0 0 stat64("/usr/lib/system/libcopyfile.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libcorecrypto.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libdispatch.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libdyld.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libkeymgr.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/liblaunch.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libmacho.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libquarantine.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libremovefile.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_asl.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_blocks.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_c.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_configuration.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_dnssd.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_info.dylib\0", 0x7FFF54902908, 0x7FFF549037A0 = 0 0 stat64("/usr/lib/system/libsystem_kernel.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_m.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_malloc.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_network.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_notify.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_platform.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_pthread.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_sandbox.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libsystem_stats.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libunc.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libunwind.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/system/libxpc.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0 stat64("/usr/lib/libobjc.A.dylib\0", 0x7FFF54901B48, 0x7FFF549029E0) = 0 0 stat64("/usr/lib/libauto.dylib\0", 0x7FFF54901B48, 0x7FFF549029E0) = 0 0 stat64("/usr/lib/libc++abi.dylib\0", 0x7FFF549015F8, 0x7FFF54902490) = 0 0 stat64("/usr/lib/libc++.1.dylib\0", 0x7FFF549015F8, 0x7FFF54902490) = 0 0 stat64("/usr/lib/libDiagnosticMessagesClient.dylib\0", 0x7FFF549014D8, 0x7FFF54902370) = 0 0 stat64("/usr/lib/libicucore.A.dylib\0", 0x7FFF54902B18, 0x7FFF549039B0) = 0 0 stat64("/usr/lib/libz.1.dylib\0", 0x7FFF54902B18, 0x7FFF549039B0) = 0 0 stat64("/usr/lib/system/libkxld.dylib\0", 0x7FFF54902C48, 0x7FFF54903AE0) = 0 0 stat64("/usr/lib/libxar.1.dylib\0", 0x7FFF54902BA8, 0x7FFF54903A40) = 0 0 stat64("/usr/lib/libsqlite3.dylib\0", 0x7FFF54902BA8, 0x7FFF54903A40) = 0 0 stat64("/usr/lib/libpam.2.dylib\0", 0x7FFF54902BA8, 0x7FFF54903A40) = 0 0 stat64("/usr/lib/libOpenScriptingUtil.dylib\0", 0x7FFF54902BA8, 0x7FFF54903A40) = 0 0 stat64("/usr/lib/libbz2.1.0.dylib\0", 0x7FFF54902A78, 0x7FFF54903910) = 0 0 stat64("/usr/lib/libxml2.2.dylib\0", 0x7FFF54902A78, 0x7FFF54903910) = 0 0 getpid(0x7FFF54903CF8, 0x10B352004, 0xEA60) = 3077 0 shm_open(0x7FFF92E96CE4, 0x0, 0x0) = 3 0 mmap(0x0, 0x1000, 0x1, 0x1, 0x3, 0x0) = 0x10B38B000 0 close_nocancel(0x3) = 0 0 geteuid(0x20000000303, 0x30000000300, 0x10B356308) = 0 0 __sysctl(0x7FFF54904640, 0x2, 0x7FFF54904650) = 0 0 umask(0x1FF, 0x0, 0xFFFFFFFFFFFFFFE0) = 18 0 umask(0x12, 0x0, 0x0) = 511 0 getuid(0x12, 0x0, 0x0) = 0 0 getgroups(0x10, 0x10B33EE20, 0x0) = 13 0 __sysctl(0x7FFF54904738, 0x2, 0x7FFF5490472C) = 0 0 getrlimit(0x1008, 0x7FFF54903DA0, 0x7FFF8BF3CE7C) = 0 0 open_nocancel("/etc/ppp/options\0", 0x0, 0x1B6) = -1 Err#2 getuid(0x4, 0x7FFF76AB4430, 0xFFFFFFFFFFFFFFFF) = 0 0 read(0x4, "\317\372\355\376\a\0", 0x200) = 512 0 open_nocancel("/etc/ppp/postoptions\0", 0x0, 0x1B6) = -1 Err#2 geteuid(0x20000000303, 0x30000000300, 0x7FFF772B15A8) = 0 0 socket(0x22, 0x3, 0x1) = 4 0 close(0x4) = 0 0 close(0x3) = 0 0 getuid(0x7FDEA8E000C0, 0x0, 0xFFFFFFFFFFFFFF01) = 0 0 getgid(0x7FDEA8E000C0, 0x0, 0x0) = 0 0 write(0x1, "Fri Mar 28 10:31:10 2014 : \0", 0x1B) = 27 0 write(0x1, "publish_entry SCDSet() failed: Success!\0", 0x27) = 39 0 write(0x1, "\n\0", 0x1) = 1 0 __sysctl(0x7FFF54902800, 0x2, 0x7FFF54902810) = 0 0 getuid(0x7FDEA9802330, 0x7FFF54902AA0, 0x0) = 0 0 getgid(0x7FDEA9802335, 0x7FFF54902AA0, 0x0) = 0 0 write(0x1, "Fri Mar 28 10:31:10 2014 : \0", 0x1B) = 27 0 write(0x1, "publish_entry SCDSet() failed: Success!\0", 0x27) = 39 0 write(0x1, "\n\0", 0x1) = 1 0 guarded_kqueue_np(0x7FFF54903E98, 0x3, 0x7FFF86283A77) = 5 0 kevent64(0x5, 0x7FFF86296C48, 0x1) = 0 0 workq_kernreturn(0x10, 0x0, 0x58) = 0 0 workq_open(0x10, 0x0, 0x0) = 0 0 bsdthread_create(0x7FFF86283E77, 0x7FFF75518940, 0x10000) = 188403712 0 kevent64(0x5, 0x7FFF54903F18, 0x1) = 1 0 kevent64(0x5, 0x10BC80D88, 0x1) = 1 0 kevent64(0x5, 0x0, 0x0) = 1 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 thread_selfid(0x0, 0x1DC0, 0x7FFF65505550) = 88904 0 shared_region_check_np(0x7FFF54901E38, 0x10B2FB000, 0x4) = 0 0 stat64("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x7FFF54902FE8, 0x7FFF54903F20 = 0 0 open("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x0, 0x0) = 3 0 ioctl(0x3, 0x80086804, 0x7FFF54903D78) = 0 0 kevent64(0x5, 0x7FFF75519130, 0x1) = 1 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 thread_selfid(0x10BD04000, 0x7FFF77A55258, 0x1010101) = 88912 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 open("/dev/dtracehelper\0", 0x2, 0x7FFF54903DF0) = 3 0 __sysctl(0x7FFF54903648, 0x2, 0x7FFF54903658) = 0 0 thread_selfid(0x7FFF77A55310, 0x7FFF77A55258, 0x10101) = 88904 0 bsdthread_register(0x7FFF92F30FBC, 0x7FFF92F30FAC, 0x2000) = 0 0 mprotect(0x10B353000, 0x88, 0x1) = 0 0 mprotect(0x10B35D000, 0x1000, 0x0) = 0 0 mprotect(0x10B373000, 0x1000, 0x0) = 0 0 mprotect(0x10B374000, 0x1000, 0x0) = 0 0 mprotect(0x10B38A000, 0x1000, 0x0) = 0 0 mprotect(0x10B355000, 0x1000, 0x1) = 0 0 mprotect(0x10B353000, 0x88, 0x3) = 0 0 mprotect(0x10B353000, 0x88, 0x1) = 0 0 issetugid(0x7FFF75518480, 0x7FFFFFE00034, 0x7FFFFFE00036) = 0 0 getpid(0x1, 0x10B356000, 0x49656E69) = 3077 0 __mac_syscall(0x7FFF853DCE3F, 0x2, 0x7FFF549034C8) = 0 0 stat64("/AppleInternal\0", 0x7FFF54903548, 0x0) = -1 Err#2 audit_session_self(0x7FFF54903400, 0x7FFF54903238, 0x4) = 4099 0 geteuid(0x7FFF54903400, 0x7FFF54903238, 0x0) = 0 0 getegid(0x7FFF54903400, 0x7FFF54903238, 0x0) = 0 0 getaudit_addr(0x7FFF549034D8, 0x30, 0x0) = 0 0 csops(0xC05, 0x7, 0x7FFF549030C0) = 0 0 getuid(0x7FFF5490371C, 0x7FFF54903718, 0x7FFF54904960) = 0 0 geteuid(0x103, 0x10000000100, 0x7FFF778F8198) = 0 0 getuid(0x103, 0x10000000100, 0x0) = 0 0 __sysctl(0x7FFF54902BC0, 0x4, 0x7FFF54902BD8) = 0 0 issetugid(0x7FFF778D3DC0, 0x0, 0x7FDEA8C062C8) = 0 0 getuid(0x7FFF54902EE4, 0x0, 0x7FFF54904960) = 0 0 issetugid(0x7FFF8808BA90, 0x7FFF549045F4, 0x7FFF54904960) = 0 0 issetugid(0x7FFF758FA678, 0x0, 0x0) = 0 0 read(0x4, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>BuildMachineOSBuild</key>\n\t<string>13C40z</string>\n\t<key>CFBundleDevelopmentReg", 0x4E5) = 1253 0 close(0x4) = 0 0 stat64("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x7FFF54903C08, 0x7FFF54904156) = 0 0 stat64("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x7FFF54902E88, 0x7FFF54903D30) = 0 0 stat64("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x7FFF54903B18, 0xF4290) = 0 0 open("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x0, 0x1FF) = 4 0 close(0x4) = 0 0 stat64("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x7FFF54902E68, 0x7FFF54903D10) = 0 0 open("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x0, 0x0) = 4 0 pread(0x4, "\317\372\355\376\a\0", 0x1000, 0x0) = 4096 0 fcntl(0x4, 0x3D, 0x7FFF54901170) = 0 0 mmap(0x10B392000, 0x5000, 0x5, 0x12, 0x4, 0x0) = 0x10B392000 0 mmap(0x10B397000, 0x1000, 0x3, 0x12, 0x4, 0x5000) = 0x10B397000 0 mmap(0x10B398000, 0x3B00, 0x1, 0x12, 0x4, 0x6000) = 0x10B398000 0 close(0x4) = 0 0 __sysctl(0x7FFF54902800, 0x2, 0x7FFF54902810) = 0 0 getuid(0x7FDEA9001D30, 0x7FFF54902AA0, 0x0) = 0 0 getgid(0x7FDEA9001D35, 0x7FFF54902AA0, 0x0) = 0 0 access("/etc/localtime\0", 0x4, 0x7) = 0 0 open_nocancel("/etc/localtime\0", 0x0, 0x0) = 5 0 fstat64(0x5, 0x7FFF54902B30, 0x0) = 0 0 read_nocancel(0x5, "TZif\0", 0x2A64) = 1323 0 close_nocancel(0x5) = 0 0 thread_selfid(0x10B3AD000, 0x7FFF77A55258, 0x1010101) = 88910 0 __pthread_sigmask(0x1, 0x10B3ACECC, 0x0) = 0 0 kevent64(0x5, 0x10B3AC458, 0x1) = 1 0 madvise(0x10B401000, 0x1000, 0x5) = 0 0 madvise(0x10B601000, 0x1000, 0x5) = 0 0 kevent64(0x5, 0x10B3AC4F8, 0x1) = 1 0 kevent64(0x5, 0x0, 0x0) = 1 0 madvise(0x10B801000, 0x1000, 0x5) = 0 0 kevent64(0x5, 0x10B3AC4F8, 0x1) = 1 0 thread_selfid(0x10BC81000, 0x7FFF77A55258, 0x1010101) = 88911 0 kevent64(0x5, 0x10BC80D28, 0x1) = 1 0 kevent64(0x5, 0x7FFF75519130, 0x1) = 1 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 kevent64(0x5, 0x0, 0x0) = 1 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 socket(0x20, 0x3, 0x1) = 7 0 ioctl(0x7, 0x800C6502, 0x7FFF549042D0) = 0 0 __sysctl(0x7FFF54902460, 0x2, 0x7FFF54902470) = 0 0 getuid(0x7FDEA9001D45, 0x7FFF54902700, 0x0) = 0 0 getgid(0x7FDEA9001D4A, 0x7FFF54902700, 0x0) = 0 0 write(0x1, "Fri Mar 28 10:31:10 2014 : \0", 0x1B) = 27 0 write(0x1, "PPTP connecting to server '11.22.33.44' (11.22.33.44)...\0", 0x3C) = 60 0 write(0x1, "\n\0", 0x1) = 1 0 socket(0x2, 0x1, 0x0) = 8 0 setsockopt(0x8, 0x6, 0x20) = 0 0 connect(0x8, 0x7FFF549042E0, 0x10) = -1 Err#49 __sysctl(0x7FFF54902460, 0x2, 0x7FFF54902470) = 0 0 getuid(0x7FDEA9001D3F, 0x7FFF54902700, 0x0) = 0 0 getgid(0x7FDEA9001D44, 0x7FFF54902700, 0x0) = 0 0 write(0x1, "Fri Mar 28 10:31:10 2014 : \0", 0x1B) = 27 0 write(0x1, "PPTP connect errno = 49 Can't assign requested address\0", 0x36) = 54 0 write(0x1, "\n\0", 0x1) = 1 0 close(0x7) = 0 0 close(0x8) = 0 0 workq_kernreturn(0x20, 0x0, 0x1) = 0 0 kevent64(0x5, 0x7FFF75519130, 0x1) = -1 Err#4
十六進制的 25 是 0x19,但這個數字不會出現在任何地方。
在OSX 1.9 pppd 原始碼中,我在以下位置找到了這個
Helpers/pppd/pppd.h
:#ifdef __APPLE__ #define EXIT_TERMINAL_FAILED 20 #define EXIT_DEVICE_ERROR 21 #endif #ifdef MAXOCTETS #ifdef __APPLE__ #define EXIT_TRAFFIC_LIMIT 22 #else #define EXIT_TRAFFIC_LIMIT 20 #define EXIT_CNID_AUTH_FAILED 21 #endif #endif #ifdef __APPLE__ #define EXIT_PEER_NOT_AUTHORIZED 23 #define EXIT_CNID_AUTH_FAILED 24 #define EXIT_PEER_UNREACHABLE 25 #endif
所以 Apple 有自己的一些退出程式碼,而你的定義為
EXIT_PEER_UNREACHABLE
. 無需贅述,看起來這個退出程式碼僅在外掛失敗時使用(在Helpers/pppd/main.c
第 638 行)。