chiark / gitweb /
Option for setting realsockdir
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Fri, 30 Apr 2010 23:01:34 +0000 (00:01 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Fri, 30 Apr 2010 23:01:34 +0000 (00:01 +0100)
backends/innduct.c
doc/man/innduct.8

index 36eeda82a7b820395bbbaeb60019e654ef06658a..3225a897963bf40cbc4ba84441f26c8b2d0cfef1 100644 (file)
@@ -2,7 +2,6 @@
  * todo
  *  - inotify not working ?
  *  - some per-conn info thing for control
- *  - option for realsockdir
  *  - manpage: document control master stuff
  *
  * debugging rune:
@@ -950,7 +949,7 @@ static void control_init(void) {
       uid_t self= geteuid();
       if (!S_ISDIR(stab.st_mode) ||
          stab.st_uid != self ||
-         stab.st_mode & 0077) {
+         stab.st_mode & 0007) {
        warn("no control socket, because real socket directory"
             " is somehow wrong (ISDIR=%d, uid=%lu (exp.%lu), mode %lo)",
             !!S_ISDIR(stab.st_mode),
@@ -3105,6 +3104,7 @@ static const Option innduct_options[]= {
 {0,"no-filemon",         0,       &try_filemon,              op_setint, 0   },
 {'C',"inndconf",         "F",     &inndconffile,             op_string      },
 {'P',"port",             "PORT",  &port,                     op_integer     },
+{0,"ctrl-sock-dir",      0,       &realsockdir,              op_string      },
 {0,"help",               0,       0,                         help           },
 
 {0,"max-connections",    "N",     &max_connections,          op_integer     },
index 64fd7bb71b8704c44df9cdd8d1e90b3a875ccf57..83aeade401744181d29a9495eeb86a6130e5d224 100644 (file)
@@ -106,6 +106,26 @@ Read
 instead of the default
 .BR inn.conf .
 .TP
+.BI \-\-ctrl-sock-dir= DIR
+Bind the real control socket to a unique filename in
+.IR DIR .
+A symlink will be made pointing to the actual file used, named
+.IB feedfile _control
+in the same directory as
+.IR feedfile ,
+but since
+.IR feedfile 's
+path may be too long for an AF_UNIX socket path, innduct always
+creates the sockets in this dedicated directory which is expected to
+have a short path.  If
+.I DIR
+does not exist it will be created with mode 0700; if it does
+exist it must not be a symlink and must be owned by the user running
+innduct and have no access for "other".  If the control socket cannot
+be set up (for this or any other reason), a warning is logged, but
+such situations are not fatal for innduct's startup.  The default is
+.BR /tmp/innduct.control .
+.TP
 .BI \-\-port= PORT
 Connect to port
 .I PORT