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 /* Daemon that implements remote procedure call service for non-vendor system
11 * calls (currently setpag and pioctl). The AFS cache manager daemon, afsd,
12 * currently fires up this module, when the "-rmtsys" flag is given.
13 * This is the main routine for rmtsysd, which can be used separately from
16 #include <afsconfig.h>
17 #include <afs/param.h>
23 #include <sys/types.h>
24 #include <sys/ioctl.h>
27 #include <netinet/in.h>
34 #include "sys_prototypes.h"
36 #define N_SECURITY_OBJECTS 1 /* No real security yet */
38 #include "AFS_component_version_number.c"
41 main(int argc, char *argv[])
43 struct rx_securityClass *(securityObjects[N_SECURITY_OBJECTS]);
44 struct rx_service *service;
48 * The following signal action for AIX is necessary so that in case of a
49 * crash (i.e. core is generated) we can include the user's data section
50 * in the core dump. Unfortunately, by default, only a partial core is
51 * generated which, in many cases, isn't too useful.
55 sigemptyset(&nsa.sa_mask);
56 nsa.sa_handler = SIG_DFL;
57 nsa.sa_flags = SA_FULLDUMP;
58 sigaction(SIGABRT, &nsa, NULL);
59 sigaction(SIGSEGV, &nsa, NULL);
61 /* Initialize the rx-based RMTSYS server */
62 if (rx_Init(htons(AFSCONF_RMTSYSPORT)) < 0)
64 securityObjects[0] = rxnull_NewServerSecurityObject();
65 if (securityObjects[0] == (struct rx_securityClass *)0)
66 rmt_Quit("rxnull_NewServerSecurityObject");
68 rx_NewService(0, RMTSYS_SERVICEID, AFSCONF_RMTSYSSERVICE,
69 securityObjects, N_SECURITY_OBJECTS,
70 RMTSYS_ExecuteRequest);
71 if (service == (struct rx_service *)0)
72 rmt_Quit("rx_NewService");
73 /* One may wish to tune some default RX params for better performance
75 rx_SetMaxProcs(service, 2);
76 rx_StartServer(1); /* Donate this process to the server process pool */