Commit cf23603e authored by Linus Nordberg's avatar Linus Nordberg
Browse files

Add config option PidFile.

Note that `-i' on the command line overrides this config option.

This closes RADSECPROXY-32.
parent 3a4d6a85
......@@ -24,13 +24,14 @@ instructions, please see the enclosed example file and the
documentation at
There are five options that may be specified on the command line:
The following options may be specified on the command line:
"-c configfile" to specify a non-default config file path.
"-d loglevel" to set a loglevel of 1, 2, 3, 4 and 5 where 5 is the
most detailed.
"-f" to run the proxy in the foreground with logging to stderr.
Without "-f" the default is to detach as a daemon and log to
"-i pidfile" to name a file to which the PID is written.
"-v" just prints version information and exits.
"-p" (pretend) makes the proxy go through the configuration files as
normal, but stops before creating any sockets or doing any
......@@ -3082,6 +3082,7 @@ void getmainconfig(const char *configfile) {
"ListenDTLS", CONF_MSTR, &listenargs[RAD_DTLS],
"SourceDTLS", CONF_STR, &sourcearg[RAD_DTLS],
"PidFile", CONF_STR, &options.pidfile,
"TTLAttribute", CONF_STR, &options.ttlattr,
"addTTL", CONF_LINT, &addttl,
"LogLevel", CONF_LINT, &loglevel,
......@@ -3280,6 +3281,8 @@ int radsecproxy_main(int argc, char **argv) {
debug(DBG_INFO, "radsecproxy revision %s starting", PACKAGE_VERSION);
if (!pidfile)
pidfile = options.pidfile;
if (pidfile && !createpidfile(pidfile))
debugx(1, DBG_ERR, "failed to create pidfile %s: %s", pidfile, strerror(errno));
......@@ -125,6 +125,17 @@ blocktype name {
multiple occurences is undefined.
The PidFile option specifies the name of a file to which
the process id (PID) will be written. This is overridden
by the <option>-i</option> command line option. There is
no default value for the PidFile option.
......@@ -54,6 +54,7 @@ enum rsp_fticks_mac_type {
struct options {
char *pidfile;
char *logdestination;
char *ftickssyslogfacility;
char *ttlattr;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment