* $Header$
*
* Copyright (C) 1987 by the Massachusetts Institute of Technology
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
*
* This program starts the user registration server
* in a "clean" environment, and then waits for it to exit.
*/
#ifndef lint
-static char *rcsid_sms_starter_c = "$Header$";
+static char *rcsid_mr_starter_c = "$Header$";
#endif lint
+#include <mit-copyright.h>
#include <stdio.h>
#include <strings.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/signal.h>
#include <sys/ioctl.h>
+#include <moira_site.h>
-#define SMS_LOG_FILE "/u1/sms/reg_svr.log"
-
-#define SMS_PROG "/u1/sms/bin/reg_svr"
+#define PROG "reg_svr"
int rdpipe[2];
char *sigdescr[] = {
setreuid(0);
signal(SIGCHLD, cleanup);
- logf = open(SMS_LOG_FILE, O_CREAT|O_WRONLY|O_APPEND, 0640);
+ sprintf(buf, "%s/%s.log", SMS_DIR, PROG);
+ logf = open(buf, O_CREAT|O_WRONLY|O_APPEND, 0640);
if (logf<0) {
- perror(SMS_LOG_FILE);
+ perror(buf);
exit(1);
}
inf = open("/dev/null", O_RDONLY , 0);
tty = open("/dev/tty");
ioctl(tty, TIOCNOTTY, 0);
close(tty);
+ sprintf(buf, "%s/%s", BIN_DIR, PROG);
if ((pid = fork()) == 0) {
dup2(rdpipe[1], 1);
dup2(1,2);
for (i = 3; i <nfds; i++) close(i);
- execl(SMS_PROG, "reg_svr", 0);
+ execl(buf, PROG, 0);
perror("cannot run reg_svr");
exit(1);
}