1SESSREG(1) General Commands Manual SESSREG(1)
2
3
4
6 sessreg - manage utmp (5)/wtmp (5) entries for non-init clients
7
9 sessreg [-w wtmp [4m(5)-file] [-u utmp [4m(5)-file] [-L lastlog-file] [-l
10 line-name] [-h host-name] [-s slot-number] [-x Xservers-file] [-t ttys-
11 file] [-V] [-a] [-d] user-name
12
14 Sessreg is a simple program for managing utmp (5)/wtmp (5) and lastlog
15 entries for xdm sessions.
16
17 System V has a better interface to utmp than BSD; it dynamically allo‐
18 cates entries in the file, instead of writing them at fixed positions
19 indexed by position in /etc/ttys.
20
21 To manage BSD-style utmp files, sessreg has two strategies. In con‐
22 junction with xdm, the -x option counts the number of lines in
23 /etc/ttys and then adds to that the number of the line in the Xservers
24 file which specifies the display. The display name must be specified
25 as the "line-name" using the -l option. This sum is used as the "slot-
26 number" in the utmp file that this entry will be written at. In the
27 more general case, the -s option specifies the slot-number directly.
28 If for some strange reason your system uses a file other than /etc/ttys
29 to manage init, the -t option can direct sessreg to look elsewhere for
30 a count of terminal sessions.
31
32 Conversely, System V managers will not ever need to use these options
33 (-x, -s and -t). To make the program easier to document and explain,
34 sessreg accepts the BSD-specific flags in the System V environment and
35 ignores them.
36
37 BSD and Linux also have a host-name field in the utmp file which
38 doesn't exist in System V. This option is also ignored by the System V
39 version of sessreg.
40
41 This version of sessreg is built using the modern POSIX pututxline(3c)
42 interfaces, which no longer require the slot-number, ttys-file, or
43 Xservers-file mappings. For compatibility with older versions and
44 other operating systems, the -s, -t, and -x flags are accepted, but
45 ignored.
46
48 In Xstartup, place a call like:
49
50 sessreg -a -l $DISPLAY -x /etc/X11/xdm/Xservers $USER
51
52 and in Xreset:
53
54 sessreg -d -l $DISPLAY -x /etc/X11/xdm/Xservers $USER
55
57 -w wtmp [4m(5)-file
58 This specifies an alternate wtmp (5) file, instead of
59 /var/log/wtmp. The special name "none" disables writing records
60 to the wtmp (5) file.
61
62 -u utmp [4m(5)-file
63 This specifies an alternate utmp (5) file, instead of
64 /var/run/utmp. The special name "none" disables writing records
65 to the utmp (5) file.
66
67 -L lastlog-file
68 This specifies an alternate lastlog file, instead of
69 /var/log/lastlog, if the platform supports lastlog files. The
70 special name "none" disables writing records to the lastlog
71 file.
72
73 -l line-name
74 This describes the "line" name of the entry. For terminal ses‐
75 sions, this is the final pathname segment of the terminal device
76 filename (e.g. ttyd0). For X sessions, it should probably be
77 the local display name given to the users session (e.g. :0). If
78 none is specified, the terminal name will be determined with
79 ttyname(3) and stripped of leading components.
80
81 -h host-name
82 This is set to indicate that the session was initiated from a
83 remote host. In typical xdm usage, this options is not used.
84
85 -s slot-number
86 Each potential session has a unique slot number in BSD systems,
87 most are identified by the position of the line-name in the
88 /etc/ttysfile. This option overrides the default position
89 determined with ttyslot(3). This option is inappropriate for
90 use with xdm, the -x option is more useful. This option is
91 accepted for compatibility, but does nothing in this version of
92 sessreg.
93
94 -x Xservers-file
95 As X sessions are one-per-display, and each display is entered
96 in this file, this options sets the slot-number to be the number
97 of lines in the ttys-file plus the index into this file that the
98 line-name is found. This option is accepted for compatibility,
99 but does nothing in this version of sessreg.
100
101 -t ttys-file
102 This specifies an alternate file which the -x option will use to
103 count the number of terminal sessions on a host. This option is
104 accepted for compatibility, but does nothing in this version of
105 sessreg.
106
107 -V This option causes the command to print its version and exit.
108
109 -a This session should be added to utmp/wtmp.
110
111 -d This session should be deleted from utmp/wtmp. One of -a/-d
112 must be specified.
113
115 xdm(1), utmp(5), wtmp(5)
116
118 Keith Packard, MIT X Consortium
119
120
121
122X Version 11 sessreg 1.1.0 SESSREG(1)