Commit Diff
Diff:
dce6f753177387a7bd70c645e7faea44d7101909
cd323c77965e29919b401f5120c1add24b7c3094
Commit:
cd323c77965e29919b401f5120c1add24b7c3094
Tree:
0716d8c6c2c24c05108e24c4aac6c3b5756d1ac8
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Thu Dec 19 15:35:13 2019 UTC
Message:
Linux has a bug with setproctitle(), I followed the manual page. So until Linux fixes it, give an optional flag to ./configure called --without-setproctitle which will not set the title on the master process, one can still read off what the master is becuase it's the only process that is root-owned. Tested on OpenBSD, but it should work on Linux, I'll test it on Linux tomorrow, and I would suggest Linux people use this flag or get a staircasing process title.
blob - 1ccebe5aa279e8b2bb6b35747797e667033196ed
blob + be2f6a83701884cb3a07a56e912fb65d4180ee74
--- configure
+++ configure
@@ -11,10 +11,6 @@ echo "/* ddd-config.h - autogenerated by configure */"
until [ -z $1 ]
do
case $1 in
- --user=*)
- user=`echo $1 | sed -e 's/--user=//g'`
- echo "#define DEFAULT_PRIVILEGE \"$user\"" >> ddd-config.h
- ;;
--location=*)
location=`echo $1 | sed -e 's/--location=//g'`
echo "#define DEFAULT_LOCATION \"$location\"" >> ddd-config.h
@@ -22,8 +18,15 @@ do
echo "#define DEFAULT_RZONE_DIR \"${location}/replicant\"" >> ddd-config.h
;;
+ --user=*)
+ user=`echo $1 | sed -e 's/--user=//g'`
+ echo "#define DEFAULT_PRIVILEGE \"$user\"" >> ddd-config.h
+ ;;
+ --without-setproctitle)
+ echo "#define NO_SETPROCTITLE 1" >> ddd-config.h
+ ;;
*)
- echo "usage: configure [--needpledge] [--user=USERNAME]"
+ echo "usage: configure [--user=USERNAME] [--without-setproctitle] [--location=LOCATION]"
exit
;;
esac
blob - 7e8141cf9f6d8377f3f6344fca907f1d50d74abd
blob + b5bbf27a908df129089c0fec4822ea76aae71802
--- delphinusdnsd.c
+++ delphinusdnsd.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: delphinusdnsd.c,v 1.93 2019/12/18 13:15:15 pjp Exp $
+ * $Id: delphinusdnsd.c,v 1.94 2019/12/19 15:35:13 pjp Exp $
*/
@@ -329,9 +329,12 @@ main(int argc, char *argv[], char *environ[])
}
av = argv;
+
+#ifndef NO_SETPROCTITLE
#if __linux__
setproctitle_init(argc, av, environ);
#endif
+#endif
while ((ch = getopt(argc, argv, "b:df:i:ln:p:s:v")) != -1) {
@@ -2202,7 +2205,9 @@ setup_master(ddDB *db, char **av, char *socketpath, st
}
#endif
+#ifndef NO_SETPROCTITLE
setproctitle("master");
+#endif
pid = getpid();
@@ -2254,8 +2259,10 @@ setup_master(ddDB *db, char **av, char *socketpath, st
dolog(LOG_INFO, "restarting on SIGHUP or command\n");
closelog();
+#ifndef NO_SETPROCTITLE
#if __linux__
setproctitle(NULL);
+#endif
#endif
if (execvp("/usr/local/sbin/delphinusdnsd", av) < 0) {
dolog(LOG_ERR, "execvp: %s\n", strerror(errno));
repomaster@centroid.eu