chiark / gitweb /
Changed description.
[userv.git] / daemon.h
index 7b06bf7b77a6e6f3cc1c8a609059c7c433352623..945d651d29463b27b2f7503e92500fc27df27291 100644 (file)
--- a/daemon.h
+++ b/daemon.h
@@ -65,8 +65,8 @@
 #define EMPTYINCLUDELOOKUP          ":empty"
 
 #define USERCONFIGDIRBASE           SYSTEMUSERVCONFIGDIR
-#define USERCONFIGDIR               HIDDENPREFIX USERCONFIGDIRBASE
-#define USERUSERVCONFIGPATH         USERDIR "/" USERCONFIGDIR
+#define USERCONFIGDIR               "." USERCONFIGDIRBASE
+#define USERUSERVCONFIGPATH         "~/" USERCONFIGDIR
 #define USERRCFILEPATH              USERUSERVCONFIGPATH "/" USERRCFILE
 #define SYSTEMUSERVCONFIGPATH       SYSTEMCONFIGDIR "/" SYSTEMUSERVCONFIGDIR
 #define SYSTEMRCFILEDEFAULTPATH     SYSTEMUSERVCONFIGPATH "/" SYSTEMRCFILEDEFAULT
 #define SHELLLISTPATH               SYSTEMCONFIGDIR "/" SHELLLIST
 #define SETENVIRONMENTPATH          SYSTEMCONFIGDIR "/" SETENVIRONMENT
 
-#define USERDIR                     "~"
-#define HIDDENPREFIX                "."
-
 #define USERVD_LOGIDENT "uservd"
+#define USERVDCHECK_LOGIDENT "uservd/check"
 #define USERVD_LOGFACILITY LOG_DAEMON
-#define DEFUSERLOGFACILITY LOG_DAEMON
+#define DEFUSERLOGFACILITY LOG_USER
 #define DEFUSERLOGLEVEL LOG_ERR
 
 #define TOPLEVEL_CONFIGURATION "                   \n\
   quit                                             \n\
 "
 
+#define USERVD_MYSELF_CHECK 3600
+#define USERVD_MYSELF_TIMEOUT 60
+#define USERVD_CHECKFORK_RETRY 60
 #define MAX_INCLUDE_NEST 40
-#define MAX_ERRMSG_LEN 2048
+#define MAX_ERRMSG_LEN (MAX_ERRMSG_STRING-1024)
 #define ERRMSG_RESERVE_ERRNO 128
 
 int parse_string(const char *string, const char *descrip, int isinternal);
@@ -138,16 +139,17 @@ int synchread(int fd, int ch);
 const char *defaultpath(void);
 
 struct fdstate {
-  int iswrite, realfd, holdfd;
+  int iswrite; /* 0 or 1; -1 if not open */
+  int realfd, holdfd; /* -1 if not open */
   int wantstate;
   /* tokv_word_requirefd, tokv_word_allowfd, tokv_nullfd, tokv_word_rejectfd
    * (all of which have tokt_wantfdstate set) */
-  int wantrw;
-  /* tokv_word_read, tokv_word_write */
+  int wantrw; /* tokv_word_read, tokv_word_write, 0 for either/both */
 };
 
 struct keyvaluepair { char *key, *value; };
 
+extern pid_t overlordpid;
 extern struct request_msg request_mbuf;
 extern struct keyvaluepair *defvararray;
 extern struct fdstate *fdarray; /* indexed by nominal fd */