Permalink
Browse files

Perform a late term abortion on diodctl.

As diodctl is no longer needed for release 1.0, it is removed.

The init script now starts 'diod' and the service is called diod not diodctl.

The config file 'diodctllisten' and 'diodlisten' variables are replaced
with 'listen'.

misc/t12, the sometimes failing valgrind test on npfile, is now gone.

Diod no longer has a -F option.

Diodmount no longer has a 'jobid' option, and it no longer has to
talk to diodctl of course.

The libnpfs srv_wait_timeout() and srv_shutdown() calls go away.

Upsides:
- Diodctl had no test coverage
- Npfile similarly had no coverage, and diodctl was the only user
- Kludgey method of testing whether a diod server had started
- Increased mount latency by requiring more protocol to be spoken
- Overall simplification of diod deployment.

Downsides:
- Not possible to start private servers on demand (for jobs or for users).
  Perhaps this can be addressed in the future through creative thread pool
  management within the single diod instance.
- Automounter integration is slightly less efficient in some error cases
  as described in a previous commit.
  • Loading branch information...
1 parent 94bdad7 commit b921b4a6063817a9697d31b08cff73327f0d4280 @garlick garlick committed May 4, 2011
View
@@ -6,7 +6,6 @@ SUBDIRS = \
diod \
utils \
scripts \
- diodctl \
etc \
tests
View
@@ -75,15 +75,13 @@ AC_CONFIG_FILES( \
libnpfs/Makefile \
libnpclient/Makefile \
diod/diod.8 \
- diodctl/diodctl.8 \
utils/diodmount.8 \
utils/diodcat.8 \
etc/diod.conf.5 \
scripts/Makefile \
- scripts/diodctl.init \
+ scripts/diod.init \
scripts/auto.diod \
diod/Makefile \
- diodctl/Makefile \
utils/Makefile \
tests/Makefile \
tests/misc/Makefile \
View
@@ -45,12 +45,12 @@ mv $RPM_BUILD_ROOT%{_mandir}/man8/diodmount.8 \
rm -rf ${RPM_BUILD_ROOT}
%post
-if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --add diodctl; fi
+if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --add diod; fi
%preun
if [ "$1" = 0 ]; then
- %{_sysconfdir}/init.d/diodctl stop >/dev/null 2>&1 || :
- if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --del diodctl; fi
+ %{_sysconfdir}/init.d/diod stop >/dev/null 2>&1 || :
+ if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --del diod; fi
fi
%files
@@ -60,6 +60,6 @@ fi
/sbin/*
%{_mandir}/man8/*
%{_mandir}/man5/*
-%attr(0755,root,root) %{_sysconfdir}/init.d/diodctl
+%attr(0755,root,root) %{_sysconfdir}/init.d/diod
%config(noreplace) %attr(0755,root,root) %{_sysconfdir}/auto.diod
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/diod.conf
View
@@ -28,12 +28,7 @@ This option is mainly used in testing.
.I "-l, --listen IP:PORT"
Set the listen address (default 0.0.0.0:564).
This option may be specified more than once.
-It overrides the \fIdiodlisten\fR config file setting.
-.TP
-.I "-F, --diodctl N"
-Listen for connection on file descriptors 3 through N+3.
-This is the mechanism that \fBdiodctl\fR uses to pass dynamically
-allocated sockets, possibly on multiple interfaces, to \fBdiod\fR.
+It overrides the \fIlisten\fR config file setting.
.TP
.I "-w, --nwthreads INT"
Set the number of worker threads to spawn to handle 9P operations.
@@ -85,4 +80,4 @@ Set config file path.
.br
@X_SYSCONFDIR@/diod.conf
.SH "SEE ALSO"
-diodctl (8), diod.conf (5), mount.diod (8), hosts_access (5)
+diod.conf (5), mount.diod (8), hosts_access (5)
View
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (C) 2010 Lawrence Livermore National Security, LLC.
+ * Copyright (C) 2010-11 Lawrence Livermore National Security, LLC.
* Written by Jim Garlick <garlick@llnl.gov> LLNL-CODE-423279
* All Rights Reserved.
*
@@ -61,18 +61,18 @@
#include "ops.h"
-typedef enum { SRV_STDIN, SRV_DIODCTL, SRV_NORMAL } srvmode_t;
+typedef enum { SRV_STDIN, SRV_NORMAL } srvmode_t;
static void _daemonize (void);
static void _setrlimit (void);
static void _become_user (char *name, uid_t uid, int realtoo);
-static void _service_run (srvmode_t mode, int Fopt);
+static void _service_run (srvmode_t mode);
#ifndef NR_OPEN
#define NR_OPEN 1048576 /* works on RHEL 5 x86_64 arch */
#endif
-#define OPTIONS "fsd:l:w:e:EF:u:SL:nc:"
+#define OPTIONS "fsd:l:w:e:Eu:SL:nc:"
#if HAVE_GETOPT_LONG
#define GETOPT(ac,av,opt,lopt) getopt_long (ac,av,opt,lopt,NULL)
@@ -85,7 +85,6 @@ static const struct option longopts[] = {
{"export", required_argument, 0, 'e'},
{"export-all", no_argument, 0, 'E'},
{"no-auth", no_argument, 0, 'n'},
- {"diodctl", required_argument, 0, 'F'},
{"runas-uid", required_argument, 0, 'u'},
{"allsquash", no_argument, 0, 'S'},
{"logdest", required_argument, 0, 'L'},
@@ -104,7 +103,6 @@ usage()
" -f,--foreground do not fork and disassociate with tty\n"
" -s,--stdin service connected client on stdin\n"
" -l,--listen IP:PORT set interface to listen on (multiple -l allowed)\n"
-" -F,--diodctl N listen for connections on the first N fds\n"
" -w,--nwthreads INT set number of I/O worker threads to spawn\n"
" -e,--export PATH export PATH (multiple -e allowed)\n"
" -E,--export-all export all mounted file systems\n"
@@ -122,7 +120,6 @@ int
main(int argc, char **argv)
{
int c;
- int Fopt = 0;
char *copt = NULL;
srvmode_t mode = SRV_NORMAL;
@@ -158,11 +155,11 @@ main(int argc, char **argv)
diod_conf_set_debuglevel (strtoul (optarg, NULL, 0));
break;
case 'l': /* --listen HOST:PORT */
- if (!diod_conf_opt_diodlisten ())
- diod_conf_clr_diodlisten ();
+ if (!diod_conf_opt_listen ())
+ diod_conf_clr_listen ();
if (!strchr (optarg, ':'))
usage ();
- diod_conf_add_diodlisten (optarg);
+ diod_conf_add_listen (optarg);
break;
case 'w': /* --nwthreads INT */
diod_conf_set_nwthreads (strtoul (optarg, NULL, 10));
@@ -183,10 +180,6 @@ main(int argc, char **argv)
case 'S': /* --allsquash */
diod_conf_set_allsquash (1);
break;
- case 'F': /* --diodctl N */
- Fopt = strtoul (optarg, NULL, 10);
- mode = SRV_DIODCTL;
- break;
case 'u': /* --runas-uid UID */
if (geteuid () == 0) {
uid_t uid;
@@ -232,7 +225,7 @@ main(int argc, char **argv)
_become_user (NULL, uid, 1);
}
- _service_run (mode, Fopt);
+ _service_run (mode);
diod_conf_fini ();
diod_log_fini ();
@@ -412,7 +405,6 @@ _service_loop (void *arg)
}
}
}
- np_srv_shutdown (ss.srv);
return NULL;
}
@@ -444,9 +436,9 @@ _service_sigsetup (void)
}
static void
-_service_run (srvmode_t mode, int Fopt)
+_service_run (srvmode_t mode)
{
- List l = diod_conf_get_diodlisten ();
+ List l = diod_conf_get_listen ();
int nwthreads = diod_conf_get_nwthreads ();
int flags = diod_conf_get_debuglevel ();
int n;
@@ -460,12 +452,8 @@ _service_run (srvmode_t mode, int Fopt)
switch (mode) {
case SRV_STDIN:
break;
- case SRV_DIODCTL:
- if (!diod_sock_listen_nfds (&ss.fds, &ss.nfds, Fopt, 3))
- msg_exit ("failed to set up listen ports");
- break;
case SRV_NORMAL:
- if (!diod_sock_listen_hostports (l, &ss.fds, &ss.nfds, NULL, 0))
+ if (!diod_sock_listen_hostports (l, &ss.fds, &ss.nfds, NULL))
msg_exit ("failed to set up listen ports");
break;
}
@@ -490,10 +478,6 @@ _service_run (srvmode_t mode, int Fopt)
np_srv_wait_conncount (ss.srv, 1);
pthread_kill (ss.t, SIGUSR1);
break;
- case SRV_DIODCTL:
- np_srv_wait_timeout (ss.srv, 30);
- pthread_kill (ss.t, SIGUSR1);
- break;
case SRV_NORMAL:
break;
}
View
@@ -1,23 +0,0 @@
-AM_CFLAGS = @GCCWARN@
-
-AM_CPPFLAGS = \
- -I../libnpfs -I../liblsd -I../libdiod
-
-sbin_PROGRAMS = diodctl
-
-diodctl_LDADD = \
- $(top_builddir)/libdiod/libdiod.a \
- $(top_builddir)/libnpclient/libnpclient.a \
- $(top_builddir)/libnpfs/libnpfs.a \
- $(top_builddir)/liblsd/liblsd.a \
- $(LIBWRAP) $(LIBPTHREAD) $(LIBLUA) $(LIBMUNGE)
-
-diodctl_SOURCES = \
- diodctl.c \
- ops.c \
- ops.h \
- serv.c \
- serv.h
-
-man8_MANS = \
- diodctl.8
Oops, something went wrong.

0 comments on commit b921b4a

Please sign in to comment.