2 * Copyright 2000, International Business Machines Corporation and others.
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
10 #include <afsconfig.h>
11 #include <afs/param.h>
17 #include <sys/types.h>
28 #include <WINNT/afsevent.h>
31 #include <netinet/in.h>
33 #endif /* AFS_NT40_ENV */
34 #include <afs/cellconfig.h>
37 #include <rx/rx_globals.h>
42 #include <afs/ktime.h>
43 #include <afs/afsutil.h>
44 #include <afs/fileutil.h>
45 #include <afs/procmgmt.h> /* signal(), kill(), wait(), etc. */
46 #if defined(AFS_SGI_ENV)
47 #include <afs/afs_args.h>
51 #define BOZO_LWP_STACKSIZE 16000
52 extern int BOZO_ExecuteRequest();
53 extern int RXSTATS_ExecuteRequest();
54 extern struct bnode_ops fsbnode_ops, ezbnode_ops, cronbnode_ops;
58 struct afsconf_dir *bozo_confdir = 0; /* bozo configuration dir */
59 static char *bozo_pid;
60 struct rx_securityClass *bozo_rxsc[3];
61 const char *bozo_fileName;
67 int DoSyslogFacility = LOG_DAEMON;
69 static afs_int32 nextRestart;
70 static afs_int32 nextDay;
72 struct ktime bozo_nextRestartKT, bozo_nextDayKT;
74 #ifdef BOS_RESTRICTED_MODE
75 int bozo_isrestricted = 0;
76 int bozo_restdisable = 0;
79 bozo_insecureme(int sig)
81 signal(SIGFPE, bozo_insecureme);
82 bozo_isrestricted = 0;
91 /* check whether caller is authorized to manage RX statistics */
93 bozo_rxstat_userok(struct rx_call *call)
95 return afsconf_SuperUser(bozo_confdir, call, NULL);
98 /* restart bozo process */
103 /* exit with restart code; SCM integrator process will restart bosserver */
104 int status = BOSEXIT_RESTART;
106 /* if noauth flag is set, pass "-noauth" to new bosserver */
107 if (afsconf_GetNoAuthFlag(bozo_confdir)) {
108 status |= BOSEXIT_NOAUTH_FLAG;
110 /* if logging is on, pass "-log" to new bosserver */
112 status |= BOSEXIT_LOGGING_FLAG;
116 /* exec new bosserver process */
120 argv[i] = (char *)AFSDIR_SERVER_BOSVR_FILEPATH;
123 /* if noauth flag is set, pass "-noauth" to new bosserver */
124 if (afsconf_GetNoAuthFlag(bozo_confdir)) {
128 /* if logging is on, pass "-log" to new bosserver */
134 /* if syslog logging is on, pass "-syslog" to new bosserver */
136 char *arg = (char *)malloc(40); /* enough for -syslog=# */
137 if (DoSyslogFacility != LOG_DAEMON) {
138 snprintf(arg, 40, "-syslog=%d", DoSyslogFacility);
140 strcpy(arg, "-syslog");
147 /* null-terminate argument list */
150 /* close random fd's */
151 for (i = 3; i < 64; i++) {
155 execv(argv[0], argv); /* should not return */
157 #endif /* AFS_NT40_ENV */
160 /* make sure a dir exists */
162 MakeDir(register char *adir)
165 register afs_int32 code;
166 if (stat(adir, &tstat) < 0 || (tstat.st_mode & S_IFMT) != S_IFDIR) {
169 reqPerm = GetRequiredDirPerm(adir);
173 /* underlying filesystem may not support directory protection */
176 code = mkdir(adir, reqPerm);
183 /* create all the bozo dirs */
188 (AFSDIR_USR_DIRPATH, AFSDIR_CLIENT_ETC_DIRPATH,
189 strlen(AFSDIR_USR_DIRPATH)))
192 (AFSDIR_USR_DIRPATH, AFSDIR_SERVER_BIN_DIRPATH,
193 strlen(AFSDIR_USR_DIRPATH)))) {
194 MakeDir(AFSDIR_USR_DIRPATH);
197 (AFSDIR_SERVER_AFS_DIRPATH, AFSDIR_SERVER_BIN_DIRPATH,
198 strlen(AFSDIR_SERVER_AFS_DIRPATH))) {
199 MakeDir(AFSDIR_SERVER_AFS_DIRPATH);
201 MakeDir(AFSDIR_SERVER_BIN_DIRPATH);
202 MakeDir(AFSDIR_SERVER_ETC_DIRPATH);
203 MakeDir(AFSDIR_SERVER_LOCAL_DIRPATH);
204 MakeDir(AFSDIR_SERVER_DB_DIRPATH);
205 MakeDir(AFSDIR_SERVER_LOGS_DIRPATH);
208 (AFSDIR_CLIENT_VICE_DIRPATH, AFSDIR_CLIENT_ETC_DIRPATH,
209 strlen(AFSDIR_CLIENT_VICE_DIRPATH))) {
210 MakeDir(AFSDIR_CLIENT_VICE_DIRPATH);
212 MakeDir(AFSDIR_CLIENT_ETC_DIRPATH);
214 symlink(AFSDIR_SERVER_THISCELL_FILEPATH, AFSDIR_CLIENT_THISCELL_FILEPATH);
215 symlink(AFSDIR_SERVER_CELLSERVDB_FILEPATH,
216 AFSDIR_CLIENT_CELLSERVDB_FILEPATH);
217 #endif /* AFS_NT40_ENV */
221 /* strip the \\n from the end of the line, if it is present */
223 StripLine(register char *abuffer)
227 tp = abuffer + strlen(abuffer); /* starts off pointing at the null */
229 return 0; /* null string, no last character to check */
230 tp--; /* aim at last character */
236 /* write one bnode's worth of entry into the file */
238 bzwrite(register struct bnode *abnode, register struct bztemp *at)
241 char tbuffer[BOZO_BSSIZE];
242 register afs_int32 code;
244 if (abnode->notifier)
245 fprintf(at->file, "bnode %s %s %d %s\n", abnode->type->name,
246 abnode->name, abnode->fileGoal, abnode->notifier);
248 fprintf(at->file, "bnode %s %s %d\n", abnode->type->name,
249 abnode->name, abnode->fileGoal);
251 code = bnode_GetParm(abnode, i, tbuffer, BOZO_BSSIZE);
257 fprintf(at->file, "parm %s\n", tbuffer);
259 fprintf(at->file, "end\n");
265 ReadBozoFile(char *aname)
267 register FILE *tfile;
268 char tbuffer[BOZO_BSSIZE];
270 char *instp, *typep, *notifier, *notp;
271 register afs_int32 code;
272 afs_int32 ktmask, ktday, kthour, ktmin, ktsec;
275 char *parms[MAXPARMS];
276 #ifdef BOS_RESTRICTED_MODE
280 /* rename BozoInit to BosServer for the user */
282 /* if BozoInit exists and BosConfig doesn't, try a rename */
283 if (access(AFSDIR_SERVER_BOZINIT_FILEPATH, 0) == 0
284 && access(AFSDIR_SERVER_BOZCONF_FILEPATH, 0) != 0) {
286 renamefile(AFSDIR_SERVER_BOZINIT_FILEPATH,
287 AFSDIR_SERVER_BOZCONF_FILEPATH);
289 perror("bosconfig rename");
291 #ifdef BOS_NEW_CONFIG
292 if (access(AFSDIR_SERVER_BOZCONFNEW_FILEPATH, 0) == 0) {
294 renamefile(AFSDIR_SERVER_BOZCONFNEW_FILEPATH,
295 AFSDIR_SERVER_BOZCONF_FILEPATH);
297 perror("bosconfig rename");
302 /* setup default times we want to do restarts */
303 bozo_nextRestartKT.mask = KTIME_HOUR | KTIME_MIN | KTIME_DAY;
304 bozo_nextRestartKT.hour = 4; /* 4 am */
305 bozo_nextRestartKT.min = 0;
306 bozo_nextRestartKT.day = 0; /* Sunday */
307 bozo_nextDayKT.mask = KTIME_HOUR | KTIME_MIN;
308 bozo_nextDayKT.hour = 5;
309 bozo_nextDayKT.min = 0;
311 for (code = 0; code < MAXPARMS; code++)
313 instp = typep = notifier = NULL;
316 aname = (char *)bozo_fileName;
317 tfile = fopen(aname, "r");
320 instp = (char *)malloc(BOZO_BSSIZE);
321 typep = (char *)malloc(BOZO_BSSIZE);
322 notifier = notp = (char *)malloc(BOZO_BSSIZE);
324 /* ok, read lines giving parms and such from the file */
325 tp = fgets(tbuffer, sizeof(tbuffer), tfile);
327 break; /* all done */
329 if (strncmp(tbuffer, "restarttime", 11) == 0) {
331 sscanf(tbuffer, "restarttime %d %d %d %d %d", &ktmask, &ktday,
332 &kthour, &ktmin, &ktsec);
337 /* otherwise we've read in the proper ktime structure; now assign
338 * it and continue processing */
339 bozo_nextRestartKT.mask = ktmask;
340 bozo_nextRestartKT.day = ktday;
341 bozo_nextRestartKT.hour = kthour;
342 bozo_nextRestartKT.min = ktmin;
343 bozo_nextRestartKT.sec = ktsec;
347 if (strncmp(tbuffer, "checkbintime", 12) == 0) {
349 sscanf(tbuffer, "checkbintime %d %d %d %d %d", &ktmask,
350 &ktday, &kthour, &ktmin, &ktsec);
355 /* otherwise we've read in the proper ktime structure; now assign
356 * it and continue processing */
357 bozo_nextDayKT.mask = ktmask; /* time to restart the system */
358 bozo_nextDayKT.day = ktday;
359 bozo_nextDayKT.hour = kthour;
360 bozo_nextDayKT.min = ktmin;
361 bozo_nextDayKT.sec = ktsec;
364 #ifdef BOS_RESTRICTED_MODE
365 if (strncmp(tbuffer, "restrictmode", 12) == 0) {
366 code = sscanf(tbuffer, "restrictmode %d", &rmode);
371 if (rmode != 0 && rmode != 1) {
375 bozo_isrestricted = rmode;
380 if (strncmp("bnode", tbuffer, 5) != 0) {
386 sscanf(tbuffer, "bnode %s %s %d %s", typep, instp, &goal,
391 } else if (code == 3)
394 for (i = 0; i < MAXPARMS; i++) {
395 /* now read the parms, until we see an "end" line */
396 tp = fgets(tbuffer, sizeof(tbuffer), tfile);
402 if (!strncmp(tbuffer, "end", 3))
404 if (strncmp(tbuffer, "parm ", 5)) {
406 goto fail; /* no "parm " either */
408 if (!parms[i]) /* make sure there's space */
409 parms[i] = (char *)malloc(BOZO_BSSIZE);
410 strcpy(parms[i], tbuffer + 5); /* remember the parameter for later */
413 /* ok, we have the type and parms, now create the object */
415 bnode_Create(typep, instp, &tb, parms[0], parms[1], parms[2],
416 parms[3], parms[4], notifier,
417 goal ? BSTAT_NORMAL : BSTAT_SHUTDOWN);
421 /* bnode created in 'temporarily shutdown' state;
422 * check to see if we are supposed to run this guy,
423 * and if so, start the process up */
425 bnode_SetStat(tb, BSTAT_NORMAL); /* set goal, taking effect immediately */
427 bnode_SetStat(tb, BSTAT_SHUTDOWN);
438 for (i = 0; i < MAXPARMS; i++)
446 /* write a new bozo file */
448 WriteBozoFile(char *aname)
450 register FILE *tfile;
451 char tbuffer[AFSDIR_PATH_MAX];
452 register afs_int32 code;
456 aname = (char *)bozo_fileName;
457 strcpy(tbuffer, aname);
458 strcat(tbuffer, ".NBZ");
459 tfile = fopen(tbuffer, "w");
463 #ifdef BOS_RESTRICTED_MODE
464 fprintf(tfile, "restrictmode %d\n", bozo_isrestricted);
466 fprintf(tfile, "restarttime %d %d %d %d %d\n", bozo_nextRestartKT.mask,
467 bozo_nextRestartKT.day, bozo_nextRestartKT.hour,
468 bozo_nextRestartKT.min, bozo_nextRestartKT.sec);
469 fprintf(tfile, "checkbintime %d %d %d %d %d\n", bozo_nextDayKT.mask,
470 bozo_nextDayKT.day, bozo_nextDayKT.hour, bozo_nextDayKT.min,
472 code = bnode_ApplyInstance(bzwrite, &btemp);
473 if (code || (code = ferror(tfile))) { /* something went wrong */
478 /* close the file, check for errors and snap new file into place */
479 if (fclose(tfile) == EOF) {
483 code = renamefile(tbuffer, aname);
492 bdrestart(register struct bnode *abnode, char *arock)
494 register afs_int32 code;
496 if (abnode->fileGoal != BSTAT_NORMAL || abnode->goal != BSTAT_NORMAL)
497 return 0; /* don't restart stopped bnodes */
499 code = bnode_RestartP(abnode);
501 /* restart the dude */
502 bnode_SetStat(abnode, BSTAT_SHUTDOWN);
503 bnode_WaitStatus(abnode, BSTAT_SHUTDOWN);
504 bnode_SetStat(abnode, BSTAT_NORMAL);
506 bnode_Release(abnode);
507 return 0; /* keep trying all bnodes */
510 #define BOZO_MINSKIP 3600 /* minimum to advance clock */
511 /* lwp to handle system restarts */
515 register afs_int32 now;
517 /* now initialize the values */
521 now = FT_ApproxTime();
523 #ifdef BOS_RESTRICTED_MODE
524 if (bozo_restdisable) {
525 bozo_Log("Restricted mode disabled by signal\n");
526 bozo_restdisable = 0;
529 if (bozo_newKTs) { /* need to recompute restart times */
530 bozo_newKTs = 0; /* done for a while */
531 nextRestart = ktime_next(&bozo_nextRestartKT, BOZO_MINSKIP);
532 nextDay = ktime_next(&bozo_nextDayKT, BOZO_MINSKIP);
535 /* see if we should do a restart */
536 if (now > nextRestart) {
537 SBOZO_ReBozo(0); /* doesn't come back */
540 /* see if we should restart a server */
542 nextDay = ktime_next(&bozo_nextDayKT, BOZO_MINSKIP);
544 /* call the bnode restartp function, and restart all that require it */
545 bnode_ApplyInstance(bdrestart, 0);
556 int s, sb_max, ipfragttl;
560 f = popen("/usr/sbin/no -o sb_max", "r");
561 s = fscanf(f, "sb_max = %d", &sb_max);
565 f = popen("/usr/sbin/no -o ipfragttl", "r");
566 s = fscanf(f, "ipfragttl = %d", &ipfragttl);
576 sprintf(c, "/usr/sbin/no -o sb_max=%d -o ipfragttl=%d", sb_max,
585 * This routine causes the calling process to go into the background and
586 * to lose its controlling tty.
588 * It does not close or otherwise alter the standard file descriptors.
590 * It writes warning messages to the standard error output if certain
591 * fundamental errors occur.
593 * This routine requires
595 * #include <sys/types.h>
596 * #include <sys/stat.h>
598 * #include <unistd.h>
599 * #include <stdlib.h>
601 * and has been tested on:
617 * A process is a process group leader if its process ID
618 * (getpid()) and its process group ID (getpgrp()) are the same.
622 * To create a new session (and thereby lose our controlling
623 * terminal) we cannot be a process group leader.
625 * To guarantee we are not a process group leader, we fork and
626 * let the parent process exit.
629 if (getpid() == getpgrp()) {
634 abort(); /* leave footprints */
638 default: /* parent */
645 * By here, we are not a process group leader, so we can make a
646 * new session and become the session leader.
650 pid_t sid = setsid();
653 static char err[] = "bosserver: WARNING: setsid() failed\n";
654 write(STDERR_FILENO, err, sizeof err - 1);
659 * Once we create a new session, the current process is a
660 * session leader without a controlling tty.
662 * On some systems, the first tty device the session leader
663 * opens automatically becomes the controlling tty for the
666 * So, to guarantee we do not acquire a controlling tty, we fork
667 * and let the parent process exit. The child process is not a
668 * session leader, and so it will not acquire a controlling tty
669 * even if it should happen to open a tty device.
672 if (getpid() == getpgrp()) {
677 abort(); /* leave footprints */
681 default: /* parent */
688 * check that we no longer have a controlling tty
694 fd = open("/dev/tty", O_RDONLY);
698 "bosserver: WARNING: /dev/tty still attached\n";
700 write(STDERR_FILENO, err, sizeof err - 1);
704 #endif /* ! AFS_NT40_ENV */
707 /* start a process and monitor it */
709 #include "AFS_component_version_number.c"
712 main(int argc, char **argv, char **envp)
714 struct rx_service *tservice;
715 register afs_int32 code;
716 struct afsconf_dir *tdir;
718 struct ktc_encryptionKey tkey;
720 char namebuf[AFSDIR_PATH_MAX];
726 struct sigaction nsa;
728 /* for some reason, this permits user-mode RX to run a lot faster.
729 * we do it here in the bosserver, so we don't have to do it
730 * individually in each server.
735 * The following signal action for AIX is necessary so that in case of a
736 * crash (i.e. core is generated) we can include the user's data section
737 * in the core dump. Unfortunately, by default, only a partial core is
738 * generated which, in many cases, isn't too useful.
740 sigemptyset(&nsa.sa_mask);
741 nsa.sa_handler = SIG_DFL;
742 nsa.sa_flags = SA_FULLDUMP;
743 sigaction(SIGSEGV, &nsa, NULL);
744 sigaction(SIGABRT, &nsa, NULL);
746 #ifdef BOS_RESTRICTED_MODE
747 signal(SIGFPE, bozo_insecureme);
751 /* Initialize winsock */
752 if (afs_winsockInit() < 0) {
753 ReportErrorEventAlt(AFSEVT_SVR_WINSOCK_INIT_FAILED, 0, argv[0], 0);
754 fprintf(stderr, "%s: Couldn't initialize winsock.\n", argv[0]);
759 /* Initialize dirpaths */
760 if (!(initAFSDirPath() & AFSDIR_SERVER_PATHS_OK)) {
762 ReportErrorEventAlt(AFSEVT_SVR_NO_INSTALL_DIR, 0, argv[0], 0);
764 fprintf(stderr, "%s: Unable to obtain AFS server directory.\n",
769 /* some path inits */
770 bozo_fileName = AFSDIR_SERVER_BOZCONF_FILEPATH;
772 /* initialize the list of dirpaths that the bosserver has
773 * an interest in monitoring */
776 #if defined(AFS_SGI_ENV)
777 /* offer some protection if AFS isn't loaded */
778 if (syscall(AFS_SYSCALL, AFSOP_ENDLOG) < 0 && errno == ENOPKG) {
779 printf("bosserver: AFS doesn't appear to be configured in O.S..\n");
785 for (code = 1; code < argc; code++) {
786 if (strcmp(argv[code], "-noauth") == 0) {
787 /* set noauth flag */
789 } else if (strcmp(argv[code], "-log") == 0) {
790 /* set extra logging flag */
794 else if (strcmp(argv[code], "-syslog") == 0) {
795 /* set syslog logging flag */
797 } else if (strncmp(argv[code], "-syslog=", 8) == 0) {
799 DoSyslogFacility = atoi(argv[code] + 8);
800 } else if (strcmp(argv[code], "-nofork") == 0) {
804 else if (strcmp(argv[code], "-enable_peer_stats") == 0) {
805 rx_enablePeerRPCStats();
806 } else if (strcmp(argv[code], "-enable_process_stats") == 0) {
807 rx_enableProcessRPCStats();
809 #ifdef BOS_RESTRICTED_MODE
810 else if (strcmp(argv[code], "-restricted") == 0) {
811 bozo_isrestricted = 1;
814 else if (strcmp(argv[code], "-auditlog") == 0) {
817 char oldName[MAXPATHLEN];
818 char *fileName = argv[++code];
823 if ((lstat(fileName, &statbuf) == 0)
824 && (S_ISFIFO(statbuf.st_mode))) {
825 flags = O_WRONLY | O_NONBLOCK;
829 strcpy(oldName, fileName);
830 strcat(oldName, ".old");
831 renamefile(fileName, oldName);
832 flags = O_WRONLY | O_TRUNC | O_CREAT;
834 tempfd = open(fileName, flags, 0666);
836 auditout = fdopen(tempfd, "a");
838 osi_audit_file(auditout);
840 printf("Warning: auditlog %s not writable, ignored.\n", fileName);
842 printf("Warning: auditlog %s not writable, ignored.\n", fileName);
846 /* hack to support help flag */
849 printf("Usage: bosserver [-noauth] [-log] "
850 "[-auditlog <log path>] "
851 "[-syslog[=FACILITY]] "
852 "[-enable_peer_stats] [-enable_process_stats] "
853 "[-nofork] " "[-help]\n");
855 printf("Usage: bosserver [-noauth] [-log] "
856 "[-auditlog <log path>] "
857 "[-enable_peer_stats] [-enable_process_stats] "
867 if (geteuid() != 0) {
868 printf("bosserver: must be run as root.\n");
875 printf("bosserver: could not init bnode package, code %d\n", code);
879 bnode_Register("fs", &fsbnode_ops, 3);
880 bnode_Register("simple", &ezbnode_ops, 1);
881 bnode_Register("cron", &cronbnode_ops, 2);
883 /* create useful dirs */
886 /* chdir to AFS log directory */
887 chdir(AFSDIR_SERVER_LOGS_DIRPATH);
890 fputs(AFS_GOVERNMENT_MESSAGE, stdout);
894 /* go into the background and remove our controlling tty, close open
901 #endif /* ! AFS_NT40_ENV */
905 && ((lstat(AFSDIR_BOZLOG_FILE, &sb) == 0) &&
906 !(S_ISFIFO(sb.st_mode)))
909 strcpy(namebuf, AFSDIR_BOZLOG_FILE);
910 strcat(namebuf, ".old");
911 renamefile(AFSDIR_BOZLOG_FILE, namebuf); /* try rename first */
912 bozo_logFile = fopen(AFSDIR_BOZLOG_FILE, "a");
914 printf("bosserver: can't initialize log file (%s).\n",
915 AFSDIR_SERVER_BOZLOG_FILEPATH);
918 /* keep log closed normally, so can be removed */
919 fclose(bozo_logFile);
922 openlog("bosserver", LOG_PID, DoSyslogFacility);
926 /* Write current state of directory permissions to log file */
929 for (i = 0; i < 10; i++) {
930 code = rx_Init(htons(AFSCONF_NANNYPORT));
932 bozo_Log("can't initialize rx: code=%d\n", code);
938 bozo_Log("Bos giving up, can't initialize rx\n");
942 code = LWP_CreateProcess(BozoDaemon, BOZO_LWP_STACKSIZE, /* priority */ 1,
943 (void *) /*parm */ 0, "bozo-the-clown",
946 /* try to read the key from the config file */
947 tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
949 /* try to create local cell config file */
950 struct afsconf_cell tcell;
951 strcpy(tcell.name, "localcell");
952 tcell.numServers = 1;
953 code = gethostname(tcell.hostName[0], MAXHOSTCHARS);
955 bozo_Log("failed to get hostname, code %d\n", errno);
958 if (tcell.hostName[0][0] == 0) {
959 bozo_Log("host name not set, can't start\n");
960 bozo_Log("try the 'hostname' command\n");
963 memset(tcell.hostAddr, 0, sizeof(tcell.hostAddr)); /* not computed */
965 afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH,
969 ("could not create cell database in '%s' (code %d), quitting\n",
970 AFSDIR_SERVER_ETC_DIRPATH, code);
973 tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
976 ("failed to open newly-created cell database, quitting\n");
981 /* read init file, starting up programs */
982 if (code = ReadBozoFile(0)) {
984 ("bosserver: Something is wrong (%d) with the bos configuration file %s; aborting\n",
985 code, AFSDIR_SERVER_BOZCONF_FILEPATH);
989 /* opened the cell databse */
991 code = afsconf_GetKey(tdir, 999, &tkey);
993 /* allow super users to manage RX statistics */
994 rx_SetRxStatUserOk(bozo_rxstat_userok);
996 /* have bcrypt key now */
998 afsconf_SetNoAuthFlag(tdir, noAuth);
1000 bozo_rxsc[0] = rxnull_NewServerSecurityObject();
1001 bozo_rxsc[1] = (struct rx_securityClass *)0;
1003 rxkad_NewServerSecurityObject(0, tdir, afsconf_GetKey, NULL);
1005 /* Disable jumbograms */
1008 tservice = rx_NewService( /* port */ 0, /* service id */ 1,
1009 /*service name */ "bozo",
1010 /* security classes */
1012 /* numb sec classes */ 3, BOZO_ExecuteRequest);
1013 rx_SetMinProcs(tservice, 2);
1014 rx_SetMaxProcs(tservice, 4);
1015 rx_SetStackSize(tservice, BOZO_LWP_STACKSIZE); /* so gethostbyname works (in cell stuff) */
1018 rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", bozo_rxsc, 3,
1019 RXSTATS_ExecuteRequest);
1020 rx_SetMinProcs(tservice, 2);
1021 rx_SetMaxProcs(tservice, 4);
1022 rx_StartServer(1); /* donate this process */
1026 bozo_Log(char *a, char *b, char *c, char *d, char *e, char *f)
1032 #ifndef AFS_NT40_ENV
1033 syslog(LOG_INFO, a, b, c, d, e, f);
1037 strcpy(tdate, ctime(&myTime)); /* copy out of static area asap */
1040 /* log normally closed, so can be removed */
1042 bozo_logFile = fopen(AFSDIR_SERVER_BOZLOG_FILEPATH, "a");
1043 if (bozo_logFile == NULL) {
1044 printf("bosserver: WARNING: problem with %s\n",
1045 AFSDIR_SERVER_BOZLOG_FILEPATH);
1046 printf("%s ", tdate);
1047 printf(a, b, c, d, e, f);
1050 fprintf(bozo_logFile, "%s ", tdate);
1051 fprintf(bozo_logFile, a, b, c, d, e, f);
1053 /* close so rm BosLog works */
1054 fclose(bozo_logFile);