mirror of
https://github.com/QubesOS/qubes-doc.git
synced 2025-06-06 22:19:09 -04:00
Reorder steps in RPC service example
Also add a shell prompt character
This commit is contained in:
parent
60d60c5ca7
commit
5ea1118fa1
1 changed files with 11 additions and 8 deletions
|
@ -237,20 +237,23 @@ The code for this file is:
|
||||||
echo $(($arg1+$arg2)) # print to stdout, which is passed to the RPC client
|
echo $(($arg1+$arg2)) # print to stdout, which is passed to the RPC client
|
||||||
|
|
||||||
We'll need to create a service called `test.Add` with its own definition and policy file in dom0.
|
We'll need to create a service called `test.Add` with its own definition and policy file in dom0.
|
||||||
In dom0 add the following test to `/etc/qubes-rpc/policy/test.Add`:
|
|
||||||
|
|
||||||
$anyvm $anyvm ask
|
|
||||||
|
|
||||||
Now we need to define what the service does.
|
Now we need to define what the service does.
|
||||||
In this case, it should call our additing script.
|
In this case, it should call our addition script.
|
||||||
We define the service with another one-line file, `/etc/qubes-rpc/test.Add`:
|
We define the service with another one-line file, `/etc/qubes-rpc/test.Add`:
|
||||||
|
|
||||||
/usr/bin/our_test_add_server
|
/usr/bin/our_test_add_server
|
||||||
|
|
||||||
|
The adminstrative domain will direct traffic based on the current RPC policies.
|
||||||
|
In dom0, create a file at `/etc/qubes-rpc/policy/test.Add` containing the following:
|
||||||
|
|
||||||
|
$anyvm $anyvm ask
|
||||||
|
|
||||||
|
This will allow our client and server to communicate.
|
||||||
|
|
||||||
Before we make the call, ensure that the client and server scripts have executable permissions.
|
Before we make the call, ensure that the client and server scripts have executable permissions.
|
||||||
Now, invoke the RPC service!
|
Finally, invoke the RPC service.
|
||||||
|
|
||||||
qrexec-client-vm anotherVM test.Add /usr/bin/our_test_add_client 1 2
|
$ qrexec-client-vm anotherVM test.Add /usr/bin/our_test_add_client 1 2
|
||||||
|
|
||||||
We should get "3" as answer.
|
We should get "3" as answer.
|
||||||
(dom0 will ask for confirmation first.)
|
(dom0 will ask for confirmation first.)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue