[英]How can I use dtrace (or whatever) to find out where the config file is for ddclient on my mac?
I cannot find an example of how to do this anywhere: I have ddclient installed on my mac, but none of the command line switches appear to have any effect, so I'm trying to modify the config but I can't find the darn thing. 我在任何地方都找不到如何执行此操作的示例:我在Mac上安装了ddclient,但是所有命令行开关似乎均无效,因此我尝试修改配置,但找不到该织补事情。
So I figured that since dtrace is supposed to be like strace I could run dtrace and figure out what file ddclient is opening up... but 所以我认为既然dtrace应该像strace一样,我可以运行dtrace并找出ddclient正在打开的文件...但是
dtrace -n 'proc:::exec-success { trace(curpsinfo->pr_psargs); }'
from handy one-liners doesn't appear to take any arguments. 从方便的单线来看似乎没有任何论点。 So how can I figure out where my config is?
那么,如何确定我的配置在哪里?
As it turns out, dtrace is not designed to spawn processes for you, you have to do that yourself in a separate shell. 事实证明,dtrace并非旨在为您生成进程,您必须在单独的shell中自己进行操作。
The correct command is actually: 正确的命令实际上是:
sudo dtrace -n 'syscall::open*:entry /strstr(copyinstr(arg0), "ddclient.conf") != NULL/ { printf("%s %s",execname,copyinstr(arg0)); }
Then in a different terminal, run ddclient as normal. 然后在其他终端上,正常运行ddclient。 You'll see in the dtrace window something like this:
您将在dtrace窗口中看到以下内容:
CPU ID FUNCTION:NAME
2 166 open:entry perl5.18 /usr/local/etc/ddclient/ddclient.conf
2 166 open:entry perl5.18 /usr/local/etc/ddclient/ddclient.conf
And that's where the config file will be. 这就是配置文件所在的位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.