mirror of
https://github.com/QubesOS/qubes-doc.git
synced 2024-10-01 01:25:40 -04:00
Reorder steps in RPC service example
Also add a shell prompt character
This commit is contained in:
parent
60d60c5ca7
commit
5ea1118fa1
@ -237,20 +237,23 @@ The code for this file is:
|
||||
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.
|
||||
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.
|
||||
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`:
|
||||
|
||||
/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.
|
||||
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.
|
||||
(dom0 will ask for confirmation first.)
|
||||
|
Loading…
Reference in New Issue
Block a user