I am trying to open a program in a naked X-server on a different virtual terminal. I am using ubuntu 9.10.
The command I'm using is this.
openvt -f -s -- `X :2 & '/path/to/program' -display :2`;
Now, when the program shuts down I want the X-server to be killed as well.
So my question is this: How can I save the PID of the new X-server (X :2) to then later kill it?
It is going to be used in a normal shell script.