View | Details | Raw Unified | Return to bug 204741
Collapse All | Expand All

(-)syslogd.8 (-1 / +5 lines)
Lines 36-42 Link Here
36
.Nd log systems messages
36
.Nd log systems messages
37
.Sh SYNOPSIS
37
.Sh SYNOPSIS
38
.Nm
38
.Nm
39
.Op Fl 468ACcdkNnosTuv
39
.Op Fl 468ACcdkNnoOsTuv
40
.Op Fl a Ar allowed_peer
40
.Op Fl a Ar allowed_peer
41
.Op Fl b Ar bind_address
41
.Op Fl b Ar bind_address
42
.Op Fl f Ar config_file
42
.Op Fl f Ar config_file
Lines 241-246 Prefix kernel messages with the full ker Link Here
241
.Xr getbootfile 3 .
241
.Xr getbootfile 3 .
242
Without this, the kernel message prefix is always
242
Without this, the kernel message prefix is always
243
.Dq Li kernel: .
243
.Dq Li kernel: .
244
.It Fl O
245
Protect
246
.Nm
247
from being killed if the system exhausts available memory and swap.
244
.It Fl p
248
.It Fl p
245
Specify the pathname of an alternate log socket to be used instead;
249
Specify the pathname of an alternate log socket to be used instead;
246
the default is
250
the default is
(-)syslogd.c (-1 / +15 lines)
Lines 89-94 __FBSDID("$FreeBSD: stable/10/usr.sbin/s Link Here
89
#include <sys/resource.h>
89
#include <sys/resource.h>
90
#include <sys/syslimits.h>
90
#include <sys/syslimits.h>
91
#include <sys/types.h>
91
#include <sys/types.h>
92
#include <sys/procctl.h>
92
93
93
#include <netinet/in.h>
94
#include <netinet/in.h>
94
#include <netdb.h>
95
#include <netdb.h>
Lines 280-285 static int Initialized; /* set when we h Link Here
280
static int	MarkInterval = 20 * 60;	/* interval between marks in seconds */
281
static int	MarkInterval = 20 * 60;	/* interval between marks in seconds */
281
static int	MarkSeq;	/* mark sequence number */
282
static int	MarkSeq;	/* mark sequence number */
282
static int	NoBind;		/* don't bind() as suggested by RFC 3164 */
283
static int	NoBind;		/* don't bind() as suggested by RFC 3164 */
284
static int	ProtectMode = 0; /* when true, protect from OOM killer */
283
static int	SecureMode;	/* when true, receive only unix domain socks */
285
static int	SecureMode;	/* when true, receive only unix domain socks */
284
#ifdef INET6
286
#ifdef INET6
285
static int	family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */
287
static int	family = PF_UNSPEC; /* protocol family (IPv4, IPv6 or both) */
Lines 372-378 main(int argc, char *argv[]) Link Here
372
		dprintf("madvise() failed: %s\n", strerror(errno));
374
		dprintf("madvise() failed: %s\n", strerror(errno));
373
375
374
	bindhostname = NULL;
376
	bindhostname = NULL;
375
	while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nNop:P:sS:Tuv"))
377
	while ((ch = getopt(argc, argv, "468Aa:b:cCdf:kl:m:nNoOp:P:sS:Tuv"))
376
	    != -1)
378
	    != -1)
377
		switch (ch) {
379
		switch (ch) {
378
		case '4':
380
		case '4':
Lines 461-466 main(int argc, char *argv[]) Link Here
461
		case 'o':
463
		case 'o':
462
			use_bootfile = 1;
464
			use_bootfile = 1;
463
			break;
465
			break;
466
		/*
467
		 * Protect itself from being killed
468
		 * when swap space is exhausted.
469
		 */
470
		case 'O': 
471
			ProtectMode++;
472
			break;
464
		case 'p':		/* path */
473
		case 'p':		/* path */
465
			if (strlen(optarg) >= sizeof(sunx.sun_path))
474
			if (strlen(optarg) >= sizeof(sunx.sun_path))
466
				errx(1, "%s path too long, exiting", optarg);
475
				errx(1, "%s path too long, exiting", optarg);
Lines 591-596 main(int argc, char *argv[]) Link Here
591
	/* tuck my process id away */
600
	/* tuck my process id away */
592
	pidfile_write(pfh);
601
	pidfile_write(pfh);
593
602
603
	if (ProtectMode) {
604
		int p_flags = PPROT_SET;
605
		procctl(P_PID, getpid(), PROC_SPROTECT, &p_flags);
606
	}
607
594
	dprintf("off & running....\n");
608
	dprintf("off & running....\n");
595
609
596
	init(0);
610
	init(0);

Return to bug 204741