]> andersk Git - moira.git/commitdiff
moved directory definitions
authormar <mar>
Fri, 8 Sep 1989 15:09:43 +0000 (15:09 +0000)
committermar <mar>
Fri, 8 Sep 1989 15:09:43 +0000 (15:09 +0000)
dcm/dcm.c
dcm/utils.c
gen/hesiod.qc
gen/nfs.qc
server/increment.qc
server/mr_glue.c
server/mr_main.c
server/mr_scall.c
server/mr_server.h

index 1d03604ad10c6529612dbb5c91997543f930293d..4b25d7e87507701c5d5da9da818a289e9a50efeb 100644 (file)
--- a/dcm/dcm.c
+++ b/dcm/dcm.c
@@ -69,7 +69,7 @@ char *argv[];
        set_com_err_hook(dcm_com_err_hook);
        
        /* if /etc/nodcm exists, punt quietly. */
-       if (!access("/etc/nodcm", F_OK)) {
+       if (!access(NODCMFILE, F_OK)) {
                exit(1);
        } 
 
@@ -177,14 +177,14 @@ do_services()
            *p = tolower(*p);
        com_err(whoami, 0, "checking %s...", service);
        qargv[0] = service;
-       sprintf(dfgen_prog, "%s/bin/%s.gen", SMS_DIR, service);
+       sprintf(dfgen_prog, "%s/%s.gen", BIN_DIR, service);
        if (!file_exists(dfgen_prog)) {
            com_err(whoami, 0, "prog %s doesn't exist\n", dfgen_prog);
            free(service);
            continue;
        }
-       sprintf(dfgen_cmd, "exec %s %s/dcm/%s.out",
-               dfgen_prog, SMS_DIR, service);
+       sprintf(dfgen_cmd, "exec %s %s/%s.out",
+               dfgen_prog, DCM_DIR, service);
        gettimeofday(&tv, &tz);
        if (status = sms_query("get_server_info", 1, qargv, getsvinfo, &svc)) {
            com_err(whoami, status, " getting service %s info, skipping to next service", service);
@@ -199,7 +199,7 @@ do_services()
        qargv[5] = strsave(svc.errmsg);
        if (svc.interval != 0) {
            if (svc.interval * 60 + svc.dfcheck < tv.tv_sec) {
-               lock_fd = maybe_lock_update(SMS_DIR, "@db@", service, 1);
+               lock_fd = maybe_lock_update("@db@", service, 1);
                if (lock_fd < 0)
                  goto free_service;
                free(qargv[3]);
@@ -278,7 +278,7 @@ do_services()
              ex = 1;
            else
              ex = 0;
-           lock_fd = maybe_lock_update(SMS_DIR, "@db@", service, ex);
+           lock_fd = maybe_lock_update("@db@", service, ex);
            if (lock_fd >= 0) {
                do_hosts(&svc);
                close(lock_fd);
@@ -370,7 +370,7 @@ struct service *svc;
            goto free_mach;
        }
 
-       lock_fd = maybe_lock_update(SMS_DIR, machine, svc->service, 1);
+       lock_fd = maybe_lock_update(machine, svc->service, 1);
        if (lock_fd < 0)
          goto free_mach;
        argv[0] = svc->service;
index b9ab5dd0ab71cda5818cb9376769e5ecbb5f7da3..d8734901ac24b726466a7c5b38d32e870e986587 100644 (file)
@@ -24,6 +24,7 @@ static char *rcsid_utils_c = "$Header$";
 #include <sys/file.h>
 #include <zephyr/zephyr.h>
 #include <sms.h>
+#include <sms_app.h>
 #include "dcm.h"
 
 
@@ -90,14 +91,14 @@ char *tkt_string()
 }
 
 
-int maybe_lock_update(dir, host, service, exclusive)
-char *dir, *host, *service;
+int maybe_lock_update(host, service, exclusive)
+char *host, *service;
 int exclusive;
 {
     char lock[BUFSIZ];
     int fd;
 
-    sprintf(lock, "%s/dcm/locks/%s.%s", dir, host, service);
+    sprintf(lock, "%s/%s.%s", LOCK_DIR, host, service);
     if ((fd = open(lock, O_TRUNC |  O_CREAT, 0)) < 0)
       com_err(whoami, errno, ": maybe_lock_update: opening %s", lock);
     else if (flock(fd, (exclusive ? LOCK_EX : LOCK_SH) | LOCK_NB) != 0) {
index 9e202241ec21e7fe1f278405bbb2d0d33dc755b5..7726e1cd5e64143038f2b0ee7edbec99a4f6c176 100644 (file)
@@ -19,7 +19,7 @@
 #include <ctype.h>
 
 
-#define HESIOD_DIR     "/u1/sms/dcm/hesiod"
+char hesiod_dir[64];
 
 #define min(x,y)       ((x) < (y) ? (x) : (y))
 struct hash *machines = NULL;
@@ -54,6 +54,7 @@ char **argv;
 
     IIseterr(ingerr);
     initialize_sms_error_table ();
+    sprintf(hesiod_dir, "%s/hesiod", DCM_DIR);
 
 ##  ingres sms
 ##  set lockmode session where level = table
@@ -77,7 +78,7 @@ char **argv;
 
     if (argc == 2) {
        fprintf(stderr, "Building tar file.\n");
-       sprintf(cmd, "cd %s; tar cf %s .", HESIOD_DIR, argv[1]);
+       sprintf(cmd, "cd %s; tar cf %s .", hesiod_dir, argv[1]);
        if (system(cmd))
          exit(SMS_TAR_FAIL);
     }
@@ -139,9 +140,9 @@ do_passwd()
 ##  char nn[17], ptype[9];
 ##  int uid, flag1, flag2, id, pid;
 
-    sprintf(poutf, "%s/passwd.db", HESIOD_DIR);
-    sprintf(uoutf, "%s/uid.db", HESIOD_DIR);
-    sprintf(boutf, "%s/pobox.db", HESIOD_DIR);
+    sprintf(poutf, "%s/passwd.db", hesiod_dir);
+    sprintf(uoutf, "%s/uid.db", hesiod_dir);
+    sprintf(boutf, "%s/pobox.db", hesiod_dir);
 
     if (stat(poutf, &psb) == 0 && stat(uoutf, &usb) == 0 &&
        stat(boutf, &bsb) == 0) {
@@ -240,9 +241,9 @@ do_groups()
 ##  int gid, id, lid, flag1, flag2, flag3, maxid;
 
     /* open files */
-    sprintf(ioutf, "%s/gid.db", HESIOD_DIR);
-    sprintf(goutf, "%s/group.db", HESIOD_DIR);
-    sprintf(loutf, "%s/grplist.db", HESIOD_DIR);
+    sprintf(ioutf, "%s/gid.db", hesiod_dir);
+    sprintf(goutf, "%s/group.db", hesiod_dir);
+    sprintf(loutf, "%s/grplist.db", hesiod_dir);
 
     if (stat(ioutf, &isb) == 0 && stat(goutf, &gsb) == 0 && stat(loutf, &lsb) == 0) {
        ftime = min(isb.st_mtime, min(gsb.st_mtime, lsb.st_mtime));
@@ -385,7 +386,7 @@ do_filsys()
 ##  int flag1, flag2, flag3, flag4, id, fid;
     char *index();
 
-    sprintf(outf, "%s/filsys.db", HESIOD_DIR);
+    sprintf(outf, "%s/filsys.db", hesiod_dir);
 
     if (stat(outf, &sb) == 0) {
        ftime = sb.st_mtime;
@@ -538,7 +539,7 @@ do_cluster()
 ##  char name[33], label[17], data[33], *filetime;
     set_mask **machs, *ms, *ps;
 
-    sprintf(outf, "%s/cluster.db", HESIOD_DIR);
+    sprintf(outf, "%s/cluster.db", hesiod_dir);
 
     if (stat(outf, &sb) == 0) {
        ftime = sb.st_mtime;
@@ -658,7 +659,7 @@ do_printcap()
 ##  char name[17], rp[17], sd[33], rm[33], *filetime;
 ##  int flag;
 
-    sprintf(outf, "%s/printcap.db", HESIOD_DIR);
+    sprintf(outf, "%s/printcap.db", hesiod_dir);
 
     if (stat(outf, &sb) == 0) {
        ftime = sb.st_mtime;
@@ -709,7 +710,7 @@ do_palladium()
 ##  char name[33], rm[33], trans[129], *filetime;
 ##  int flag, flag1, ident;
 
-    sprintf(outf, "%s/palladium.db", HESIOD_DIR);
+    sprintf(outf, "%s/palladium.db", hesiod_dir);
 
     if (stat(outf, &sb) == 0) {
        ftime = sb.st_mtime;
@@ -768,7 +769,7 @@ do_sloc()
 ##  char service[17], *filetime;
 ##  int port, flag1, flag2, id;
 
-    sprintf(outf, "%s/sloc.db", HESIOD_DIR);
+    sprintf(outf, "%s/sloc.db", hesiod_dir);
 
     if (stat(outf, &sb) == 0) {
        ftime = sb.st_mtime;
@@ -819,7 +820,7 @@ do_service()
 ##  char mach[33], service[33], protocol[9], altserv[129], *filetime;
 ##  int port, flag1, flag2;
 
-    sprintf(outf, "%s/service.db", HESIOD_DIR);
+    sprintf(outf, "%s/service.db", hesiod_dir);
 
     if (stat(outf, &sb) == 0) {
        ftime = sb.st_mtime;
index 49a3ac879b33b1983a9108a473c44e3d6b78d6c4..94814efcaeaeaeaa037546fdc4d2e09037050841 100644 (file)
 #include <sys/stat.h>
 #include <sys/time.h>
 
-#undef NFS_DIR
-#define NFS_DIR        "/u1/sms/dcm/nfs"
 
 #define min(x,y)       ((x) < (y) ? (x) : (y))
 
 char *whoami = "nfs.gen";
 char *malloc(), *strsave();
 char *ingres_date_and_time(), *ingres_time(), *ingres_date();
+char nfs_dir[64];
 
 main(argc, argv)
 int argc;
@@ -40,6 +39,8 @@ char **argv;
 
     IIseterr(ingerr);
     initialize_sms_error_table();
+    sprintf(nfs_dir, "%s/nfs", DCM_DIR);
+
 ##  ingres sms
 ##  set lockmode session where level = table
 
@@ -54,7 +55,8 @@ char **argv;
     }
 
     if (argc == 2) {
-       sprintf(cmd, "cd %s; cp /u1/sms/nfs/* .; tar cf %s .", NFS_DIR, argv[1]);
+       sprintf(cmd, "cd %s; cp %s/nfs/* .; tar cf %s .",
+               nfs_dir, SMS_DIR, argv[1]);
        if (system(cmd))
          exit(SMS_TAR_FAIL);
     }
@@ -125,7 +127,7 @@ struct save_queue *lists;
 ##  char *listname, *lsname, lname[33], uname[9], *filetime;
 ##  int uid, id, flag1, flag2, flag3, flag4;
 
-    sprintf(file, "%s/list-", NFS_DIR);
+    sprintf(file, "%s/list-", nfs_dir);
     if (stat(file, &sb) == 0) {
        filetime = ingres_date_and_time(sb.st_mtime);
 ##     retrieve (flag1 = int4(interval("min", tblstats.modtime - filetime)))
@@ -161,7 +163,7 @@ struct save_queue *lists;
     while (sq_get_data(lists, &listname)) {
        if (strlen(listname) == 0)
          continue;
-       sprintf(file, "%s/list-%s", NFS_DIR, listname);
+       sprintf(file, "%s/list-%s", nfs_dir, listname);
        fd = fopen(file, "w");
        if (!fd) {
            fprintf(stderr, "cannot open %s for output\n", file);
@@ -211,7 +213,7 @@ struct hash *do_everyone()
     struct save_queue *sq;
 
     fprintf(stderr, "Building the list of everybody\n");
-    sprintf(buf, "%s/list-", NFS_DIR);
+    sprintf(buf, "%s/list-", nfs_dir);
     fd = fopen(buf, "w");
     if (!fd) {
        fprintf(stderr, "cannot open %s for output\n", buf);
@@ -324,7 +326,7 @@ struct save_queue *machs;
     struct save_queue *sq;
 
 /*
-    sprintf(file, "%s/list-", NFS_DIR);
+    sprintf(file, "%s/list-", nfs_dir);
     if (stat(file, &sb) == 0) {
        filetime = ingres_date_and_time(sb.st_mtime);
  #     retrieve (flag1 = int4(interval("min", tblstats.modtime - filetime)))
@@ -363,8 +365,8 @@ struct save_queue *machs;
 ##     repeat retrieve (listname = trim(s.value3))
 ##         where s.mach_id = m.mach_id and m.name = @machname
        strtrim(machname);
-       sprintf(f1, "%s/list-%s", NFS_DIR, listname);
-       sprintf(f2, "%s/%s.cred", NFS_DIR, machname);
+       sprintf(f1, "%s/list-%s", nfs_dir, listname);
+       sprintf(f2, "%s/%s.cred", nfs_dir, machname);
        unlink(f2); /* ignore errors on this unlink */
        if (link(f1, f2)) {
            fprintf(stderr, "Cannot link %s to %s\n", f1, f2);
@@ -379,7 +381,7 @@ struct save_queue *machs;
 ##         repeat retrieve (id = n.nfsphys_id) where n.mach_id = m.mach_id and
 ##             m.#name = @machname and n.#device = @device
            while (cp = index(device, '/')) *cp = '@';
-           sprintf(file, "%s/%s.%s.quotas", NFS_DIR, machname, device);
+           sprintf(file, "%s/%s.%s.quotas", nfs_dir, machname, device);
            fd = fopen(file, "w");
            if (!fd) {
                fprintf(stderr, "cannot open %s for output\n", file);
@@ -405,7 +407,7 @@ struct save_queue *machs;
                fprintf(stderr, "error closing %s", file);
                exit(SMS_CCONFIG);
            }
-           sprintf(file, "%s/%s.%s.dirs", NFS_DIR, machname, device);
+           sprintf(file, "%s/%s.%s.dirs", nfs_dir, machname, device);
            fd = fopen(file, "w");
            if (!fd) {
                fprintf(stderr, "cannot open %s for output\n", file);
index dc4524c4b4f01fb85959757e100413c69f59747d..b792ca5b29726460ccc348d7d75210d326c7972d 100644 (file)
@@ -366,7 +366,7 @@ int argc;
 
     for (c = cache; c; c = c->next) {
        if (!strcmp(c->table, argv[1])) {
-           sprintf(prog, "/u1/sms/bin/%s.incr", c->service);
+           sprintf(prog, "%s/%s.incr", BIN_DIR, c->service);
 #ifdef DEBUG
            com_err(whoami, 0, "forking %s", prog);
 #endif
index 517f8b09a01474df65f55b4a1ee866d7da330c60..f27247d1595729f2385a70f24eafcd725811437c 100644 (file)
@@ -185,14 +185,16 @@ trigger_dcm(dummy0, dummy1, cl)
        client *cl;
 {
        register int pid, status;
+       char prog[128];
        
        if (status = check_query_access(&pseudo_query, 0, cl))
            return(status);
 
+       sprintf(prog, "%s/startdcm", BIN_DIR);
        pid = vfork();
        switch (pid) {
        case 0:
-               execl("/u1/sms/bin/startdcm", "startdcm", 0);
+               execl(prog, "startdcm", 0);
                exit(1);
                
        case -1:
index 6c1b018dd942191decd3f56586163b3cc956adbe..4a9c2ceda76dd729fab5230d667f2fadb380952d 100644 (file)
@@ -45,7 +45,6 @@ extern char buf1[BUFSIZ];
 extern char *takedown;
 extern int errno;
 extern FILE *journal;
-#define JOURNAL "/u1/sms/journal"
 
 extern char *malloc();
 extern int free();
index 574ced8ec272526b9ba72103f1bd9b711dd7d23b..155e6b2db9722f67a7ae5f1ced6bb1daa9b7995e 100644 (file)
@@ -310,18 +310,20 @@ trigger_dcm(dummy0, dummy1, cl)
        client *cl;
 {
        register int pid;
-       
+       char prog[128];
+
        cl->reply.sms_argc = 0;
 
        if (cl->reply.sms_status = check_query_access(&pseudo_query, 0, cl) )
                return(cl->reply.sms_status);
 
+       sprintf(prog, "%s/startdcm", BIN_DIR);
        pid = vfork();
        switch (pid) {
        case 0:
                for (dummy0 = getdtablesize() - 1; dummy0 > 2; dummy0--)
                  close(dummy0);
-               execl("/u1/sms/bin/startdcm", "startdcm", 0);
+               execl(prog, "startdcm", 0);
                exit(1);
                
        case -1:
index d1f3470f53f2284a93d5dacf5aff088db5b3dc77..def211c4815ec53d5e32c11fe6a45db4c8b12c18 100644 (file)
@@ -12,6 +12,7 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include "sms_proto.h"
+#include <sms_app.h>
 #include <krb.h>
 
 typedef struct returned_tuples {
@@ -99,5 +100,3 @@ extern int newqueries, oldqueries;
 #define GROGGY 3
 extern int dormant;
 
-/* If the motd file exists, the server will go to sleep. */
-#define SMS_MOTD_FILE "/etc/smsdown"
This page took 0.063762 seconds and 5 git commands to generate.