externalize log rotation
[openafs.git] / src / volser / volmain.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #include <afsconfig.h>
11 #include <afs/param.h>
12
13 #include <roken.h>
14 #include <afs/opr.h>
15 #ifdef AFS_PTHREAD_ENV
16 # include <opr/lock.h>
17 # include <opr/softsig.h>
18 # include <afs/procmgmt_softsig.h> /* must come after softsig */
19 #endif
20
21 #ifdef AFS_NT40_ENV
22 #include <windows.h>
23 #include <WINNT/afsevent.h>
24 #endif
25
26 #include <rx/rx_queue.h>
27 #include <afs/afsint.h>
28 #include <afs/prs_fs.h>
29 #include <afs/nfs.h>
30 #include <lwp.h>
31 #include <lock.h>
32 #include <afs/afssyscalls.h>
33 #include <afs/ihandle.h>
34 #ifdef AFS_NT40_ENV
35 #include <afs/ntops.h>
36 #endif
37 #include <afs/vnode.h>
38 #include <afs/volume.h>
39 #include <afs/partition.h>
40 #include <rx/rx.h>
41 #include <rx/rxstat.h>
42 #include <rx/rx_globals.h>
43 #include <afs/auth.h>
44 #include <afs/cellconfig.h>
45 #include <afs/keys.h>
46 #include <afs/dir.h>
47 #include <ubik.h>
48 #include <afs/audit.h>
49 #include <afs/afsutil.h>
50 #include <afs/cmd.h>
51 #include <lwp.h>
52
53 #include "volser.h"
54 #include "volint.h"
55 #include "volser_internal.h"
56
57 #define VolserVersion "2.0"
58 #define N_SECURITY_OBJECTS 3
59
60 extern struct Lock localLock;
61 char *GlobalNameHack = NULL;
62 int hackIsIn = 0;
63 afs_int32 GlobalVolCloneId, GlobalVolParentId;
64 int GlobalVolType;
65 int VolumeChanged;              /* XXXX */
66 static char busyFlags[MAXHELPERS];
67 struct volser_trans *QI_GlobalWriteTrans = 0;
68 struct afsconf_dir *tdir;
69 static afs_int32 runningCalls = 0;
70 int DoLogging = 0;
71 int debuglevel = 0;
72 #define MAXLWP 128
73 int lwps = 9;
74 int udpBufSize = 0;             /* UDP buffer size for receive */
75 int restrictedQueryLevel = RESTRICTED_QUERY_ANYUSER;
76
77 int rxBind = 0;
78 int rxkadDisableDotCheck = 0;
79 int DoPreserveVolumeStats = 0;
80 int rxJumbograms = 0;   /* default is to not send and receive jumbograms. */
81 int rxMaxMTU = -1;
82 char *auditFileName = NULL;
83 static struct logOptions logopts;
84 char *configDir = NULL;
85
86 #define ADDRSPERSITE 16         /* Same global is in rx/rx_user.c */
87 afs_uint32 SHostAddrs[ADDRSPERSITE];
88
89 #define VS_EXIT(code)  {                                          \
90                           osi_audit(VS_ExitEvent, code, AUD_END); \
91                           exit(code);                             \
92                        }
93
94 static void
95 MyBeforeProc(struct rx_call *acall)
96 {
97     VTRANS_LOCK;
98     runningCalls++;
99     VTRANS_UNLOCK;
100     return;
101 }
102
103 static void
104 MyAfterProc(struct rx_call *acall, afs_int32 code)
105 {
106     VTRANS_LOCK;
107     runningCalls--;
108     VTRANS_UNLOCK;
109     return;
110 }
111
112 /* Called every GCWAKEUP seconds to try to unlock all our partitions,
113  * if we're idle and there are no active transactions
114  */
115 static void
116 TryUnlock(void)
117 {
118     /* if there are no running calls, and there are no active transactions, then
119      * it should be safe to release any partition locks we've accumulated */
120     VTRANS_LOCK;
121     if (runningCalls == 0 && TransList() == (struct volser_trans *)0) {
122         VTRANS_UNLOCK;
123         VPFullUnlock();         /* in volprocs.c */
124     } else
125         VTRANS_UNLOCK;
126 }
127
128 /* background daemon for timing out transactions */
129 static void*
130 BKGLoop(void *unused)
131 {
132     struct timeval tv;
133     int loop = 0;
134
135     afs_pthread_setname_self("vol bkg");
136     while (1) {
137         tv.tv_sec = GCWAKEUP;
138         tv.tv_usec = 0;
139 #ifdef AFS_PTHREAD_ENV
140 #ifdef AFS_NT40_ENV
141         Sleep(GCWAKEUP * 1000);
142 #else
143         select(0, 0, 0, 0, &tv);
144 #endif
145 #else
146         (void)IOMGR_Select(0, 0, 0, 0, &tv);
147 #endif
148         GCTrans();
149         TryUnlock();
150         loop++;
151         if (loop == 10) {       /* reopen log every 5 minutes */
152             loop = 0;
153             ReOpenLog();
154         }
155     }
156
157     return NULL;
158 }
159
160 #ifdef AFS_NT40_ENV
161 /* no volser_syscall */
162 #elif defined(AFS_SUN511_ENV)
163 int
164 volser_syscall(afs_uint32 a3, afs_uint32 a4, void *a5)
165 {
166     int err, code;
167     code = ioctl_sun_afs_syscall(28 /* AFSCALL_CALL */, a3, a4, a5, 0, 0, 0,
168                                  &err);
169     if (code) {
170         err = code;
171     }
172     return err;
173 }
174 #else
175 int
176 volser_syscall(afs_uint32 a3, afs_uint32 a4, void *a5)
177 {
178     afs_uint32 rcode;
179 #ifndef AFS_LINUX20_ENV
180     void (*old) (int);
181
182     old = signal(SIGSYS, SIG_IGN);
183 #endif
184     rcode =
185         syscall(AFS_SYSCALL /* AFS_SYSCALL */ , 28 /* AFSCALL_CALL */ , a3,
186                 a4, a5);
187 #ifndef AFS_LINUX20_ENV
188     signal(SIGSYS, old);
189 #endif
190
191     return rcode;
192 }
193 #endif
194
195
196 /* check whether caller is authorized to manage RX statistics */
197 int
198 vol_rxstat_userok(struct rx_call *call)
199 {
200     return afsconf_SuperUser(tdir, call, NULL);
201 }
202
203 /**
204  * Return true if this name is a member of the local realm.
205  */
206 static int
207 vol_IsLocalRealmMatch(void *rock, char *name, char *inst, char *cell)
208 {
209     struct afsconf_dir *dir = (struct afsconf_dir *)rock;
210     afs_int32 islocal = 0;      /* default to no */
211     int code;
212
213     code = afsconf_IsLocalRealmMatch(dir, &islocal, name, inst, cell);
214     if (code) {
215         ViceLog(0,
216                 ("Failed local realm check; code=%d, name=%s, inst=%s, cell=%s\n",
217                  code, name, inst, cell));
218     }
219     return islocal;
220 }
221
222 enum optionsList {
223     OPT_log,
224     OPT_rxbind,
225     OPT_dotted,
226     OPT_debug,
227     OPT_threads,
228     OPT_auditlog,
229     OPT_audit_interface,
230     OPT_nojumbo,
231     OPT_jumbo,
232     OPT_rxmaxmtu,
233     OPT_sleep,
234     OPT_udpsize,
235     OPT_peer,
236     OPT_process,
237     OPT_preserve_vol_stats,
238     OPT_sync,
239 #ifdef HAVE_SYSLOG
240     OPT_syslog,
241 #endif
242     OPT_logfile,
243     OPT_config,
244     OPT_restricted_query,
245     OPT_transarc_logs
246 };
247
248 static int
249 ParseArgs(int argc, char **argv) {
250     int code;
251     int optval;
252     char *optstring = NULL;
253     struct cmd_syndesc *opts;
254     char *sleepSpec = NULL;
255     char *sync_behavior = NULL;
256     char *restricted_query_parameter = NULL;
257
258     opts = cmd_CreateSyntax(NULL, NULL, NULL, 0, NULL);
259     cmd_AddParmAtOffset(opts, OPT_log, "-log", CMD_FLAG, CMD_OPTIONAL,
260            "log vos users");
261     cmd_AddParmAtOffset(opts, OPT_rxbind, "-rxbind", CMD_FLAG, CMD_OPTIONAL,
262            "bind only to the primary interface");
263     cmd_AddParmAtOffset(opts, OPT_dotted, "-allow-dotted-principals", CMD_FLAG, CMD_OPTIONAL,
264            "permit Kerberos 5 principals with dots");
265     cmd_AddParmAtOffset(opts, OPT_debug, "-d", CMD_SINGLE, CMD_OPTIONAL,
266            "debug level");
267     cmd_AddParmAtOffset(opts, OPT_threads, "-p", CMD_SINGLE, CMD_OPTIONAL,
268            "number of threads");
269     cmd_AddParmAtOffset(opts, OPT_auditlog, "-auditlog", CMD_SINGLE,
270            CMD_OPTIONAL, "location of audit log");
271     cmd_AddParmAtOffset(opts, OPT_audit_interface, "-audit-interface",
272            CMD_SINGLE, CMD_OPTIONAL, "interface to use for audit logging");
273     cmd_AddParmAtOffset(opts, OPT_nojumbo, "-nojumbo", CMD_FLAG, CMD_OPTIONAL,
274             "disable jumbograms");
275     cmd_AddParmAtOffset(opts, OPT_jumbo, "-jumbo", CMD_FLAG, CMD_OPTIONAL,
276             "enable jumbograms");
277     cmd_AddParmAtOffset(opts, OPT_rxmaxmtu, "-rxmaxmtu", CMD_SINGLE,
278             CMD_OPTIONAL, "maximum MTU for RX");
279     cmd_AddParmAtOffset(opts, OPT_udpsize, "-udpsize", CMD_SINGLE,
280             CMD_OPTIONAL, "size of socket buffer in bytes");
281     cmd_AddParmAtOffset(opts, OPT_sleep, "-sleep", CMD_SINGLE,
282             CMD_OPTIONAL, "make background daemon sleep (LWP only)");
283     cmd_AddParmAtOffset(opts, OPT_peer, "-enable_peer_stats", CMD_FLAG,
284             CMD_OPTIONAL, "enable RX transport statistics");
285     cmd_AddParmAtOffset(opts, OPT_process, "-enable_process_stats", CMD_FLAG,
286             CMD_OPTIONAL, "enable RX RPC statistics");
287     cmd_AddParmAtOffset(opts, OPT_preserve_vol_stats, "-preserve-vol-stats", CMD_FLAG,
288             CMD_OPTIONAL, "preserve volume statistics");
289 #ifdef HAVE_SYSLOG
290     cmd_AddParmAtOffset(opts, OPT_syslog, "-syslog", CMD_SINGLE_OR_FLAG,
291             CMD_OPTIONAL, "log to syslog");
292 #endif
293     cmd_AddParmAtOffset(opts, OPT_transarc_logs, "-transarc-logs", CMD_FLAG,
294                         CMD_OPTIONAL, "enable Transarc style logging");
295     cmd_AddParmAtOffset(opts, OPT_sync, "-sync",
296             CMD_SINGLE, CMD_OPTIONAL, "always | onclose | never");
297     cmd_AddParmAtOffset(opts, OPT_logfile, "-logfile", CMD_SINGLE,
298            CMD_OPTIONAL, "location of log file");
299     cmd_AddParmAtOffset(opts, OPT_config, "-config", CMD_SINGLE,
300            CMD_OPTIONAL, "configuration location");
301     cmd_AddParmAtOffset(opts, OPT_restricted_query, "-restricted_query",
302             CMD_SINGLE, CMD_OPTIONAL, "anyuser | admin");
303
304     code = cmd_Parse(argc, argv, &opts);
305     if (code == CMD_HELP) {
306         exit(0);
307     }
308     if (code)
309         return 1;
310
311     cmd_OptionAsFlag(opts, OPT_log, &DoLogging);
312     cmd_OptionAsFlag(opts, OPT_rxbind, &rxBind);
313     cmd_OptionAsFlag(opts, OPT_dotted, &rxkadDisableDotCheck);
314     cmd_OptionAsFlag(opts, OPT_preserve_vol_stats, &DoPreserveVolumeStats);
315     if (cmd_OptionPresent(opts, OPT_peer))
316         rx_enablePeerRPCStats();
317     if (cmd_OptionPresent(opts, OPT_process))
318         rx_enableProcessRPCStats();
319     if (cmd_OptionPresent(opts, OPT_nojumbo))
320         rxJumbograms = 0;
321     if (cmd_OptionPresent(opts, OPT_jumbo))
322         rxJumbograms = 1;
323
324 #ifdef HAVE_SYSLOG
325     if (cmd_OptionPresent(opts, OPT_syslog)) {
326         if (cmd_OptionPresent(opts, OPT_logfile)) {
327             fprintf(stderr, "Invalid options: -syslog and -logfile are exclusive.\n");
328             return -1;
329         }
330         if (cmd_OptionPresent(opts, OPT_transarc_logs)) {
331             fprintf(stderr, "Invalid options: -syslog and -transarc-logs are exclusive.\n");
332             return -1;
333         }
334         logopts.lopt_dest = logDest_syslog;
335         logopts.lopt_facility = LOG_DAEMON;
336         logopts.lopt_tag = "volserver";
337         cmd_OptionAsInt(opts, OPT_syslog, &logopts.lopt_facility);
338     } else
339 #endif
340     {
341         logopts.lopt_dest = logDest_file;
342         if (cmd_OptionPresent(opts, OPT_transarc_logs)) {
343             logopts.lopt_rotateOnOpen = 1;
344             logopts.lopt_rotateStyle = logRotate_old;
345         }
346         if (cmd_OptionPresent(opts, OPT_logfile))
347             cmd_OptionAsString(opts, OPT_logfile, (char**)&logopts.lopt_filename);
348         else
349             logopts.lopt_filename = AFSDIR_SERVER_VOLSERLOG_FILEPATH;
350     }
351     cmd_OptionAsInt(opts, OPT_debug, &logopts.lopt_logLevel);
352
353     cmd_OptionAsInt(opts, OPT_rxmaxmtu, &rxMaxMTU);
354     if (cmd_OptionAsInt(opts, OPT_udpsize, &optval) == 0) {
355         if (optval < rx_GetMinUdpBufSize()) {
356             printf("Warning:udpsize %d is less than minimum %d; ignoring\n",
357                     optval, rx_GetMinUdpBufSize());
358         } else
359             udpBufSize = optval;
360     }
361     cmd_OptionAsString(opts, OPT_auditlog, &auditFileName);
362
363     if (cmd_OptionAsString(opts, OPT_audit_interface, &optstring) == 0) {
364         if (osi_audit_interface(optstring)) {
365             printf("Invalid audit interface '%s'\n", optstring);
366             return -1;
367         }
368         free(optstring);
369         optstring = NULL;
370     }
371     if (cmd_OptionAsInt(opts, OPT_threads, &lwps) == 0) {
372         if (lwps > MAXLWP) {
373             printf("Warning: '-p %d' is too big; using %d instead\n", lwps, MAXLWP);
374             lwps = MAXLWP;
375         }
376     }
377     if (cmd_OptionAsString(opts, OPT_sleep, &sleepSpec) == 0) {
378         printf("Warning: -sleep option ignored; this option is obsolete\n");
379     }
380     if (cmd_OptionAsString(opts, OPT_sync, &sync_behavior) == 0) {
381         if (ih_SetSyncBehavior(sync_behavior)) {
382             printf("Invalid -sync value %s\n", sync_behavior);
383             return -1;
384         }
385     }
386     cmd_OptionAsString(opts, OPT_config, &configDir);
387     if (cmd_OptionAsString(opts, OPT_restricted_query,
388                            &restricted_query_parameter) == 0) {
389         if (strcmp(restricted_query_parameter, "anyuser") == 0)
390             restrictedQueryLevel = RESTRICTED_QUERY_ANYUSER;
391         else if (strcmp(restricted_query_parameter, "admin") == 0)
392             restrictedQueryLevel = RESTRICTED_QUERY_ADMIN;
393         else {
394             printf("invalid argument for -restricted_query: %s\n",
395                    restricted_query_parameter);
396             return -1;
397         }
398         free(restricted_query_parameter);
399     }
400
401     return 0;
402 }
403
404 #include "AFS_component_version_number.c"
405 int
406 main(int argc, char **argv)
407 {
408     afs_int32 code;
409     struct rx_securityClass **securityClasses;
410     afs_int32 numClasses;
411     struct rx_service *service;
412     int rxpackets = 100;
413     afs_uint32 host = ntohl(INADDR_ANY);
414     VolumePackageOptions opts;
415
416 #ifdef  AFS_AIX32_ENV
417     /*
418      * The following signal action for AIX is necessary so that in case of a
419      * crash (i.e. core is generated) we can include the user's data section
420      * in the core dump. Unfortunately, by default, only a partial core is
421      * generated which, in many cases, isn't too useful.
422      */
423     struct sigaction nsa;
424
425     sigemptyset(&nsa.sa_mask);
426     nsa.sa_handler = SIG_DFL;
427     nsa.sa_flags = SA_FULLDUMP;
428     sigaction(SIGABRT, &nsa, NULL);
429     sigaction(SIGSEGV, &nsa, NULL);
430 #endif
431     osi_audit_init();
432     osi_audit(VS_StartEvent, 0, AUD_END);
433
434     /* Initialize dirpaths */
435     if (!(initAFSDirPath() & AFSDIR_SERVER_PATHS_OK)) {
436 #ifdef AFS_NT40_ENV
437         ReportErrorEventAlt(AFSEVT_SVR_NO_INSTALL_DIR, 0, argv[0], 0);
438 #endif
439         fprintf(stderr, "%s: Unable to obtain AFS server directory.\n",
440                 argv[0]);
441         exit(2);
442     }
443
444     configDir = strdup(AFSDIR_SERVER_ETC_DIRPATH);
445
446     if (ParseArgs(argc, argv)) {
447         exit(1);
448     }
449
450     if (auditFileName) {
451         osi_audit_file(auditFileName);
452         osi_audit(VS_StartEvent, 0, AUD_END);
453     }
454 #ifdef AFS_SGI_VNODE_GLUE
455     if (afs_init_kernel_config(-1) < 0) {
456         printf
457             ("Can't determine NUMA configuration, not starting volserver.\n");
458         exit(1);
459     }
460 #endif
461     InitErrTabs();
462
463 #ifdef AFS_PTHREAD_ENV
464     SetLogThreadNumProgram( rx_GetThreadNum );
465 #endif
466
467 #ifdef AFS_NT40_ENV
468     if (afs_winsockInit() < 0) {
469         ReportErrorEventAlt(AFSEVT_SVR_WINSOCK_INIT_FAILED, 0, argv[0], 0);
470         printf("Volume server unable to start winsock, exiting.\n");
471         exit(1);
472     }
473 #endif
474
475     OpenLog(&logopts);
476
477     VOptDefaults(volumeServer, &opts);
478     if (VInitVolumePackage2(volumeServer, &opts)) {
479         Log("Shutting down: errors encountered initializing volume package\n");
480         exit(1);
481     }
482     /* For nuke() */
483     Lock_Init(&localLock);
484     DInit(40);
485 #ifndef AFS_PTHREAD_ENV
486     vol_PollProc = IOMGR_Poll;  /* tell vol pkg to poll io system periodically */
487 #endif
488 #ifndef AFS_NT40_ENV
489     rxi_syscallp = volser_syscall;
490 #endif
491     rx_nPackets = rxpackets;    /* set the max number of packets */
492     if (udpBufSize)
493         rx_SetUdpBufSize(udpBufSize);   /* set the UDP buffer size for receive */
494     if (rxBind) {
495         afs_int32 ccode;
496         if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
497             AFSDIR_SERVER_NETINFO_FILEPATH) {
498             char reason[1024];
499             ccode = afsconf_ParseNetFiles(SHostAddrs, NULL, NULL,
500                                           ADDRSPERSITE, reason,
501                                           AFSDIR_SERVER_NETINFO_FILEPATH,
502                                           AFSDIR_SERVER_NETRESTRICT_FILEPATH);
503         } else
504         {
505             ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
506         }
507         if (ccode == 1)
508             host = SHostAddrs[0];
509     }
510
511     code = rx_InitHost(host, (int)htons(AFSCONF_VOLUMEPORT));
512     if (code) {
513         fprintf(stderr, "rx init failed on socket AFSCONF_VOLUMEPORT %u\n",
514                 AFSCONF_VOLUMEPORT);
515         VS_EXIT(1);
516     }
517     if (!rxJumbograms) {
518         /* Don't allow 3.4 vos clients to send jumbograms and we don't send. */
519         rx_SetNoJumbo();
520     }
521     if (rxMaxMTU != -1) {
522         if (rx_SetMaxMTU(rxMaxMTU) != 0) {
523             fprintf(stderr, "rxMaxMTU %d is invalid\n", rxMaxMTU);
524             VS_EXIT(1);
525         }
526     }
527     rx_GetIFInfo();
528     rx_SetRxDeadTime(420);
529     memset(busyFlags, 0, sizeof(busyFlags));
530
531 #ifdef AFS_PTHREAD_ENV
532     opr_softsig_Init();
533     SetupLogSoftSignals();
534 #else
535     SetupLogSignals();
536 #endif
537
538     {
539 #ifdef AFS_PTHREAD_ENV
540         pthread_t tid;
541         pthread_attr_t tattr;
542         opr_Verify(pthread_attr_init(&tattr) == 0);
543         opr_Verify(pthread_attr_setdetachstate(&tattr,
544                                                PTHREAD_CREATE_DETACHED) == 0);
545         opr_Verify(pthread_create(&tid, &tattr, BKGLoop, NULL) == 0);
546 #else
547         PROCESS pid;
548         LWP_CreateProcess(BKGLoop, 16*1024, 3, 0, "vol bkg daemon", &pid);
549 #endif
550     }
551
552     /* Create a single security object, in this case the null security object, for unauthenticated connections, which will be used to control security on connections made to this server */
553
554     tdir = afsconf_Open(configDir);
555     if (!tdir) {
556         Abort("volser: could not open conf files in %s\n",
557               configDir);
558         VS_EXIT(1);
559     }
560
561     /* initialize audit user check */
562     osi_audit_set_user_check(tdir, vol_IsLocalRealmMatch);
563
564     afsconf_BuildServerSecurityObjects(tdir, &securityClasses, &numClasses);
565     if (securityClasses[0] == NULL)
566         Abort("rxnull_NewServerSecurityObject");
567     service =
568         rx_NewServiceHost(host, 0, VOLSERVICE_ID, "VOLSER", securityClasses,
569                           numClasses, AFSVolExecuteRequest);
570     if (service == (struct rx_service *)0)
571         Abort("rx_NewService");
572     rx_SetBeforeProc(service, MyBeforeProc);
573     rx_SetAfterProc(service, MyAfterProc);
574     rx_SetIdleDeadTime(service, 0);     /* never timeout */
575     if (lwps < 4)
576         lwps = 4;
577     rx_SetMaxProcs(service, lwps);
578 #if defined(AFS_XBSD_ENV)
579     rx_SetStackSize(service, (128 * 1024));
580 #elif defined(AFS_SGI_ENV)
581     rx_SetStackSize(service, (48 * 1024));
582 #else
583     rx_SetStackSize(service, (32 * 1024));
584 #endif
585
586     if (rxkadDisableDotCheck) {
587         rx_SetSecurityConfiguration(service, RXS_CONFIG_FLAGS,
588                                     (void *)RXS_CONFIG_FLAGS_DISABLE_DOTCHECK);
589     }
590
591     service =
592         rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", securityClasses,
593                       numClasses, RXSTATS_ExecuteRequest);
594     if (service == (struct rx_service *)0)
595         Abort("rx_NewService");
596     rx_SetMinProcs(service, 2);
597     rx_SetMaxProcs(service, 4);
598
599     LogCommandLine(argc, argv, "Volserver", VolserVersion, "Starting AFS",
600                    Log);
601     if (afsconf_GetLatestKey(tdir, NULL, NULL) == 0) {
602         LogDesWarning();
603     }
604
605     /* allow super users to manage RX statistics */
606     rx_SetRxStatUserOk(vol_rxstat_userok);
607
608     rx_StartServer(1);          /* Donate this process to the server process pool */
609
610     osi_audit(VS_FinishEvent, (-1), AUD_END);
611     Abort("StartServer returned?");
612     return 0; /* not reached */
613 }