aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-01-26 00:05:58 +0200
committerSergey Poznyakoff <gray@gnu.org>2020-01-26 00:05:58 +0200
commit89b8439fc83ad8769b379e4a87ea35678ea57e7e (patch)
tree363bd2dcb05f0852f8d58d945c84b73c5bd613e4
parent0cabe8d21e74d48317298ecb146b9e37f86267ad (diff)
downloadjumper-89b8439fc83ad8769b379e4a87ea35678ea57e7e.tar.gz
jumper-89b8439fc83ad8769b379e4a87ea35678ea57e7e.tar.bz2
Bugfix
* doc/jumper.8in: Document missing values * src/progman.c (progman_decommission): Call progman_cleanup on each iteration.
-rw-r--r--doc/jumper.8in20
-rw-r--r--src/progman.c5
2 files changed, 16 insertions, 9 deletions
diff --git a/doc/jumper.8in b/doc/jumper.8in
index 00fdfc5..77c8cdc 100644
--- a/doc/jumper.8in
+++ b/doc/jumper.8in
@@ -11,13 +11,13 @@
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with Jumper. If not, see <http://www.gnu.org/licenses/>.
.so config.so
-.TH JUMPER 8 "December 9, 2013" "JUMPER"
+.TH JUMPER 8 "January 25, 2020" "JUMPER"
.SH NAME
jumper \- bring up network links on demand
.SH SYNOPSIS
\fBjumper\fR [\fB\-Edf\fR] [\fB\-P\fR \fIFILE\fR] [\fB\-l\fR \fIPRIO\fR]\
[\fB\-D\fR \fISYMBOL\fR[\fB=\fIVALUE\fR]]\
[\fB\-I\fR \fIDIR\fR]
@@ -509,17 +509,20 @@ Program version.
.B JUMPER_LOCUS
Location in the configuration file which caused execution of the
command (file name and line number separated with a colon).
.TP
.B JUMPER_EVENT
Name of the event that triggered the action; one of:
-.BR startup ,
.BR cleanup ,
.BR exit ,
-or
-.BR signal .
+.BR heartbeat ,
+.BR signal ,
+.BR startup .
+.BR
+.B JUMPER_PID
+PID of the running network management process.
.RE
.IP
The \fBenviron\fR statement allows for trimming the environment. Its
argument is a list of one or more of the following environment modification
directives. Before applying, the argument undergoes macro expansion
using the same set of macros as the \fBcommand\fR statement (which see).
@@ -644,26 +647,29 @@ located.
.TP
.B line
Line number in that file.
.TP
.B event
Name of the event that triggered the action; one of:
-.BR startup ,
.BR cleanup ,
.BR exit ,
-or
-.BR signal .
+.BR heartbeat ,
+.BR signal ,
+.BR startup .
.TP
.B status
Program termination status as returned by the
.BR waitpid (2)
call.
.TP
.B exitcode
Exit code returned by the program, or the number of the signal that
caused its termination.
+.TP
+.B pid
+PID of the listener network management process.
.RE
.TP
\fBenviron\fR \fIENV\-SPEC\fR;
Modify command environment. See the description of the \fBenviron\fR
statement above, for a detailed discussion.
.TP
diff --git a/src/progman.c b/src/progman.c
index 1963676..ef5c73d 100644
--- a/src/progman.c
+++ b/src/progman.c
@@ -311,13 +311,13 @@ progman_cleanup(void)
}
/* Terminate all running processes, first with SIGTERM and, if any of them
are still running SHUTDOWN_TIMEOUT seconds after that, with SIGKILL.
*/
void
-progman_terminate()
+progman_terminate(void)
{
struct process *p;
time_t start;
if (proc_count == 0)
return;
@@ -341,13 +341,13 @@ progman_terminate()
listener_proc_report();
sleep(1);
}
}
void
-progman_decommission()
+progman_decommission(void)
{
struct process *p;
time_t start;
size_t count = 0;
if (proc_count == 0)
@@ -368,12 +368,13 @@ progman_decommission()
diag(LOG_NOTICE,
"sending running processes the KILL signal");
for (p = proc_list; p; p = p->next)
if (p->lp->decommission)
kill(p->pid, SIGKILL);
}
+ progman_cleanup();
listener_proc_report();
sleep(1);
count = 0;
for (p = proc_list; p; p = p->next)
if (p->lp->decommission && p->lp->status != stat_down)
++count;

Return to:

Send suggestions and report system problems to the System administrator.