简体   繁体   English

如何使用dtrace(或其他方法)找出Mac上ddclient的配置文件在哪里?

[英]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.

相关问题 在哪里可以找到有关如何在Mac上安装Vala的说明? - Where can I find instructions on how to install Vala on my Mac? 如何知道我的c ++应用程序在Mac上使用了多少内存 - How can I find out how much memory my c++ app is using on the Mac 如何在Mac OS X Leopard上的dtrace中使用热点探针? - How to use hotspot probes in dtrace on Mac OS X Leopard? 我在哪里可以找到有关MacOS产品分发文件的信息? - Where can I find out about a MacOS Product Distribution File? 我在哪里可以找到Mac上的Icon Composer? - Where can i find Icon Composer on Mac? 如何在我的 Mac 上找到 Joda-Time Jar 文件? - How can i find Joda-Time Jar file on my Mac? 我在哪里可以找到 Mac 上的 bashrc 文件? - Where do I find the bashrc file on Mac? 新手开发人员:在哪里可以从Mac打印出可可框架? - newbie developer: where can I print out the cocoa framework from my mac? 在我运行 docker compose up 后,我的 mac 返回错误,指出它找不到我的 mix phx.server。 如何向 docker 显示我的 mix.exs 文件在哪里? - After I run docker compose up, my mac returns error stating that it can't find my mix phx.server. How do I show docker where my mix.exs file is? 在哪里可以从Windows到Mac上获得IDEA的配置热键? - Where can I get config hotkeys for IDEA like on Windows to Mac?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM