On Sun, 29 Apr 2001 wojtek@3miasto.net wrote:
> > in main.c look for fork().
>
> looks like it is that:
>
> for (;;) {
> mainStartScript(argv[0]);
> if ((pid = fork()) == 0) {
> /* child */
> openlog(appname, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4);
> prog = xstrdup(argv[0]);
> argv[0] = xstrdup("(squid)");
> execvp(prog, argv);
> syslog(LOG_ALERT, "execvp failed: %s", xstrerror());
> }
> /* parent */
> openlog(appname, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4);
> syslog(LOG_NOTICE, "Squid Parent: child process %d started", pid);
> time(&start);
>
> it forks and child process reexecutes squid but with "(squid)" argv[0]
> set. so where this child process (the same executable) know it should
> behave as master or worker process??
> i can't find that
Did you find it yet? It's right here:
if (*(argv[0]) == '(')
return;
Received on Thu Jun 07 2001 - 17:20:12 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:03 MST