]> andersk Git - moira.git/blobdiff - reg_svr/startreg.c
sms -> moira
[moira.git] / reg_svr / startreg.c
index 7f18d3de176a7fecf860943c3f05f4ae1a01bd5f..33fabbabb6167755da990c1bdd6cb4a561375eeb 100644 (file)
@@ -4,15 +4,18 @@
  *     $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>
@@ -20,10 +23,9 @@ static char *rcsid_sms_starter_c = "$Header$";
 #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[] = {
@@ -103,9 +105,10 @@ main(argc, argv)
        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);
@@ -128,6 +131,7 @@ main(argc, argv)
        tty = open("/dev/tty");
        ioctl(tty, TIOCNOTTY, 0);
        close(tty);
+       sprintf(buf, "%s/%s", BIN_DIR, PROG);
        
        if ((pid = fork()) == 0) {
                
@@ -135,7 +139,7 @@ main(argc, argv)
                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);
        }
This page took 0.034507 seconds and 4 git commands to generate.