[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A proxy of the proc server for translators
From: |
zhengda |
Subject: |
A proxy of the proc server for translators |
Date: |
Tue, 24 Jun 2008 22:56:03 +0200 |
User-agent: |
Thunderbird 2.0.0.14 (X11/20080421) |
Hi everyone,
I want to write a proxy of the proc server (proc_proxy), so I can
provide a pseudo master device port to the translator without changing
its code.
My first idea was to create a message server which handles all RPCs in
process.defs. When a request comes, the message server calls the
corresponding RPC to the real process server.
The proxy forks a child process, override the proc port of the child
process to point to itself so the proxy can get the request from the
child process, and executes the user's command in the child process.
For example, to run a pfinet server, the command can be like this:
proc_proxy settrans -afgpc /root/socket2/2 /root/hurd/pfinet/pfinet -i
eth0 -a 192.168.2.11 -g 192.168.2.1 -m 255.255.255.0
There are some problems:
1. the proxy does override the proc port of the child process where runs
settrans, but it seems the translator still uses the original proc
server. The task of the translator is created directly by task_create()
so it doesn't inherit the proc server from its parent. I still haven't
find the code where the proc server is set in the process of the translator.
2. when the proc server gets the request, it is always looking for the
process information from the remote port of the caller. When an RPC is
forwarded by the proxy, the process information of the proxy is changed
and the real proc server still doesn't know anything about the process
who sends the request.
3. If the translator is set in the passive mode, it is started by the
file system server. It seems that I don't have a chance to override its
proc server.
Maybe I can run a second proc server for the translator, and change the
master device port in the second proc server. However, the translator is
completely isolated from other processes and this solution still cannot
solve Problem 3 as I mentioned above.
I'm totally lost. Could anyone give me some ideas?
Best,
Zheng Da
- A proxy of the proc server for translators,
zhengda <=