7

リアルタイム通信のために別のプロセスにシグナルを送信する必要がありますが、プロセスは別のユーザーに属しています。

例えば

PID   user   group
1234  foo    foobar   
4321  bar    foobar

プロセス 1234 と 4321 が互いにシグナルを送信できるようにしたいですか?

ソケットまたはパイプを使用している場合、マスクを設定するrw-rw-r--と通信が機能します。ただし、信号を使用して通信を行う必要があります(通常またはリアルタイム、重要ではありません)。

それを行う方法はありますか?

4

1 に答える 1

9

kill(2) からの引用:

For a process to have permission to send a signal it must either be privileged
(under Linux: have the CAP_KILL capability), or the real or effective user ID
of the sending process must equal the real or saved set-user-ID of the target
process.  In the case of SIGCONT it suffices when the sending and receiving
processes belong to the same session.

capabilities(7) と setcap(8) が便利です。

于 2012-11-11T20:22:09.840 に答える