RE: chroot() breaks syslog() ?

From: Steven Micallef (steven.micallef@world.net)
Date: Mon Aug 04 2003 - 02:30:34 EST


> consider syslogd's -a option. Or simply call openlog(3) with
> LOG_NDELAY before
> chroot(). Or place the first call to syslog() before
> chroot(). Syscall() does
> not close the socket between calls.
>
> int main(void) {
> openlog( "klaus", LOG_NDELAY, LOG_NEWS);
> chroot("/tmp");
> printf( "before\n" ); fflush( stdout );
> syslog(LOG_ALERT, "TEST1");
> printf( "between\n" ); fflush( stdout );
> syslog(LOG_ALERT, "TEST2");
> }

That works perfectly, thanks.

Regards,

Steve.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 07 2003 - 22:00:23 EST