12,964
回編集
247行目: | 247行目: | ||
# annotate 4エレメント | # annotate 4エレメント | ||
#: GUIがXディスプレイを開くことを許可するかどうかを記述する。 | #: GUIがXディスプレイを開くことを許可するかどうかを記述する。 | ||
<br><br> | |||
== PolKitの設定例 ==== | |||
PolicyKitにカスタムアクションを追加することにより、root権限でGUIソフトウェアを実行することができる。<br> | |||
<br> | |||
例えば、<code>pkexec</code>コマンドを使用してgeditを実行する場合、<br> | |||
/usr/share/polkit-1/actions/org.freedesktop.policykit.gedit.policyファイルを作成する必要がある。<br> | |||
<syntaxhighlight lang="xml"> | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" | |||
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd"> | |||
<policyconfig> | |||
<action id="org.freedesktop.policykit.pkexec.gedit"> | |||
<description>Run gedit program</description> | |||
<message>Authentication is required to run the gedit</message> | |||
<icon_name>accessories-text-editor</icon_name> | |||
<defaults> | |||
<allow_any>auth_admin</allow_any> | |||
<allow_inactive>auth_admin</allow_inactive> | |||
<allow_active>auth_admin</allow_active> | |||
</defaults> | |||
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/gedit</annotate> | |||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate> | |||
</action> | |||
</policyconfig> | |||
</syntaxhighlight> | |||
<br> | |||
詳細を知りたい場合は、以下に示すURLにアクセスして、リファレンスマニュアルを参照すること。<br> | |||
http://www.freedesktop.org/software/polkit/docs/0.105/pkexec.1.html<br> | |||
<br><br> | <br><br> | ||
__FORCETOC__ | __FORCETOC__ | ||
[[カテゴリ:CentOS]][[カテゴリ:SUSE]][[カテゴリ:Raspberry_Pi]][[カテゴリ:PinePhone]] | [[カテゴリ:CentOS]][[カテゴリ:SUSE]][[カテゴリ:Raspberry_Pi]][[カテゴリ:PinePhone]] |