mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
set process title
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include <gnutls/x509.h>
|
||||
#include <tlslib.h>
|
||||
#include "ipc.h"
|
||||
#include "setproctitle.h"
|
||||
|
||||
#include <main.h>
|
||||
#include <worker.h>
|
||||
@@ -498,6 +499,9 @@ int main(int argc, char** argv)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
initproctitle(argc, argv);
|
||||
setproctitle(PACKAGE_NAME, "main");
|
||||
|
||||
if (getuid() != 0) {
|
||||
fprintf(stderr, "This server requires root access to operate.\n");
|
||||
exit(1);
|
||||
@@ -613,6 +617,7 @@ int main(int argc, char** argv)
|
||||
/* close any open descriptors before
|
||||
* running the server
|
||||
*/
|
||||
setproctitle(PACKAGE_NAME, "worker");
|
||||
close(cmd_fd[0]);
|
||||
clear_lists(&s);
|
||||
|
||||
@@ -683,6 +688,7 @@ fork_failed:
|
||||
need_maintainance = 0;
|
||||
pid = fork();
|
||||
if (pid == 0) { /* child */
|
||||
setproctitle(PACKAGE_NAME, "maintainance");
|
||||
mslog(&s, NULL, LOG_INFO, "Performing maintainance");
|
||||
clear_lists(&s);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user