... So what i understand is that i need to change "$DESKTOP" 2>-tmp etc into "$DESKTOP=rdesktop" ? is that right?
NOPE!! The environment variable $DESKTOP contains the name of the WM. It's value will be determined by the '/etc'sysconfig/desktop' file (with a default value of 'flwm_topside'). Alternatively one could use the 'desktop=WM-NAME' boot code to change the value in '/etc'sysconfig/desktop' (and hence the WM).
I dont need to change the ability of the user to crash the xserver or get to the terminal session, i just want to start rdesktop before any WM starts.
I get the impression you don't understand what a WM does (you might want to have a quick look here
), and are confusing it with the function of the X server. The minimal requirement for 'rdesktop' to run would be a running X server.
I can't see any point why one would like to start a GUI application (like 'rdesktop') before the WM gets started (via $DESKTOP" 2>/tmp/wm_errors
in '~/.xsession') as compared to using the already provided '~/X.d' mechanism. The startup time of the default WM (plus potentially 'wbar') is so small that I don't see the point. OTOH I can understand that someone would like to operate in a kiosk mode (i.e. just run one specific GUI application instead of a WM which would allow to start multiple applications). So if one is happy enough to "shake things up" one could replace all but the first two lines of '~/.xsession' (or rather '/etc/skel/.xsession' in the case of a remastering) with the startup command sequence of the intended GUI application.
As I explained in the other thread I'm not a user of 'rdesktop' but after running a quick "30 second test" I'm now certain that the 'desktop=rdesktop' suggestion won't work. The reason is that the 'rdesktop' command actually needs at least a SERVER parameter to work (and that can't be supplied via the current way of executing $DESKTOP in '~/.xsession'). But if one is prepared to install the 'xdrdesktop.tcz' extension instead (or rather in addition) of 'rdesktop.tcz' the "trick" via a boot code (i.e. 'desktop=xdrdektop') without the need to make changes to other files should work OK. It might be worth to also add the 'noicons' boot code, to prevent the running of 'wbar'.
Furthermore the need to specify a SERVER parameter when executing 'rdektop' means that one would have to be hard-coded somewhere in the remastered initrd (either via '~/.X.d' or via '.xsession'). That might be OK if there is only ever one server one wants to connect to. Using 'xdrdesktop' instead would make things more flexible, or a custumised '/etc/skel/.rdesktop/xdrdesktop' could be included in the remastered initrd that contains some sane default values (e.g. some servers to choose from).