Example Configurations

This section has some example configurations that are useful for various setups.

12.1. Terminal Lab With One Server

Suppose you want to make a lab full of X terminals that all connect to one server machine. So let's call one X terminal xterminal and let's call the server machine appserver. You install GDM on both.

On appserver you enable XDMCP, so you have

[xdmcp]
Enable=true
If you want no local screens here, you can then make the [servers] section empty.

On the xterminal you disable XDMCP (you don't want anyone to connect to the xterminal really). You will add a server type perhaps called Terminal as follows:

[server-Terminal]
name=Terminal server
command=/path/to/X -terminate
flexible=false
handled=false
This definition should in fact be included in the standard configuration file. Notice that we made the handled key false since we don't want GDM to handle this server localy. Also note that we have not yet added the -query argument, you can add that here, or in the [servers] section. We'll define our local servers as follows:
[servers]
0=Terminal -query appserver
This will run a direct XDMCP query to the server named appserver.

12.2. Terminal Lab With Two Or More Servers

Suppose you want to make a lab full of X terminals that all connect to some choice of servers. For now let's make it appserverone and appservertwo. Again we'll call our example X terminal server xterminal. The setup on both servers is the same as with the case of one server in the previous section. You do not need to explicitly enable indirect queries on the server since we'll run the choosers locally on the X terminals.

So on the xterminal you again disable XDMCP. You will add a server type perhaps called Chooser as follows:

[server-Chooser]
name=Chooser server
command=/path/to/X
flexible=false
chooser=true
And again this definition should in fact be included in the standard configuration file. Notice that we made the chooser key true here. This will run the XDMCP chooser for this server, and when the user chooses a host GDM will run a query for that host. Then we will define our local servers as follows:
[servers]
0=Chooser

The XDMCP chooser on the X terminal will normally give a broadcast query to see which servers exist on the network. If the two servers are not reachable by a broadcast query, you must add them by hand to the configuration file. So in the [chooser] section you would have:

Hosts=appserverone,appservertwo
and any other servers you wish the users to be able to connect to.

Sometimes you may want to run the chooser on the server side however. Then what you want to do is to run a configuration similar to the previous section about the one server configuration with XDMCP indirect queries enabled on appserver and on the X terminals you'd have

[servers]
0=Terminal -indirect appserver
This way for example you only have to maintain one Hosts entry. However as a disadvantage then, the appserver must then always be available. So it's not good for situations where you want to have several servers and not all of them have to be on all the time. You could also have one of the X terminals handle indirect XDMCP queries and serve up the chooser to the other X terminals.

12.3. Defining Custom Commands

Suppose you want to add a custom command to the GDM menu that will give you the oportunity to boot into other operating system such as Windoze. Jsut add the following options into the [customcommand] section of the GDM configuration file.

          [customcommand]
          CustomCommand0=/sbin/rebootwindoze;/usr/local/sbin/rebootwindoze
          CustomCommandLabel0=_Windoze
          CustomCommandLRLabel0=Reboot into _Windoze
          CustomCommandText0=Are you sure you want to restart the computer into Windoze?
          CustomCommandTooltip0=Restarts the computer into Windoze
          CustomCommandIsPersistent0=true
        
CustomCommand0 specifies two commands separated by a semicolon: /sbin/rebootwindoze and /usr/local/sbin/rebootwindoze. GDM will use the first valid command in the list. This allows different commands for different operating systems to be included.

Note, that besides being able to customise this option to reboot into different operating systems you can also use it to define your own custom behaviours that you wish to run from the GDM menu. Suppose you want to give users the oportunity to run system update scripts from the login screen. Add the following options into the [customcommand] section of your GDM configuration file.

          [customcommand]
          CustomCommand0=/sbin/updatesystem;/usr/local/sbin/updatesystem
          CustomCommandLabel0=_Update Me
          CustomCommandLRLabel0=Update the system
          CustomCommandText0=Are you sure you want to update the system software?
          CustomCommandTooltip0=Updates the system
          CustomCommandNoRestart0=true
        

Both custom commands could be defined as follows.

          [customcommand]
          CustomCommand0=/sbin/rebootwindoze;/usr/local/sbin/rebootwindoze
          CustomCommandLabel0=_Windoze
          CustomCommandLRLabel0=Reboot into _Windoze
          CustomCommandText0=Are you sure you want to restart the computer into Windoze?
          CustomCommandTooltip0=Restarts the computer into Windoze
          CustomCommandIsPersistent0=true
          
          CustomCommand1=/sbin/updatesystem;/usr/local/sbin/updatesystem
          CustomCommandLabel1=_Update Me
          CustomCommandLRLabel1=Update the system
          CustomCommandText1=Are you sure you want to update the system software?
          CustomCommandTooltip1=Updates the system
          CustomCommandNoRestart1=true
        

There can be up to 10 custom commands numbered 0-9.

          [customcommand]
          CustomCommand0=/sbin/rebootwindoze;/usr/local/sbin/rebootwindoze
          CustomCommandLabel0=_Windoze
          CustomCommandLRLabel0=Reboot into _Windoze
          CustomCommandText0=Are you sure you want to restart the computer into Windoze?
          CustomCommandTooltip0=Restarts the computer into Windoze
          CustomCommandIsPersistent0=true
          
          CustomCommand1=/sbin/updatesystem;/usr/local/sbin/updatesystem
          CustomCommandLabel1=_Update Me
          CustomCommandLRLabel1=Update the system
          CustomCommandText1=Are you sure you want to update the system software?
          CustomCommandTooltip1=Updates the system
          CustomCommandNoRestart1=true
          
          CustomCommand3=/sbin/do_something
          .
          .
          .
          
          CustomCommand4=/sbin/do_something_else
          .
          .
          .