summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--NEWS53
-rw-r--r--configure.ac4
m---------grecs0
-rw-r--r--src/com_start.c4
-rw-r--r--src/genrc.875
-rw-r--r--src/genrc.c176
-rw-r--r--src/genrc.h2
-rw-r--r--src/sentinel.c4
8 files changed, 302 insertions, 16 deletions
diff --git a/NEWS b/NEWS
index 57d7295..98e673e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,12 +1,59 @@
-genrc NEWS -- history of user-visible changes. 2018-05-20
-Copyright (C) 2018 Sergey Poznyakoff
+genrc NEWS -- history of user-visible changes. 2020-09-09
See the end of file for copying conditions.
Please send genrc bug reports to <gray@gnu.org> or <gray@gnu.org.ua>
+Version 1.2, 2020-09-09
+
+* Verbose diagnostics
+
+Verbose diagnostics is enabled by the -v,--verbose option.
+
+* Shell selection
+
+By default, the program is started using "/bin/sh -c". Two options
+are provided to alter this behavior:
+
+ -s, --shell=SHELL
+ Use SHELL to start the program. Default is /bin/sh.
+
+ -e, --exec
+ In sentinel mode, run the command directly via exec(3), instead
+ of via the shell.
+
+* Syslog
+
+In sentinel mode, the syslog facility and tag can be changed:
+
+ --log-facility=F
+ Use syslog facility F instead of the default "daemon".
+ (equivalent environment variable - GENRC_LOG_FACILITY)
+
+ --log-tag=S
+ Use syslog tag S instead of the program name.
+ (equivalent environment variable - GENRC_LOG_TAG)
+
+* Runtime resource limits
+
+The --limit (-l) option is provided to control the resource usage.
+Its argument is a resource designator followed by the limit value
+for that resource. Resource designators are:
+
+ c Core file size (KB).
+ d Data size (KB).
+ f File size (KB).
+ l Locked-in-memory address space (KB).
+ m Resident set size (KB).
+ n Number of open files.
+ p Process priority (nice value), -20..20.
+ s Stack size (KB).
+ t CPU time (seconds).
+ u Number of subprocesses.
+ v Virtual memory size (KB).
+
Version 1.1, 2018-05-20
Implements restart mode.
The restart mode is a special feature of sentinel mode, controlled by
the new options --restart-on-exit and --restart-on-signal. In this
@@ -31,13 +78,13 @@ Version 1.0, 2018-05-15
Initial release
=========================================================================
Copyright information:
-Copyright (C) 2018 Sergey Poznyakoff
+Copyright (C) 2018-2020 Sergey Poznyakoff
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
copyright notice and this permission notice are preserved,
thus giving the recipient permission to redistribute in turn.
diff --git a/configure.ac b/configure.ac
index 2610762..35b5964 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,8 @@
# This file is part of genrc. -*- Autoconf -*-
-# Copyright (C) 2018 Sergey Poznyakoff.
+# Copyright (C) 2018-2020 Sergey Poznyakoff.
#
# Genrc is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
@@ -12,13 +12,13 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with genrc. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.69])
-AC_INIT([genrc], [1.1], [gray@gnu.org])
+AC_INIT([genrc], [1.2], [gray@gnu.org])
AC_CONFIG_SRCDIR([src/genrc.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.11 foreign silent-rules])
AC_CONFIG_MACRO_DIR(grecs/am)
# Enable silent rules by default
diff --git a/grecs b/grecs
-Subproject b06fb7d30415eec1d2efb39286ab96070c724fd
+Subproject 893d875a4065acb757fef55876c391b1dd07004
diff --git a/src/com_start.c b/src/com_start.c
index 17581cb..5ad1786 100644
--- a/src/com_start.c
+++ b/src/com_start.c
@@ -1,8 +1,8 @@
/* This file is part of genrc
-Copyryght (C) 2018, 2019 Sergey Poznyakoff
+Copyryght (C) 2018-2020 Sergey Poznyakoff
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
#include "genrc.h"
#include <syslog.h>
@@ -124,13 +124,13 @@ spawn(int *p)
close(i);
}
execvp(argv[0], argv);
if (p) {
- openlog(genrc_program, LOG_PID, LOG_DAEMON);
+ genrc_openlog();
syslog(LOG_CRIT, "failed to exec: %m");
} else
system_error(errno, "failed to exec %s", genrc_program);
exit(127);
}
diff --git a/src/genrc.8 b/src/genrc.8
index 0fdfa54..c4715da 100644
--- a/src/genrc.8
+++ b/src/genrc.8
@@ -1,8 +1,8 @@
.\" This file is part of genrc.
-.\" Copyright (C) 2018, 2019 Sergey Poznyakoff.
+.\" Copyright (C) 2018-2020 Sergey Poznyakoff.
.\"
.\" Genrc is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 3, or (at your option)
.\" any later version.
.\"
@@ -10,33 +10,37 @@
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" 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 genrc. If not, see <http://www.gnu.org/licenses/>.
-.TH GENRC 8 "September 13, 2019" "GENRC" "Genrc User Manual"
+.TH GENRC 8 "September 9, 2020" "GENRC" "Genrc User Manual"
.SH NAME
genrc \- generic system initialization script helper
.SH SYNOPSIS
.nh
.na
\fBgenrc\fR\
[\fB\-hev\fR]\
[\fB\-F\fR \fIPIDFILE\fR]\
[\fB\-P\fR \fISOURCE\fR]\
[\fB\-c\fR \fICOMMAND\fR]\
[\fB\-g\fR \fIGROUP\fR[,\fIGROUP\fR...]]\
+ [\fB\-l\fR \fILIMIT\fR]\
[\fB\-p\fR \fIPROGRAM\fR]\
[\fB\-s\fR \fISHELL\fR]\
[\fB\-t\fR \fISECONDS\fR]\
[\fB\-u\fR \fIUSER\fR]\
[\fB\-\-command=\fICOMMAND\fR]\
[\fB\-\-create\-pidfile=\fIPIDFILE\fR]\
[\fB\-\-exec\fR]\
[\fB\-\-group=\fIGROUP\fR[,\fIGROUP\fR...]]\
[\fB\-\-help\fR]\
+ [\fB\-\-log\-facility=\fIFACILITY\fR]\
+ [\fB\-\-log\-tag=\fITAG\fR]\
+ [\fB\-\-limit=\fILIMIT\fR]\
[\fB\-\-no\-reload\fR]\
[\fB\-\-pid\-from=\fISOURCE\fR]\
[\fB\-\-pidfile=\fIPIDFILE\fR]\
[\fB\-\-program=\fIPROGRAM\fR]\
[\fB\-\-restart\-on\-exit=\fR[\fB!\fR]\fISTATUS\fR[\fB,\fISTATUS\fR...]]\
[\fB\-\-restart\-on\-signal=\fR[\fB!\fR]\fISIG\fR[\fB,\fISIG\fR...]]\
@@ -209,12 +213,72 @@ list of groups, the first group becomes the principal, and the
rest of them supplementary groups. Each \fIGROUP\fR is either a group
name or a numeric group number prefixed with a plus sign. Whatever
notation is used, the groups must exist in the system group database.
See also the \fB\-\-user\fR option.
.TP
+\fB\-l\fR, \fB\-\-limit=\fILIM\fR
+Set resource limit. \fILIM\fR is a resource letter followed by
+a value. Resource letters are:
+.RS
+.TP
+.B c
+Core file size (KB).
+.TP
+.B d
+Data size (KB).
+.TP
+.B f
+File size (KB).
+.TP
+.B l
+Locked-in-memory address space (KB).
+.TP
+.B m
+Resident set size (KB).
+.TP
+.B n
+Number of open files.
+.TP
+.B p
+Process priority (nice value), -20..20.
+.TP
+.B s
+Stack size (KB).
+.TP
+.B t
+CPU time (seconds).
+.TP
+.B u
+Number of subprocesses.
+.TP
+.B v
+Virtual memory size (KB).
+.RE
+.TP
+.TP
+\fB\-\-log\-facility=\fIFACILITY\fR
+Selects \fBsyslog\fR facility for use in sentinel mode. Valid arguments are
+.BR auth ,
+.BR authpriv ,
+.BR cron ,
+.BR daemon ,
+.BR ftp ,
+.BR lpr ,
+.BR mail ,
+.BR user ,
+and
+.BR local0
+through
+.BR local7 .
+The default is
+.BR daemon .
+.TP
+\fB\-\-log\-tag=\fITAG\fR
+Sets \fBsyslog\fR tag for use in sentinel mode.
+.TP
\fB\-\-no\-reload\fR
Makes \fBreload\fR equivalent to \fBrestart\fR.
.TP
\fB\-p\fR, \fB\-\-program=\fIPROGRAM\fR
Name of the program to run.
.TP
@@ -247,12 +311,15 @@ restart the program unless it terminates on one of the listed signals.
\fB\-\-sentinel\fR
\fIPROGRAM\fR runs in foreground; disconnect from the controlling
terminal, start it and run in background until it terminates. The
program's stdout and stderr are sent to the syslog facility
\fBdaemon\fR, priorities \fBinfo\fR and \fBerr\fR, correspondingly.
+The default facility and syslog tag can be changed using the
+\fB\-\-log\-facility\fR and \fB\-\-log-tag\fR options.
+
See the options \fB\-\-restart\-on\-exit\fR and
\fB\-\-restart\-on\-signal\fR for details on how to restart the
program.
.TP
\fB\-s\fR, \fB\-\-shell=\fISHELL\fR
In sentinel mode, use \fISHELL\fR to run the command, instead of the
@@ -373,19 +440,21 @@ Influential environment variables and corresponding options:
\fBGENRC_PID_FROM=\fISOURCE\fR \fB\-\-pid\-from=\fISOURCE\fR
\fBGENRC_TIMEOUT=\fISECONDS\fR \fB\-\-timeout=\fISECONDS\fR
\fBGENRC_SENTINEL=1\fR \fB\-\-sentinel\fR
\fBGENRC_CREATE_PIDFILE=\fINAME\fR \fB\-\-create\-pidfile=\fINAME\fR
\fBGENRC_USER=\fINAME\fR \fB\-\-user=\fINAME\fR
\fBGENRC_GROUP=\fIGROUPS\fR \fB\-\-group=\fIGROUPS\fR
+ \fBGENRC_LOG_FACILITY=\fIF\fR \fB\-\-log\-facility=\fIF\fR
+ \fBGENRC_LOG_TAG=\fISTR\fR \fB\-\-log\-tag=\fISTR\fR
.fi
.SH AUTHORS
Sergey Poznyakoff
.SH "BUG REPORTS"
Report bugs to <gray@gnu.org>.
.SH COPYRIGHT
-Copyright \(co 2018, 2019 Sergey Poznyakoff
+Copyright \(co 2018 -- 2020 Sergey Poznyakoff
.br
.na
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br
.ad
This is free software: you are free to change and redistribute it.
diff --git a/src/genrc.c b/src/genrc.c
index 3dccbda..868dfb0 100644
--- a/src/genrc.c
+++ b/src/genrc.c
@@ -1,37 +1,42 @@
/* This file is part of genrc
-Copyryght (C) 2018, 2019 Sergey Poznyakoff
+Copyryght (C) 2018-2020 Sergey Poznyakoff
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
#include "genrc.h"
+#include <syslog.h>
#include <sys/ioctl.h>
+#include <sys/resource.h>
char *genrc_command;
char *genrc_program;
char *genrc_pid_from;
unsigned genrc_timeout = 5;
int genrc_no_reload;
int genrc_signal_stop = SIGTERM;
int genrc_signal_reload = SIGHUP;
GENRC_PID_CLOSURE *genrc_pid_closure;
char *genrc_create_pidfile;
int genrc_verbose;
char *genrc_shell = SHELL;
-
+int genrc_log_facility = LOG_DAEMON;
+char *genrc_log_tag = NULL;
enum {
OPT_USAGE = 256,
OPT_VERSION,
OPT_SIGNAL_RELOAD,
OPT_NO_RELOAD,
OPT_SIGNAL_STOP,
OPT_CREATE_PIDFILE,
OPT_RESTART_ON_EXIT,
OPT_RESTART_ON_SIGNAL,
+ OPT_LOG_FACILITY,
+ OPT_LOG_TAG
};
struct option longopts[] = {
{ "help", no_argument, 0, 'h' },
{ "usage", no_argument, 0, OPT_USAGE },
{ "command", required_argument, 0, 'c' },
@@ -49,12 +54,15 @@ struct option longopts[] = {
{ "version", no_argument, 0, OPT_VERSION },
{ "verbose", no_argument, 0, 'v' },
{ "user", required_argument, 0, 'u' },
{ "group", required_argument, 0, 'g' },
{ "restart-on-exit", required_argument, 0, OPT_RESTART_ON_EXIT },
{ "restart-on-signal", required_argument, 0, OPT_RESTART_ON_SIGNAL },
+ { "log-facility", required_argument, 0, OPT_LOG_FACILITY },
+ { "log-tag", required_argument, 0, OPT_LOG_TAG },
+ { "limit", required_argument, 0, 'l' },
{ NULL }
};
char shortopts[2*sizeof(longopts)/sizeof(longopts[0])];
static void
shortopts_setup(void)
@@ -203,17 +211,30 @@ char const *help_msg[] = {
"",
" At least one of COMMAND or PROGRAM must be given.",
" If PROGRAM is supplied, but COMMAND is not, COMMAND is set to PROGRAM",
" Otherwise, if COMMAND is set, but PROGRAM is not, PROGRAM is set to the",
" first word (in the shell sense) in COMMAND.",
"",
- "Runtime privileges:",
+ "Runtime privileges and limits:",
"",
" -u, --user=NAME run with this user privileges",
" -g, --group=GROUP[,GROUP...]]",
" run with this group(s) privileges",
+ " -l, --limit=LIM set resource limit; LIM is a resource letter",
+ " followed by the resource value; resource letters are:",
+ " c core file size (KB)",
+ " d data size (KB)",
+ " f file size (KB)",
+ " l locked-in-memory address space (KB)",
+ " m resident set size (KB)",
+ " n number of open files",
+ " p process priority -20..20",
+ " s stack size (KB)",
+ " t CPU time (seconds)",
+ " u number of subprocesses",
+ " v virtual memory (KB)",
"",
"Additional configuration:",
"",
" -t, --timeout=SECONDS time to wait for the program to start up or",
" terminate",
" -P, --pid-from=SOURCE where to look for PIDs of the running programs",
@@ -235,12 +256,15 @@ char const *help_msg[] = {
" --restart-on-exit=[!]CODE[,...]",
" restart the program if it exits with one of the",
" listed status codes",
" --restart-on-signal=[!]SIG[,...]",
" restart the program if it terminates on one of the",
" listed signals",
+ " --log-facility=FACILITY",
+ " log diagnostic messages to this syslog facility",
+ " --log-tag=TAG use this syslog tag instead of the program name",
"",
"Informational options:",
"",
" -h, --help display this help list",
" --usage display short usage information",
" --version display program version and exist",
@@ -251,12 +275,14 @@ char const *help_msg[] = {
" GENRC_PROGRAM=NAME --program=NAME",
" GENRC_PID_FROM=SOURCE --pid-from=SOURCE",
" GENRC_TIMEOUT=SECONDS --timeout=SECONDS",
" GENRC_SENTINEL=1 --sentinel",
" GENRC_USER=NAME --user=NAME",
" GENRC_GROUP=GROUPS --group=GROUPS",
+ " GENRC_LOG_FACILITY=F --log-facility=F",
+ " GENRC_LOG_TAG=STR --log-tag=STR",
"",
"",
"PID sources:",
"",
" FILE:<NAME>",
" Read PID from the file <NAME>",
@@ -304,19 +330,23 @@ char const *usage_msg[] = {
"genrc",
"[-hev]",
"[-F PIDFILE]",
"[-P SOURCE]",
"[-c COMMAND]",
"[-g GROUP[,GROUP...]]",
+ "[-l LIM]",
"[-p PROGRAM]",
"[-s SHELL]",
"[-t SECONDS]",
"[-u USER]",
"[--command=COMMAND]",
"[--group GROUP[,GROUP...]]",
"[--help]",
+ "[--limit=LIM]",
+ "[--log-facility=FACILITY]",
+ "[--log-tag=TAG]",
"[--no-reload]",
"[--pid-from=SOURCE]",
"[--pidfile=PIDFILE]",
"[--program=PROGRAM]",
"[--restart-on-exit=[!]CODE[,...]]",
"[--restart-on-signal=[!]SIG[,...]]",
@@ -354,12 +384,90 @@ screen_width(void)
if (ws.ws_col == 0)
ws.ws_col = 80;
}
return ws.ws_col;
}
+static struct {
+ int letter;
+ int resource;
+ int is_set;
+ long val;
+} resource_tab[] = {
+ { 'c', RLIMIT_CORE },
+ { 'd', RLIMIT_DATA },
+ { 'f', RLIMIT_FSIZE },
+ { 'l', RLIMIT_MEMLOCK },
+ { 'm', RLIMIT_RSS },
+ { 'n', RLIMIT_NOFILE },
+ { 's', RLIMIT_STACK },
+ { 't', RLIMIT_CPU },
+ { 'u', RLIMIT_NPROC },
+ { 'v', RLIMIT_AS },
+ { 'p', 0 }
+};
+
+static int
+find_resource(int letter)
+{
+ int i;
+ for (i = 0; i < sizeof(resource_tab)/sizeof(resource_tab[0]); i++)
+ if (letter == resource_tab[i].letter)
+ return resource_tab[i].resource;
+ return -1;
+}
+
+void
+set_limit(char *arg)
+{
+ int r;
+ unsigned long v;
+ char *p;
+ struct rlimit rlim;
+
+ if ((r = find_resource(arg[0])) == -1) {
+ usage_error("%s: unrecognized resource code", arg);
+ }
+ if ((v = strtoul(arg + 1, &p, 10)) == ULONG_MAX && errno == ERANGE) {
+ usage_error("%s: resource value out of range", arg);
+ }
+ if (*p) {
+ usage_error("%s: value is not a number (stopped at %s)",
+ arg, p);
+ }
+
+ v *= 1024;
+ rlim.rlim_cur = v;
+ rlim.rlim_max = v;
+ if (setrlimit(r, &rlim))
+ genrc_error("%s: failed to set limit: %s", arg,
+ strerror(errno));
+}
+
+void
+set_nice(char *arg)
+{
+ long v;
+ char *p;
+
+ if ((((v = strtol(arg + 1, &p, 10)) == LONG_MAX || v == LONG_MIN)
+ && errno == ERANGE) ||
+ v < -20 ||
+ v > 20) {
+ usage_error("%s: resource value out of range", arg);
+ }
+ if (*p) {
+ usage_error("%s: value is not a number (stopped at %s)",
+ arg, p);
+ }
+ if (setpriority (PRIO_PROCESS, 0, v)) {
+ usage_error("failed to set process priority: %s",
+ strerror(errno));
+ }
+}
+
void
usage(void)
{
int i, j, pos = 0;
int width = screen_width();
if (width > 4)
@@ -389,16 +497,54 @@ static const char gplv3[] =
"There is NO WARRANTY, to the extent permitted by law.\n\n";
void
version(void)
{
printf("%s\n", PACKAGE_STRING);
- printf("Copyryght (C) 2018 Sergey Poznyakoff\n");
+ printf("Copyryght (C) 2018-2020 Sergey Poznyakoff\n");
printf("%s", gplv3);
}
+static struct facility_def {
+ char const *name;
+ int facility;
+} facility_tab[] = {
+ { "auth", LOG_AUTH },
+ { "authpriv",LOG_AUTHPRIV },
+ { "cron", LOG_CRON },
+ { "daemon", LOG_DAEMON },
+ { "ftp", LOG_FTP },
+ { "lpr", LOG_LPR },
+ { "mail", LOG_MAIL },
+ { "user", LOG_USER },
+ { "local0", LOG_LOCAL0 },
+ { "local1", LOG_LOCAL1 },
+ { "local2", LOG_LOCAL2 },
+ { "local3", LOG_LOCAL3 },
+ { "local4", LOG_LOCAL4 },
+ { "local5", LOG_LOCAL5 },
+ { "local6", LOG_LOCAL6 },
+ { "local7", LOG_LOCAL7 },
+ { NULL }
+};
+
+static int
+str_to_facility(char const *str)
+{
+ int i;
+ for (i = 0; facility_tab[i].name; i++)
+ if (strcasecmp(str, facility_tab[i].name) == 0)
+ return facility_tab[i].facility;
+ return -1;
+}
+
+void
+genrc_openlog(void)
+{
+ openlog(genrc_log_tag, LOG_PID, genrc_log_facility);
+}
typedef int (*GENRC_COMMAND)(void);
struct comtab {
char const *com_name;
GENRC_COMMAND com_fun;
@@ -449,12 +595,18 @@ main(int argc, char **argv)
case 'c':
setenv("GENRC_COMMAND", optarg, 1);
break;
case 'e':
genrc_shell = NULL;
break;
+ case 'l':
+ if (optarg[0] == 'p')
+ set_nice(optarg+1);
+ else
+ set_limit(optarg);
+ break;
case 's':
if (strcmp(optarg, "no") == 0
|| strcmp(optarg, "none") == 0)
genrc_shell = NULL;
else
genrc_shell = optarg;
@@ -474,12 +626,18 @@ main(int argc, char **argv)
case 'g':
setenv("GENRC_GROUP", optarg, 1);
break;
case OPT_CREATE_PIDFILE:
setenv("GENRC_CREATE_PIDFILE", optarg, 1);
break;
+ case OPT_LOG_FACILITY:
+ setenv("GENRC_LOG_FACILITY", optarg, 1);
+ break;
+ case OPT_LOG_TAG:
+ setenv("GENRC_LOG_TAG", optarg, 1);
+ break;
case 't':
setenv("GENRC_TIMEOUT", optarg, 1);
break;
case 'S':
setenv("GENRC_SENTINEL", "1", 1);
break;
@@ -570,12 +728,22 @@ main(int argc, char **argv)
genrc_pid_closure = get_pid_closure(p);
free(p);
} else {
genrc_pid_closure = get_pid_closure(DEFAULT_PID_SOURCE);
}
+ if ((p = getenv("GENRC_LOG_FACILITY")) != NULL) {
+ if ((c = str_to_facility(p)) == -1)
+ usage_error("%s: unknown facility", p);
+ genrc_log_facility = c;
+ }
+ if ((p = getenv("GENRC_LOG_TAG")) != NULL)
+ genrc_log_tag = p;
+ else
+ genrc_log_tag = genrc_program;
+
argc -= optind;
if (argc == 0)
usage_error("missing command verb");
if (argc > 1)
usage_error("too many arguments");
argv += optind;
diff --git a/src/genrc.h b/src/genrc.h
index e77c840..9326edd 100644
--- a/src/genrc.h
+++ b/src/genrc.h
@@ -144,12 +144,14 @@ extern int genrc_signal_reload;
extern int genrc_signal_stop;
extern GENRC_PID_CLOSURE *genrc_pid_closure;
extern char *genrc_create_pidfile;
extern int genrc_verbose;
extern char *genrc_shell;
+void genrc_openlog(void);
+
void spawn(int *p);
int sentinel(void);
int com_start(void);
int com_status(void);
diff --git a/src/sentinel.c b/src/sentinel.c
index 989acf1..c2c2d08 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -1,8 +1,8 @@
/* This file is part of genrc
-Copyryght (C) 2018, 2019 Sergey Poznyakoff
+Copyryght (C) 2018-2020 Sergey Poznyakoff
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
#include "genrc.h"
#include <syslog.h>
@@ -168,13 +168,13 @@ void
wait_loop(pid_t child, int out, int err)
{
fd_set rdset;
int nfd = (out > err ? out : err) + 1;
struct log_buffer obuf, ebuf;
- openlog(genrc_program, LOG_PID, LOG_DAEMON);
+ genrc_openlog();
log_buffer_init(&obuf, LOG_INFO);
log_buffer_init(&ebuf, LOG_ERR);
while (1) {
int rc, status;

Return to:

Send suggestions and report system problems to the System administrator.