
権限のないユーザーが自分の$HOME/.init
ディレクトリから upstart ジョブを実行できるようにしようとしています。
Upstartの料理本には、これを有効にするしかし、それをどう行うかについては触れられていない。その不満は次のように要約できる。@ropez のコメント:
ドキュメントには記載されていないようですどうやってユーザージョブを有効にするには、設定ファイルのみを記載しており、管理者がそれを実行する必要がある。
start
権限のないユーザーとしてジョブを実行しようとすると、引き続きこのエラーが発生します。
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.70"
これまで私が見つけた最も近いものは、誰かがUpstart.confにパッチを当てたしかし、私が使用している Ubuntu 12.04 のものよりもずっと短いようです。
これを行うための標準的で明確に定義された方法はありますか?
答え1
リンク先の「パッチを当てた」Upstart構成は、アップスタート 1.3(からUpstart でユーザー ジョブを実行できません) なので、これがユーザー ジョブを有効にする最も簡単な方法だと言えます。
答え2
このソリューションは、Ubuntu 12.04 上の Upstart 1.5 で機能します。
Upstart 設定を開きます:
sudo vim /etc/dbus-1/system.d/Upstart.conf
ポリシーをコメントアウトしますdefault
。
<policy context="default">
...
</policy>
ブロックを貼り付けるこのパッチ:
<!--
Allow any user to invoke all of the methods on Upstart, its jobs
or their instances, and to get and set properties - since Upstart
isolates commands by user.
-->
<policy context="default">
<allow send_destination="com.ubuntu.Upstart"
send_interface="org.freedesktop.DBus.Introspectable" />
<allow send_destination="com.ubuntu.Upstart"
send_interface="org.freedesktop.DBus.Properties" />
<allow send_destination="com.ubuntu.Upstart"
send_interface="com.ubuntu.Upstart0_6" />
<allow send_destination="com.ubuntu.Upstart"
send_interface="com.ubuntu.Upstart0_6.Job" />
<allow send_destination="com.ubuntu.Upstart"
send_interface="com.ubuntu.Upstart0_6.Instance" />
</policy>