On Срд, 14 мая 2025, Данила Скачедубов wrote:
Thank you very much, everything worked as expected! I just have a couple of follow-up questions: 1. Am I correct in understanding that this only works if the method is exposed on a D-Bus interface like org.freeipa.server, or another one explicitly defined in the oddjobd.conf.d configuration?
Correct, you have to define the method and corresponding handler for it explicitly.
2. Also, I'm wondering about debugging: I noticed that using print() doesn’t produce any output, likely because the plugin runs under Apache with no access to stdout. What is the recommended way to debug or inspect variables in this case? Should I use api.log or is there a better approach?
Your handler script can return output on stdout and stderr. You can collect them from the DBUS call and then print it to Apache error log. For example: https://github.com/freeipa/freeipa/blob/master/ipaserver/plugins/config.py#L568-L588 or https://github.com/freeipa/freeipa/blob/master/ipaserver/plugins/trust.py#L430-L484 While the first example does not print returned stdout/stderr in case of an error, the second example prints it to the Apache error log file. -- / Alexander Bokovoy Sr. Principal Software Engineer Security / Identity Management Engineering Red Hat Limited, Finland -- _______________________________________________ FreeIPA-users mailing list -- [email protected] To unsubscribe send an email to [email protected] Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/[email protected] Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
