Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get process information from linux /proc #221

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
11 changes: 11 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,11 @@ main(int argc, char *argv[])
* child process doing the actual work. We request 4 privsep client
* sockets: three logger threads, and the child process main thread,
* which will become the main proxy thread. */
#ifdef __linux__
int clisock[5];
#else /* !__linux__ */
int clisock[4];
#endif /* !__linux__ */
if (privsep_fork(opts, clisock,
sizeof(clisock)/sizeof(clisock[0])) != 0) {
/* parent has exited the monitor loop after waiting for child,
Expand Down Expand Up @@ -826,6 +830,13 @@ main(int argc, char *argv[])
goto out_sslreinit_failed;
}

#ifdef __linux__
if (proc_linux_init(clisock[4]) == -1) {
fprintf(stderr, "%s: failed to init proc_linux\n", argv0);
goto out_sslreinit_failed;
}
#endif /* __linux__ */

/* Post-privdrop/chroot/detach initialization, thread spawning */
if (log_init(opts, proxy, &clisock[1]) == -1) {
fprintf(stderr, "%s: failed to init log facility: %s\n",
Expand Down
Loading