<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trinitydesktop.net/index.php?action=history&amp;feed=atom&amp;title=TDM</id>
	<title>TDM - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trinitydesktop.net/index.php?action=history&amp;feed=atom&amp;title=TDM"/>
	<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=TDM&amp;action=history"/>
	<updated>2026-05-25T00:38:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=TDM&amp;diff=3264&amp;oldid=prev</id>
		<title>Blu256: fix formatting</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=TDM&amp;diff=3264&amp;oldid=prev"/>
		<updated>2023-12-18T11:27:38Z</updated>

		<summary type="html">&lt;p&gt;fix formatting&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:27, 18 December 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-deletedline diff-side-deleted&quot;&gt;&lt;div&gt;&#039;&#039;TDM&#039;&#039; is the default graphical display manager of the Trinity Desktop Environment. It handles local and remote logins on a machine.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-addedline diff-side-added&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&#039;&lt;/ins&gt;&#039;&#039;TDM&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&#039;&lt;/ins&gt;&#039;&#039; is the default graphical display manager of the Trinity Desktop Environment. It handles local and remote logins on a machine.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-deleted&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-context diff-side-added&quot;&gt;&lt;div&gt;__TOC__&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mwdb:diff:wikidiff2:1.12:old-3263:rev-3264:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
	<entry>
		<id>https://wiki.trinitydesktop.net/index.php?title=TDM&amp;diff=3263&amp;oldid=prev</id>
		<title>Blu256: Add page about TDM (Remote login via XDMCP + some technical info from the README file)</title>
		<link rel="alternate" type="text/html" href="https://wiki.trinitydesktop.net/index.php?title=TDM&amp;diff=3263&amp;oldid=prev"/>
		<updated>2023-12-18T11:26:19Z</updated>

		<summary type="html">&lt;p&gt;Add page about TDM (Remote login via XDMCP + some technical info from the README file)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;TDM&amp;#039;&amp;#039; is the default graphical display manager of the Trinity Desktop Environment. It handles local and remote logins on a machine.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Remote login ==&lt;br /&gt;
Remote login can be performed via the XDMCP protocol. Due to security concerns, the XDMCP host component is disabled by default in TDM (but you can still connect to XDMCP hosts as a client).&lt;br /&gt;
&lt;br /&gt;
{{WarningBox|text=ArchWiki on the matter of [https://wiki.archlinux.org/title/XDMCP XDMCP]:&lt;br /&gt;
&amp;#039;&amp;#039;XDMCP is, similarly to telnet, doing unencrypted authentication. If snooping is possible, this leaves the system vulnerable to attack. It is disabled by default, using an ssh tunnel for X traffic is preferred.&amp;#039;&amp;#039;&lt;br /&gt;
As a matter of fact, you should only use it in a completely trusted and controlled environment.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To be able to login into a machine remotely you should edit the &amp;lt;tt&amp;gt;tdmrc&amp;lt;/tt&amp;gt; file. Find the section titled &amp;lt;tt&amp;gt;[Xdmcp]&amp;lt;/tt&amp;gt; and set the &amp;lt;tt&amp;gt;Enable&amp;lt;/tt&amp;gt; key to &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt;. Then, restart the tdm service.&lt;br /&gt;
&lt;br /&gt;
On the remote side select &amp;quot;Remote login&amp;quot; from the options menu of the TDM login screen. You should be presented with a dialog of the remote machines to which you can connect via XDMCP. If you don&amp;#039;t see the machine you want to connect to in the list, enter its IP address and press &amp;quot;Add&amp;quot;. It should appear in the list.&lt;br /&gt;
&lt;br /&gt;
By default a host might not allow remote connections despite being open for XDMCP requests. In XDMCP terminology, the host must be &amp;quot;Willing&amp;quot; to accept the remote connection. If you see &amp;quot;Display not authorized to connect&amp;quot; in the remote login dialog next to the address/hostname of the machine you want to connect to, you have to configure which hosts are allowed to connect to the machine. Follow the instructions in the &amp;lt;tt&amp;gt;Xaccess&amp;lt;/tt&amp;gt; file (it should be in the same directory as &amp;lt;tt&amp;gt;tdmrc&amp;lt;/tt&amp;gt;) to set up authorized hosts. After that, restart TDM and repeat the process.&lt;br /&gt;
&lt;br /&gt;
When you select the desired host in the remote login menu and press &amp;quot;Connect&amp;quot;, assuming the configuration is correct, you will be presented with the login screen of the host you are trying to connect to. If you see the local login screen again, then something has gone wrong. Ensure you have configured both instances of TDM according to the above instructions.&lt;br /&gt;
&lt;br /&gt;
== Technical details ==&lt;br /&gt;
&lt;br /&gt;
=== TDM&amp;#039;s file system layout ===&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span style=&amp;#039;color: darkorange&amp;#039;&amp;gt;&amp;lt;tt&amp;gt;${tde_confdir}&amp;lt;/tt&amp;gt; is usually &amp;lt;tt&amp;gt;${prefix}/share/config&amp;lt;/tt&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span style=&amp;#039;color: darkorange&amp;#039;&amp;gt;&amp;lt;tt&amp;gt;${tde_datadir}&amp;lt;/tt&amp;gt; is usually &amp;lt;tt&amp;gt;${prefix}/share/apps&amp;lt;/tt&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;${tde_confdir}/tdm/{tdmrc,Xservers,Xaccess,Xwilling,...}&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;${tde_datadir}/tdm/sessions/*.desktop&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;/etc/X11/sessions/,/usr/share/xsessions/&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;${tde_datadir}/tdm/pics/users/&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;${tde_datadir}/tdm/pics/&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;${tde_datadir}/tdm/faces/*.face{,.icon}&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;/usr/share/faces/&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;/var/run/xauth/A*&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;/var/run/xdmctl/xdmctl*&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;/var/run/tdm.pid&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;/var/lib/tdm/tdmsts&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;&amp;lt;site-specific&amp;gt;/*.dmrc&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;$HOME/.face{,.icon}&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;$HOME/.dmrc&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to setup TDM ===&lt;br /&gt;
&lt;br /&gt;
TDM&amp;#039;s config files are all located in &amp;lt;tt&amp;gt;${tde_confdir}/tdm&amp;lt;/tt&amp;gt;. &amp;quot;make install&amp;quot; will create a probably working configuration, either by deriving it from an already present TDM/XDM installation or by using defaults if no previous installation is found.&lt;br /&gt;
&lt;br /&gt;
You can change the configuration from the Trinity Control Center. You will find the &amp;quot;Login Manager&amp;quot; module in the &amp;quot;System Administration&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
Have a look at &amp;lt;tt&amp;gt;README.pam&amp;lt;/tt&amp;gt; in the &amp;lt;tt&amp;gt;tdebase&amp;lt;/tt&amp;gt; top level directory if your system uses PAM.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuring session types ===&lt;br /&gt;
Session types are represented by .desktop files in appropriate locations. The format of the .desktop files is (not yet) defined in the FreeDesktop.org desktop entry spec. Differences to &amp;quot;standard&amp;quot; .desktop files are:&lt;br /&gt;
* the &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt; is fixed to &amp;lt;tt&amp;gt;XSession&amp;lt;/tt&amp;gt; and can be omitted.&lt;br /&gt;
* the &amp;lt;code&amp;gt;Encoding&amp;lt;/code&amp;gt; is fixed to &amp;lt;tt&amp;gt;UTF-8&amp;lt;/tt&amp;gt; and can be omitted.&lt;br /&gt;
* the &amp;lt;code&amp;gt;Exec&amp;lt;/code&amp;gt; field will be passed to &amp;lt;tt&amp;gt;&amp;quot;eval exec&amp;quot;&amp;lt;/tt&amp;gt; in a bourne shell; no macro expansion is performed on it. &amp;quot;default&amp;quot;, &amp;quot;custom&amp;quot; and &amp;quot;failsafe&amp;quot; are magic constants that cause special actions.&lt;br /&gt;
* &amp;lt;code&amp;gt;Name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Comment&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TryExec&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Hidden&amp;lt;/code&amp;gt; are supported.&lt;br /&gt;
* the remaining keys have no meaning currently.&lt;br /&gt;
&lt;br /&gt;
Session types are internally identified by filename (without extension); that&amp;#039;s what will be saved to &amp;lt;tt&amp;gt;~/.dmrc&amp;lt;/tt&amp;gt; and what DESKTOP_SESSION will be set to. For every magic &amp;lt;code&amp;gt;Exec&amp;lt;/code&amp;gt; constant a session type of the same name exists.&lt;br /&gt;
&lt;br /&gt;
Unless your system is configured differently already, you should create a directory &amp;lt;tt&amp;gt;${tde_confdir}/tdm/sessions&amp;lt;/tt&amp;gt; and add this to &amp;lt;tt&amp;gt;tdmrc&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
[X-*-Core]&lt;br /&gt;
SessionsDirs=${tde_confdir}/tdm/sessions,${tde_datadir}/tdm/sessions&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{WarningBox|text=Always keep in mind the following:&lt;br /&gt;
* You must use actual paths instead of variables, see the section about TDM&amp;#039;s file system layout.&lt;br /&gt;
* Do any changes only in the config directory - any changes in the data directory will be lost after the next TDE update.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To override a session type, copy the .desktop file from the data directory to the config directory and edit it at will. Removing the shipped session types can be accomplished by &amp;quot;shadowing&amp;quot; them with .desktop files containing &amp;lt;code&amp;gt;Hidden=true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For the magic session types no .desktop files exist by default, but TDM pretends they would, so you can override them like any other type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The command sockets ===&lt;br /&gt;
This is a feature you can use to remote-control TDM. It&amp;#039;s mostly intended for use by ksmserver and kdesktop from a running session, but other applications are possible as well.&lt;br /&gt;
&lt;br /&gt;
The sockets are UNIX domain sockets which live in subdirectories of the directory specified by &amp;lt;code&amp;gt;FifoDir=&amp;lt;/code&amp;gt;. The subdir is the key to addressing and security; the sockets all have the file name &amp;quot;socket&amp;quot; and file permissions &amp;lt;tt&amp;gt;rw-rw-rw-&amp;lt;/tt&amp;gt; (0666). This is because some systems don&amp;#039;t care for the file permissions of the socket files.&lt;br /&gt;
&lt;br /&gt;
There are two types of sockets: the global one (&amp;lt;tt&amp;gt;dmctl&amp;lt;/tt&amp;gt;) and the per-display ones (&amp;lt;tt&amp;gt;dmctl-&amp;lt;display&amp;gt;&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The global one&amp;#039;s subdir is owned by root, the subdirs of the per-display ones&amp;#039; are owned by the user currently owning the session (root or the logged in user). Group ownership of the subdirs can be set via &amp;lt;code&amp;gt;FifoGroup=&amp;lt;/code&amp;gt;, otherwise it&amp;#039;s root. The file permissions of the subdirs are &amp;lt;tt&amp;gt;rwxr-x---&amp;lt;/tt&amp;gt; (0750).&lt;br /&gt;
&lt;br /&gt;
The fields of a command are separated by tabs (\t), the fields of a list are separated by spaces, literal spaces in list fields are denoted by &amp;quot;&amp;lt;tt&amp;gt;\s&amp;lt;/tt&amp;gt;&amp;quot;. The command is terminated by a newline (&amp;lt;tt&amp;gt;\n&amp;lt;/tt&amp;gt;). The same applies to replies. The reply on success is &amp;quot;&amp;lt;tt&amp;gt;ok&amp;lt;/tt&amp;gt;&amp;quot;, possibly followed by the requested information. The reply on error is an errno-style word (e.g., &amp;quot;&amp;lt;tt&amp;gt;perm&amp;lt;/tt&amp;gt;&amp;quot;, &amp;quot;&amp;lt;tt&amp;gt;noent&amp;lt;/tt&amp;gt;&amp;quot;, etc.) followed by a longer explanation.&lt;br /&gt;
&lt;br /&gt;
==== Global commands ====&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;login {display} (&amp;quot;now&amp;quot;|&amp;quot;schedule&amp;quot;) {user} {password} [session_arguments]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Login user at specified display. if &amp;quot;now&amp;quot; is specified, a possibly running session is killed, otherwise the login is done after the session exits.&lt;br /&gt;
&amp;lt;tt&amp;gt;session_arguments&amp;lt;/tt&amp;gt; are printf-like escaped contents for &amp;lt;tt&amp;gt;.dmrc&amp;lt;/tt&amp;gt;. Unlisted keys will default to previously saved values.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Per-display commands ====&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;lock&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| The display is marked as locked. If the X-Server crashes in this state, no auto-relogin will be performed even if the option is on.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;unlock&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Reverse the effect of &amp;quot;lock&amp;quot;: re-enable auto-relogin.&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;suicide&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| The currently running session is forcibly terminated. No auto-relogin is attempted, but a scheduled &amp;quot;login&amp;quot; command will be executed.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Commands for all sockets ====&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;caps&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Returns a list this socket&amp;#039;s capabilities:&lt;br /&gt;
 {|&lt;br /&gt;
|&amp;lt;code&amp;gt;tdm&amp;lt;/code&amp;gt;&lt;br /&gt;
| identifies tdm, in case some other DM implements this protocol, too&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;activate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lock&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;suicide&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;login&amp;lt;/code&amp;gt;&lt;br /&gt;
| whether the respective command is supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;bootoptions&amp;lt;/code&amp;gt;&lt;br /&gt;
| whether the &amp;lt;tt&amp;gt;listbootoptions&amp;lt;/tt&amp;gt; command and the &amp;quot;=&amp;quot; option to &amp;quot;&amp;lt;tt&amp;gt;shutdown&amp;lt;/tt&amp;gt;&amp;quot; are supported&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;shutdown {list}&amp;lt;/code&amp;gt;&lt;br /&gt;
| whether &amp;quot;shutdown&amp;quot; is supported and allowed to the listed users (comma-separated), &amp;quot;*&amp;quot; means all authenticated users&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;shutdown&amp;lt;/code&amp;gt;&lt;br /&gt;
| whether &amp;quot;shutdown&amp;quot; is supported and allowed to everybody&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nuke {list}&amp;lt;/code&amp;gt;&lt;br /&gt;
| whether forced shutdown is allowed to the listed users&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;nuke&amp;lt;/code&amp;gt;&lt;br /&gt;
| whether forced shutdown is allowed to everybody&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;reserve {number}&amp;lt;/code&amp;gt;&lt;br /&gt;
| whether reserve displays are configured and &amp;lt;number&amp;gt; are available at this time&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;list [all|alllocal]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Return a list of running sessions. By default all active sessions are listed.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;&amp;lt;tt&amp;gt;all&amp;lt;/tt&amp;gt;&amp;quot; is specified, passive sessions are listed as well.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;&amp;lt;tt&amp;gt;alllocal&amp;lt;/tt&amp;gt;&amp;quot; is specified, passive sessions are listed as well, but all incoming remote sessions are skipped.&lt;br /&gt;
&lt;br /&gt;
Each session entry is a comma-separated tuple of:&lt;br /&gt;
* Display or TTY name&lt;br /&gt;
* VT name for local sessions&lt;br /&gt;
* Logged in user&amp;#039;s name, empty for passive sessions and outgoing remote sessions (local chooser mode)&lt;br /&gt;
* Session type or remote host for outgoing remote sessions, empty for passive sessions&lt;br /&gt;
* A flag field:&lt;br /&gt;
** &amp;quot;t&amp;quot; for tty sessions&lt;br /&gt;
** &amp;quot;*&amp;quot; for the display belonging to the requesting socket&lt;br /&gt;
** &amp;quot;!&amp;quot; for sessions that cannot be killed by the requesting socket&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;reserve [timeout in seconds]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Start a reserve login screen. If nobody logs in within the specified amount of time (one minute by default), the display is removed again. When the session on the display exits, the display is removed, too.&lt;br /&gt;
Permitted only on sockets of local displays and the global socket.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;activate (vt|display)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Switch to a particular VT (virtual terminal). The VT may be specified either directly (e.g., vt3) or by a display using it (e.g., :2).&lt;br /&gt;
Permitted only on sockets of local displays and the global socket.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;listbootoptions&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| List available boot options.&lt;br /&gt;
 =&amp;gt; &amp;quot;ok&amp;quot; list default current&lt;br /&gt;
*default and current are indices into the list and are -1 if unset or undeterminable.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;shutdown (reboot|halt)[={bootchoice}] (ask|trynow|forcenow|schedule|start (-1|end (force|forcemy|cancel)))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Request a system shutdown, either a reboot or a halt/poweroff.&lt;br /&gt;
An OS choice for the next boot may be specified from the list returned by &amp;quot;listbootoptions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Shutdowns requested from per-display sockets are executed when the current session on that display exits. Such a request may pop up a dialog asking for confirmation and/or authentication.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;start&amp;lt;/tt&amp;gt; is the time for which the shutdown is scheduled. If it starts with a plus-sign, the current time is added. Zero means immediately.&lt;br /&gt;
* &amp;lt;tt&amp;gt;end&amp;lt;/tt&amp;gt; is the latest time at which the shutdown should be performed if active sessions are still running. If it starts with a plus-sign, the start time is added. Minus one means wait infinitely. If end is through and active sessions are still running, TDM can do one of the following:&lt;br /&gt;
** &amp;lt;tt&amp;gt;cancel&amp;lt;/tt&amp;gt; - give up the shutdown.&lt;br /&gt;
** &amp;lt;tt&amp;gt;force&amp;lt;/tt&amp;gt; - shut down nonetheless.&lt;br /&gt;
** &amp;lt;tt&amp;gt;forcemy&amp;lt;/tt&amp;gt; - shut down nonetheless if all active sessions belong to the requesting user. Only for per-display sockets.&lt;br /&gt;
* &amp;lt;tt&amp;gt;trynow&amp;lt;/tt&amp;gt; is a synonym for &amp;quot;0 0 cancel&amp;quot;, &amp;lt;tt&amp;gt;forcenow&amp;lt;/tt&amp;gt; for &amp;quot;0 0 force&amp;quot; and &amp;lt;tt&amp;gt;schedule&amp;lt;/tt&amp;gt; for &amp;quot;0 -1&amp;quot;.&lt;br /&gt;
* &amp;lt;tt&amp;gt;ask&amp;lt;/tt&amp;gt; attempts an immediate shutdown and interacts with the user if active sessions are still running. Only for per-display sockets.&lt;br /&gt;
* &amp;lt;tt&amp;gt;start&amp;lt;/tt&amp;gt; and end are specified in seconds since the UNIX epoch.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;shutdown cancel [local|global]&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Cancel a scheduled shutdown. The global socket always cancels the currently pending shutdown, while per-display sockets default to cancelling their queued request.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;shutdown status&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Return a list with information about shutdowns.&lt;br /&gt;
The entries are comma-separated tuples of:&lt;br /&gt;
* (&amp;quot;global&amp;quot;|&amp;quot;local&amp;quot;) - pending vs. queued shutdown. A local entry can be returned only by a per-display socket.&lt;br /&gt;
* (&amp;quot;halt&amp;quot;|&amp;quot;reboot&amp;quot;)&lt;br /&gt;
* start&lt;br /&gt;
* end&lt;br /&gt;
* (&amp;quot;ask&amp;quot;|&amp;quot;force&amp;quot;|&amp;quot;forcemy&amp;quot;|&amp;quot;cancel&amp;quot;)&lt;br /&gt;
* Numeric user ID of the requesting user, -1 for the global socket.&lt;br /&gt;
* The next boot OS choice or &amp;quot;-&amp;quot; for none.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There are two ways of using the sockets:&lt;br /&gt;
* Connecting them directly. FifoDir is exported as $DM_CONTROL; the name of per-display sockets can be derived from $DISPLAY.&lt;br /&gt;
* By using the &amp;lt;tt&amp;gt;tdmctl&amp;lt;/tt&amp;gt; command (e.g., from within a shell script). Try &amp;quot;&amp;lt;tt&amp;gt;tdmctl -h&amp;lt;/tt&amp;gt;&amp;quot; to find out more.&lt;br /&gt;
&lt;br /&gt;
Here is an example bash script &amp;quot;reboot into FreeBSD&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
if tdmctl | grep -q shutdown; then&lt;br /&gt;
  IFS=$&amp;#039;\t&amp;#039;&lt;br /&gt;
  set -- `tdmctl listbootoptions`&lt;br /&gt;
  if [ &amp;quot;$1&amp;quot; = ok ]; then&lt;br /&gt;
    fbsd=$(echo &amp;quot;$2&amp;quot; | tr &amp;#039; &amp;#039; &amp;#039;\n&amp;#039; | sed -ne &amp;#039;s,\\s, ,g;/freebsd/I{p;q}&amp;#039;)&lt;br /&gt;
    if [ -n &amp;quot;$fbsd&amp;quot; ]; then&lt;br /&gt;
      tdmctl shutdown reboot &amp;quot;=$fbsd&amp;quot; ask &amp;gt; /dev/null&lt;br /&gt;
    else&lt;br /&gt;
      echo &amp;quot;FreeBSD boot unavailable.&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;Boot options unavailable.&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;Cannot reboot system.&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
TDM accepts two command line options related to logging:&lt;br /&gt;
&lt;br /&gt;
  -debug &amp;lt;n&amp;gt;&lt;br /&gt;
    &amp;lt;n&amp;gt; is a decimal or hexadecimal (prefix 0x) number.&lt;br /&gt;
    The number is a bitfield, i.e., it is formed by summing up the&lt;br /&gt;
    required values from this table:&lt;br /&gt;
    1 (0x1) - core debugging. Probably the most useful one.&lt;br /&gt;
    2 (0x2) - config reader debugging.&lt;br /&gt;
    4 (0x4) - greeter debugging.&lt;br /&gt;
    8 (0x8) - IPC debugging. This logs _all_ communication between the&lt;br /&gt;
	      core, the config reader and the greeter - including the&lt;br /&gt;
	      passwords you type, so edit the log before showing it to&lt;br /&gt;
	      somebody.&lt;br /&gt;
	      This attempts to synchronize the processes to interleave the&lt;br /&gt;
	      log messages optimally, but will probably fail unless you use&lt;br /&gt;
	      -debug 0x80 as well.&lt;br /&gt;
    16 (0x10) - wait after forking session sub-daemon.&lt;br /&gt;
    32 (0x20) - wait after starting config reader.&lt;br /&gt;
    64 (0x40) - wait after starting greeter.&lt;br /&gt;
	The wait options are only useful if you need to attach a debugger&lt;br /&gt;
	to a process, but it crashes before you are able to do so without&lt;br /&gt;
	the delay. See below.&lt;br /&gt;
    128 (0x80) - don&amp;#039;t use syslog for internally generated messages.&lt;br /&gt;
    256 (0x100) - core Xauth debugging.&lt;br /&gt;
    1024 (0x400) - run config reader and greeter through valgrind.&lt;br /&gt;
    2048 (0x800) - run config reader and greeter through strace.&lt;br /&gt;
&lt;br /&gt;
Logs from &amp;quot;-debug 7&amp;quot; are usually a good start.&lt;br /&gt;
&lt;br /&gt;
  -error &amp;lt;file&amp;gt;, -logfile &amp;lt;file&amp;gt;&lt;br /&gt;
    &amp;lt;file&amp;gt; is the file to log various messages to. The default log file is&lt;br /&gt;
    /var/log/tdm.log. For internal reasons there is no option in tdmrc to&lt;br /&gt;
    permanently specify the log file location. If you redirect TDM&amp;#039;s&lt;br /&gt;
    standard error output to a file, TDM will log there.&lt;br /&gt;
    If TDM is configured to use syslog (and it _very_ probably is on any&lt;br /&gt;
    modern system), all internally generated messages are logged to the&lt;br /&gt;
    &amp;quot;daemon&amp;quot; facility. The log usually can be found in /var/log/debug.log&lt;br /&gt;
    and /var/log/daemon.log; make sure that daemon.* is logged (look at&lt;br /&gt;
    /etc/syslog.conf).&lt;br /&gt;
    If you have problems logging in and your system uses PAM (also quite&lt;br /&gt;
    probable on modern systems), the &amp;quot;auth&amp;quot; and &amp;quot;authpriv&amp;quot; syslog facilities&lt;br /&gt;
    are interesting, too.&lt;br /&gt;
&lt;br /&gt;
When reporting bugs, send all the logs together with a detailed description of what you did and what happened. If your problem is related to a specific configuration, you should also attach a tar.gz archive of your TDM config directory.&lt;br /&gt;
&lt;br /&gt;
=== Producing a backtrace ===&lt;br /&gt;
If a backtrace is requested from you and TDM didn&amp;#039;t create one yet via the usual drkonqi procedure, you&amp;#039;ll have to do that yourself. The keyphrase is &amp;quot;attaching gdb&amp;quot;. How exactly this is done depends on the part that crashes:&lt;br /&gt;
&lt;br /&gt;
==== Attaching gdb to the process ====&lt;br /&gt;
===== Master daemon =====&lt;br /&gt;
Actually you should never need to attach to it, as you can start it within the debugger already:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# gdb --args tdm -nodaemon -debug 7&lt;br /&gt;
(gdb) run&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Display subdaemon =====&lt;br /&gt;
Find (using ps) the process with a name like &amp;quot;-:0&amp;quot; (where :0 is actually the display this process is for). This process&amp;#039; PPID is the master daemon. Attach to it this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# gdb tdm &amp;lt;the PID you found&amp;gt;&lt;br /&gt;
(gdb) cont&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the subdaemon crashes before you can attach, add 16 to the debug flags when you start TDM.&lt;br /&gt;
&lt;br /&gt;
===== Config reader =====&lt;br /&gt;
You will have to add 32 to the debug flags almost certainly. The PPID will be the master daemon as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# gdb tdm_config $(pidof tdm_config)&lt;br /&gt;
(gdb) cont&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Greeter =====&lt;br /&gt;
If it&amp;#039;s too fast, add 64 to -debug. The PPID will be the subdaemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# gdb tdm_greet $(pidof tdm_greet)&lt;br /&gt;
(gdb) cont&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simplification with &amp;quot;pidof&amp;quot; works only if you have only one display, otherwise you have to find the PID manually (by using ps -fx).&lt;br /&gt;
&lt;br /&gt;
==== Reproduce crash and create backtrace ====&lt;br /&gt;
Once you got gdb attached to the offending process, do whatever is needed to make it crash (probably nothing, if you had to use a delay parameter).&lt;br /&gt;
&lt;br /&gt;
Once it crashed, gdb will tell you a signal name, like SIGSEGV - that&amp;#039;s the first interesting part. Then you have to create the actual backtrace:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
(gdb) bt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of this command is interesting for the developer, so a backtrace might be useful even if nothing crashes, but instead hangs. In this case don&amp;#039;t use &amp;quot;cont&amp;quot; after attaching, but use &amp;quot;bt&amp;quot; right away. If the process is already running, interrupt it with ctrl-c.&lt;br /&gt;
&lt;br /&gt;
For obvious reasons you have to run gdb on a different virtual terminal than the X server. To get there, press alt-ctrl-f1 and log in as root. To switch to the X server&amp;#039;s vt, press alt-ctrl-f7 (the exact function key may be different on your system). You may also use a remote login from a second machine. In any case it is advantageous to have mouse support on the debugging console for copying the backtrace.&lt;br /&gt;
&lt;br /&gt;
Note that a backtrace is usually much more useful if the binary contains debugging info.&lt;/div&gt;</summary>
		<author><name>Blu256</name></author>
	</entry>
</feed>