Skip to content

Commit

Permalink
doc: document --no-debug, which is set by default in our own systemd …
Browse files Browse the repository at this point in the history
…service

This can be immensely frustrating to users since there is no mention
whatsoever in the documentation of why their logs are getting eaten.

Fixes polkit-org#154.
  • Loading branch information
lf- committed Feb 16, 2024
1 parent 180ff19 commit 8fc29d3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/man/polkit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,18 @@ polkit.Result = {
with the JavaScript filename and line number. Log entries are
emitted using the <constant>LOG_AUTHPRIV</constant> flag meaning
that the log entries usually ends up in the file
<filename>/var/log/secure</filename>. The
<function>log()</function> method is usually only used when
<filename>/var/log/secure</filename> or in
<command>journalctl -b SYSLOG_FACILITY=10</command> on systemd.
</para>
<para>
On some distributions, the flag <literal>--no-debug</literal> is passed
to <command>polkitd</command> by default, discarding log output. This
means that to debug a rule, it must removed first, say with
<command>systemctl edit --runtime polkit.service</command>, for the
current boot.
</para>
<para>
The <function>log()</function> method is usually only used when
debugging rules. The <type>Action</type> and
<type>Subject</type> types has suitable
<function>toString()</function> methods defined for easy
Expand Down
9 changes: 9 additions & 0 deletions docs/man/polkitd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<refsynopsisdiv>
<cmdsynopsis>
<command>polkitd</command>
<arg><option>--replace|-r</option></arg>
<arg><option>--no-debug|-n</option></arg>
<arg><option>--help|-h</option></arg>
</cmdsynopsis>
</refsynopsisdiv>

Expand All @@ -40,6 +43,12 @@
whenever an application calls into the service.
</para>

<para>
Passing the <option>--no-debug</option> to <command>polkitd</command>
will discard the messages from usages of <literal>polkit.log()</literal>
in rules.
</para>

<para>
<command>polkitd</command> must be started with superuser
privileges but drops privileges early by switching to the
Expand Down

0 comments on commit 8fc29d3

Please sign in to comment.