blob: 5cc4800ea9dc1501a47aa83b1a2b23c7b8d52a5f [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001NAME
Zesstra7ea4a032019-11-26 20:11:40 +01002 driver/invocation
MG Mud User88f12472016-06-24 23:31:02 +02003
4PURPOSE
Zesstra7ea4a032019-11-26 20:11:40 +01005 Description of the invocation of the gamedriver, especially of the
6 command arguments. This document describes the commandline version of
7 the driver only; non-commandline versions are platform specific and
8 described in the related documentation.
MG Mud User88f12472016-06-24 23:31:02 +02009
10DESCRIPTION
Zesstra7ea4a032019-11-26 20:11:40 +010011 The driver is invoked from the commandline as other normal programs.
12 Neither the current directory nor the directory the executable is in
13 need to be in any special relation the directory of the mudlib. Once
14 the driver is running, it emits two streams of outputs:
MG Mud User88f12472016-06-24 23:31:02 +020015
Zesstra7ea4a032019-11-26 20:11:40 +010016 - driver-related messages on stderr; this unfortunately includes
17 LPC compiler diagnostics
18 - LPC runtime-related messages in the logfile
19 <mudlib>/<host>.parse.log (the name can be changed).
MG Mud User88f12472016-06-24 23:31:02 +020020
Zesstra7ea4a032019-11-26 20:11:40 +010021 It is possible to start the driver without any commandline arguments as
22 suitable defaults are specified at compile time. The invocation syntax
23 is:
MG Mud User88f12472016-06-24 23:31:02 +020024
Zesstra7ea4a032019-11-26 20:11:40 +010025 driver [options] [<portnumber>]...
MG Mud User88f12472016-06-24 23:31:02 +020026
Zesstra7ea4a032019-11-26 20:11:40 +010027 <portnumber> the number of the port the driver shall use to accept
28 connections. The maximum number of ports is determined by MAXNUMPORTS
29 in the source file config.h.
MG Mud User88f12472016-06-24 23:31:02 +020030
Zesstra7ea4a032019-11-26 20:11:40 +010031 The options modify the behaviour of the gamedriver. Some of them are
32 only available if a certain compile-time option was enabled (typically
33 in the source file config.h). The following options are recognized:
MG Mud User88f12472016-06-24 23:31:02 +020034
Zesstra7ea4a032019-11-26 20:11:40 +010035 -P|--inherit <fd-number>
36 Inherit filedescriptor <fd-number> from the parent process
37 as socket to listen for connections.
38 Only available if compiled with MAXNUMPORTS.
MG Mud User88f12472016-06-24 23:31:02 +020039
Zesstra7ea4a032019-11-26 20:11:40 +010040 -u|--udp <portnumber>
41 Specify the <portnumber> for the UDP port, overriding the
42 compiled-in default.
43 Only available if compiled with CATCH_UDP_PORT.
MG Mud User88f12472016-06-24 23:31:02 +020044
Zesstra7ea4a032019-11-26 20:11:40 +010045 -D|--define <macro>[=<text>]
46 Add <macro> (optionally to be expanded to <text>) to the list of
47 predefined macros known by the LPC compiler.
MG Mud User88f12472016-06-24 23:31:02 +020048
Zesstra7ea4a032019-11-26 20:11:40 +010049 -E|--eval-cost <ticks>
50 Set the number of <ticks> available for one evaluation thread.
51 If 0, execution is unlimited.
MG Mud User88f12472016-06-24 23:31:02 +020052
Zesstra7ea4a032019-11-26 20:11:40 +010053 -M|--master <filename>
54 Use <filename> for the master object.
MG Mud User88f12472016-06-24 23:31:02 +020055
Zesstra7ea4a032019-11-26 20:11:40 +010056 -m|--mudlib <pathname>
57 Use <pathname> as the top directory of the mudlib.
MG Mud User88f12472016-06-24 23:31:02 +020058
Zesstra7ea4a032019-11-26 20:11:40 +010059 --debug-file <filename>
60 Log all debug output in <filename> instead of
61 <mudlib>/<host>.debug.log .
MG Mud User88f12472016-06-24 23:31:02 +020062
Zesstra7ea4a032019-11-26 20:11:40 +010063 --hostname <name>
64 Use <name> as hostname instead of what the system says.
MG Mud User88f12472016-06-24 23:31:02 +020065
Zesstra7ea4a032019-11-26 20:11:40 +010066 --hostaddr <addr>
67 Use <addr> as address of this machine, instead of what the
68 system says. In particular this address will be used to open
69 the driver ports.
MG Mud User88f12472016-06-24 23:31:02 +020070
Zesstra7ea4a032019-11-26 20:11:40 +010071 --no-compat
72 --compat
73 Select the mode (plain or compat) of the driver.
74 This choice does not affect the default name of the master object.
MG Mud User88f12472016-06-24 23:31:02 +020075
Zesstra7ea4a032019-11-26 20:11:40 +010076 -d|--debug
77 Generate debug output; repeat the argument for even more output:
78 >= 1: log resets, clean ups, swaps, reception of urgend data,
79 telnet negotiation states.
80 check_a_lot_of_refcounts() on startup when swapping of
81 variables is disabled.
82 >= 2: log all add_message()s, name lookup failures, new players.
83 >= 3: progress of garbage collection
84 >= 4: even more junk from garbage collection
MG Mud User88f12472016-06-24 23:31:02 +020085
Zesstra7ea4a032019-11-26 20:11:40 +010086 -c|--list-compiles
87 List the name of every compiled file on stderr.
MG Mud User88f12472016-06-24 23:31:02 +020088
Zesstra7ea4a032019-11-26 20:11:40 +010089 -e|--no-preload
90 Pass a non-zero argument (the number of occurrences of this option)
91 to master->preload(), which usually inhibits all preloads of
92 castles and other objects.
MG Mud User88f12472016-06-24 23:31:02 +020093
Zesstra7ea4a032019-11-26 20:11:40 +010094 --erq <filename>
95 --erq "<filename> <erq args>"
96 Use <filename> instead of 'erq' as the basename of the ERQ
97 executable. If the name starts with a '/', it is take to be an
98 absolute pathname, otherwise it is interpreted relative to
99 <bindir>. If not specified, 'erq' is used as the executable name.
MG Mud User88f12472016-06-24 23:31:02 +0200100
Zesstra7ea4a032019-11-26 20:11:40 +0100101 By enclosing the argument value in quotes, it is possible to pass
102 arguments (e.g. --execdir) to the erq. These arguments however must
103 not contain embedded spaces.
MG Mud User88f12472016-06-24 23:31:02 +0200104
Zesstra7ea4a032019-11-26 20:11:40 +0100105 -N|--no-erq
106 Don't start the erq demon (if it would be started at all).
MG Mud User88f12472016-06-24 23:31:02 +0200107
Zesstra7ea4a032019-11-26 20:11:40 +0100108 --alarm-time <seconds>
109 Set the granularity of call_out() and heartbeat timing. Minimum
110 value is 1.
MG Mud User88f12472016-06-24 23:31:02 +0200111
Zesstra7ea4a032019-11-26 20:11:40 +0100112 --heart-interval <seconds>
113 Set the interval between two heartbeats. Minimum value is 1.
MG Mud User88f12472016-06-24 23:31:02 +0200114
Zesstra7ea4a032019-11-26 20:11:40 +0100115 --sync-heart
116 All heartbeats occur at the same time (modulo granularity).
MG Mud User88f12472016-06-24 23:31:02 +0200117
Zesstra7ea4a032019-11-26 20:11:40 +0100118 --async-heart
119 Heartbeats occur when they are due (modulo granularity).
MG Mud User88f12472016-06-24 23:31:02 +0200120
Zesstra7ea4a032019-11-26 20:11:40 +0100121 -t|--no-heart
122 Disable heartbeats and call_outs.
MG Mud User88f12472016-06-24 23:31:02 +0200123
Zesstra7ea4a032019-11-26 20:11:40 +0100124 -f|--funcall <word>
125 The lfun master->flag() is called with <word> as argument before
126 the gamedriver accepts netword connections.
MG Mud User88f12472016-06-24 23:31:02 +0200127
Zesstra7ea4a032019-11-26 20:11:40 +0100128 --regexp pcre | traditional
129 Select the default regexp package.
MG Mud User88f12472016-06-24 23:31:02 +0200130
Zesstra7ea4a032019-11-26 20:11:40 +0100131 --max-array <size>
132 The maximum number of elements an array can hold.
133 Set to 0, arrays of any size are allowed.
MG Mud User88f12472016-06-24 23:31:02 +0200134
Zesstra7ea4a032019-11-26 20:11:40 +0100135 --max-mapping <size>
136 The maximum number of elements a mapping can hold.
137 Set to 0, mappings of any size are allowed.
MG Mud User88f12472016-06-24 23:31:02 +0200138
Zesstra7ea4a032019-11-26 20:11:40 +0100139 --max-mapping-keys <size>
140 The maximum number of entries a mapping can hold.
141 Set to 0, mappings of any size are allowed.
MG Mud User88f12472016-06-24 23:31:02 +0200142
Zesstra7ea4a032019-11-26 20:11:40 +0100143 --max-callouts <size>
144 The maximum number of callouts at one time.
145 Set to 0, any number is allowed.
MG Mud User88f12472016-06-24 23:31:02 +0200146
Zesstra7ea4a032019-11-26 20:11:40 +0100147 --max-bytes <size>
148 The maximum number of bytes one read_bytes()/write_bytes() call
149 can handle.
150 Set to 0, reads and writes of any size are allowed.
MG Mud User88f12472016-06-24 23:31:02 +0200151
Zesstra7ea4a032019-11-26 20:11:40 +0100152 --max-file <size>
153 The maximum number of bytes one read_file()/write_file() call
154 can handle.
155 Set to 0, reads and writes of any size are allowed.
MG Mud User88f12472016-06-24 23:31:02 +0200156
Zesstra7ea4a032019-11-26 20:11:40 +0100157 --max-thread-pending <size>\n"
158 The maximum number of bytes to be kept pending by the socket write
159 thread.
160 Set to 0, an unlimited amount of data can be kept pending.
MG Mud User88f12472016-06-24 23:31:02 +0200161
Zesstra7ea4a032019-11-26 20:11:40 +0100162 This option is ignored if pthreads are not used.
163
164 --cleanup-time <time>
165 The idle time in seconds for an object before the driver tries to
166 clean it up. It should be substantially longer than the reset time.
167 A time <= 0 disables the cleanup mechanism.
168
169 --reset-time <time>
170 The time in seconds before an object is reset. A time <= 0 disables
171 the reset mechanism.
172
173 -s <time> | --swap-time <time>
174 -s v<time> | --swap-variables <time>
175 Time in seconds before an object (or its variables) are swapped
176 out. A time less or equal 0 disables swapping.
177
178 -s f<name> | --swap-file <name>
179 Swap into file '<name>' instead of '<mudlib>/LP_SWAP.<host>'.
180
181 -s c | --swap-compact
182 Reuse free space in the swap file immediately.
183 Giving this option results in smaller, but also more fragmented
184 swapfiles, and the swap performance may degrade.
MG Mud User88f12472016-06-24 23:31:02 +0200185
Zesstra7ea4a032019-11-26 20:11:40 +0100186 --hard-malloc-limit <size>
187 Restrict total memory allocation to <size> bytes.
188 A <size> of 0 or 'unlimited' removes any restriction.
MG Mud User88f12472016-06-24 23:31:02 +0200189
Zesstra7ea4a032019-11-26 20:11:40 +0100190 --soft-malloc-limit <size>
191 This value gives a soft limit of the allocated memory (kind of low
192 watermark). If this value is exceeded, the driver will call
193 low_memory() in the master to inform the mudlib about the
194 (potentially) developing low memory situation.
195 A <size> of 0 or 'unlimited' removes this threshold.
MG Mud User88f12472016-06-24 23:31:02 +0200196
Zesstra7ea4a032019-11-26 20:11:40 +0100197 --min-malloc <size>
198 --min-small-malloc <size>
199 Determine the sizes for the explicit initial large resp. small
200 chunk allocation. A size of 0 disables the explicit initial
201 allocations.
MG Mud User88f12472016-06-24 23:31:02 +0200202
Zesstra7ea4a032019-11-26 20:11:40 +0100203 -r u<size> | --reserve-user <size>
204 -r m<size> | --reserve-master <size>
205 -r s<size> | --reserve-system <size>
206 Reserve <size> amount of memory for user/master/system allocations
207 to be held until main memory runs out.
MG Mud User88f12472016-06-24 23:31:02 +0200208
Zesstra7ea4a032019-11-26 20:11:40 +0100209 --filename-spaces
210 --no-filename-spaces
211 Allow/disallow the use of spaces in filenames.
MG Mud User88f12472016-06-24 23:31:02 +0200212
Zesstra7ea4a032019-11-26 20:11:40 +0100213 --strict-euids
214 --no-strict-euids
215 Enable/disable the enforced use of euids.
MG Mud User88f12472016-06-24 23:31:02 +0200216
Zesstra7ea4a032019-11-26 20:11:40 +0100217 --share-variables
218 --init-variables
219 Select how clones initialize their variables:
220 - by sharing the current values of their blueprint
221 - by initializing them afresh (using __INIT()).
MG Mud User88f12472016-06-24 23:31:02 +0200222
Zesstra7ea4a032019-11-26 20:11:40 +0100223 --pidfile <filename>\n"
224 Write the pid of the driver process into <filename>.\n"
MG Mud User88f12472016-06-24 23:31:02 +0200225
Zesstra7ea4a032019-11-26 20:11:40 +0100226 --tls-key <pathname>
227 Use <pathname> as the x509 keyfile, default is 'key.pem'.
228 If relative, <pathname> is interpreted relative to <mudlib>.
MG Mud User88f12472016-06-24 23:31:02 +0200229
Zesstra7ea4a032019-11-26 20:11:40 +0100230 --tls-cert <pathname>
231 Use <pathname> as the x509 certfile, default is 'cert.pem'.
232 If relative, <pathname> is interpreted relative to <mudlib>.
MG Mud User88f12472016-06-24 23:31:02 +0200233
Zesstra7ea4a032019-11-26 20:11:40 +0100234 --tls-crlfile <pathname>
235 Use <pathname> as the filename holding your certificate revocation
236 lists. If relative, <pathname> is interpreted relative to <mudlib>.
MG Mud User88f12472016-06-24 23:31:02 +0200237
Zesstra7ea4a032019-11-26 20:11:40 +0100238 --tls-crldirectory <pathname>
239 Use <pathname> as the directory where your certificate revocation
240 lists reside. If relative, <pathname> is interpreted relative to
241 <mudlib>.
MG Mud User88f12472016-06-24 23:31:02 +0200242
Zesstra7ea4a032019-11-26 20:11:40 +0100243 --tls-trustfile <pathname>
244 Use <pathname> as the filename holding your trusted PEM
245 certificates. If relative, <pathname> is interpreted relative to
246 <mudlib>.
MG Mud User88f12472016-06-24 23:31:02 +0200247
Zesstra7ea4a032019-11-26 20:11:40 +0100248 --tls-trustdirectory <pathname>
249 Use <pathname> as the directory where your trusted
250 PEM certificates reside, default is '/etc/ssl/certs'.
251 If relative, <pathname> is interpreted relative to <mudlib>.
MG Mud User88f12472016-06-24 23:31:02 +0200252
Zesstra7ea4a032019-11-26 20:11:40 +0100253 --wizlist-file <filename>
254 --no-wizlist-file
255 Read and save the wizlist in the named file (always interpreted
256 relative the mudlib); resp. don't read or save the wizlist.
MG Mud User88f12472016-06-24 23:31:02 +0200257
Zesstra7ea4a032019-11-26 20:11:40 +0100258 --gcollect-outfd <filename>|<num>
259 Garbage collector output (like a log of all reclaimed memory
260 blocks) is sent to <filename> (or inherited fd <num>) instead of
261 stderr. Only available if compiled with MALLOC_smalloc.
MG Mud User88f12472016-06-24 23:31:02 +0200262
Zesstra7ea4a032019-11-26 20:11:40 +0100263 --y|--yydebug
264 Enable debugging of the LPC compiler.
265 Only available if compiled with YYDEBUG.
MG Mud User88f12472016-06-24 23:31:02 +0200266
Zesstra7ea4a032019-11-26 20:11:40 +0100267 --randomdevice <filename>
268 Chooses the source of the seed for the random number generator.
269 Default is /dev/urandom, Fall-back if <filename> is not readable
270 is the system clock. If you want to seed the PRNG with a specific
271 seed, you can use a filename with the seed and give it here instead
272 of using --random-seed. (Note: the last one of --randominit and
273 --random-seed wins!)
MG Mud User88f12472016-06-24 23:31:02 +0200274
Zesstra7ea4a032019-11-26 20:11:40 +0100275 --random-seed <num>
276 Seed value for the random number generator. If not given, the
277 driver chooses a seed value on its own.
278 This option is for debugging.
MG Mud User88f12472016-06-24 23:31:02 +0200279
Zesstra7ea4a032019-11-26 20:11:40 +0100280 --check-state <lvl>
281 Perform a regular simplistic check of the virtual machine according
282 to <lvl>:
283 = 0: no check
284 = 1: once per backend loop
285 = 2: at various points in the backend loop
286 Only available if compiled with DEBUG.
MG Mud User88f12472016-06-24 23:31:02 +0200287
Zesstra7ea4a032019-11-26 20:11:40 +0100288 --check-refcounts
289 Every backend cycle, all refcounts in the system are checked.
290 SLOW! Only available if compiled with DEBUG.
MG Mud User88f12472016-06-24 23:31:02 +0200291
Zesstra7ea4a032019-11-26 20:11:40 +0100292 --gobble-descriptors <num>
293 <num> (more) filedescriptors are used up. You'll know when you need
294 it. Only available if compiled with DEBUG.
MG Mud User88f12472016-06-24 23:31:02 +0200295
Zesstra7ea4a032019-11-26 20:11:40 +0100296 --check-strings
297 Every backend cycle, all shared strings in the system are checked.
298 SLOW! Only available if compiled with DEBUG and CHECK_STRINGS.
MG Mud User88f12472016-06-24 23:31:02 +0200299
Zesstra7ea4a032019-11-26 20:11:40 +0100300 -V|--version
301 Print the version of the driver and exit.
MG Mud User88f12472016-06-24 23:31:02 +0200302
Zesstra7ea4a032019-11-26 20:11:40 +0100303 --options
304 Print the version and compilation options of the driver and exit.
MG Mud User88f12472016-06-24 23:31:02 +0200305
Zesstra7ea4a032019-11-26 20:11:40 +0100306 -h|-?|--help
307 Display a command help and exit.
MG Mud User88f12472016-06-24 23:31:02 +0200308
Zesstra7ea4a032019-11-26 20:11:40 +0100309 --longhelp
310 Display a long command help and exit.
MG Mud User88f12472016-06-24 23:31:02 +0200311
Zesstra7ea4a032019-11-26 20:11:40 +0100312 --args <filename>
313 The driver reads and parses the given file and treats its contents
314 as if given on the commandline right where the --args option
315 occurred. The file itself can again contain --args options.
MG Mud User88f12472016-06-24 23:31:02 +0200316
317
Zesstra7ea4a032019-11-26 20:11:40 +0100318DESCRIPTION
319 -- Argument Parser
320 The parser analyses the commandline arguments given with the driver
321 invocation and distinguishes 'options', which start with a '-', from
322 proper arguments. Options are further distinguished by their name and
323 may take an additional value. In general, options and arguments can be
324 given in any order.
MG Mud User88f12472016-06-24 23:31:02 +0200325
Zesstra7ea4a032019-11-26 20:11:40 +0100326 Options are recognized in two forms. In the short form the option must
327 be given as a single '-' followed by a single letter. In the long
328 form, options start with '--' followed by a string of arbitrary length.
329 The short options are case sensitive, the long options aren't. Most
330 options can be specified in both the short and long form, but that is
331 not mandatory. Examples: '-r' and '--recursive'.
MG Mud User88f12472016-06-24 23:31:02 +0200332
Zesstra7ea4a032019-11-26 20:11:40 +0100333 If an option takes a value, it must follow the option immediately after
334 a separating space or '='. Additionally, the value for a short option
335 may follow the option without separator. Examples are: '-fMakefile',
336 '-f Makefile', '--file=Makefile' and '--file Makefile'.
MG Mud User88f12472016-06-24 23:31:02 +0200337
Zesstra7ea4a032019-11-26 20:11:40 +0100338 Short options may be collated into one argument, e.g. '-rtl', but
339 of these only the last may take a value.
MG Mud User88f12472016-06-24 23:31:02 +0200340
Zesstra7ea4a032019-11-26 20:11:40 +0100341 The option '--' marks the end of options. All following command
342 arguments are considered proper arguments even if they start with a '-'
343 or '--'.
MG Mud User88f12472016-06-24 23:31:02 +0200344
Zesstra7ea4a032019-11-26 20:11:40 +0100345 The arguments are usually taken from the commandline; but the parser
346 is also able to read them from a textfiles, which can be nested. The
347 content of the textfiles is broken down into words delimited by
348 whitespace, which are then treated as given on the commandline at the
349 place where the instruction to read the textfile stood.
MG Mud User88f12472016-06-24 23:31:02 +0200350
Zesstra7ea4a032019-11-26 20:11:40 +0100351 The file parser recognizes simple double-quoted strings, which must be
352 contained on a single line. Additionally, the '#' character given by
353 itself is a comment marker - everthing after the '#' until the end
354 of the current line is ignored.
MG Mud User88f12472016-06-24 23:31:02 +0200355
356HISTORY
Zesstra7ea4a032019-11-26 20:11:40 +0100357 LDMud 3.2.9 added the --max-thread-pending, --hostname,
358 --hostaddr, --args and --random-seed options.
359 LDMud 3.2.10 added the --filename-spaces options.
360 LDMud 3.3.378 added --share-variables, --init-variables.
361 LDMud 3.3.475/3.2.11 added --tls-key, --tls-cert.
362 LDMud 3.3.672/3.2.11 added --tls-trustfile, --tls-trustdirectory.
363 LDMud 3.3.677 added --max-mapping-keys.
364 LDMud 3.3.714/3.2.15 added --tls-crlfile, --tls-crldirectory.
365 LDMud 3.3.x added --randominit.