-.\" $OpenBSD: sasyncd.8,v 1.11 2010/06/16 17:39:05 reyk Exp $
+.\" $OpenBSD: sasyncd.8,v 1.12 2017/04/04 22:37:01 jsg Exp $
.\"
.\" Copyright (c) 2005 Håkan Olsson. All rights reserved.
.\"
.\"
.\" Manual page for sasyncd
.\"
-.Dd $Mdocdate: June 16 2010 $
+.Dd $Mdocdate: April 4 2017 $
.Dt SASYNCD 8
.Os
.Sh NAME
.Nd IPsec SA synchronization daemon for failover gateways
.Sh SYNOPSIS
.Nm
-.Op Fl dv
+.Op Fl dnv
.Op Fl c Ar config-file
.Sh DESCRIPTION
The
.Nm
sends log messages to
.Xr syslog 3 .
+.It Fl n
+Configtest mode.
+Only check the configuration file for validity.
.It Fl v
The
.Fl v
-/* $OpenBSD: sasyncd.c,v 1.25 2017/04/04 14:04:54 reyk Exp $ */
+/* $OpenBSD: sasyncd.c,v 1.26 2017/04/04 22:37:01 jsg Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
{
extern char *__progname;
- fprintf(stderr, "usage: %s [-dv] [-c config-file]\n", __progname);
+ fprintf(stderr, "usage: %s [-dnv] [-c config-file]\n", __progname);
exit(1);
}
{
extern char *__progname;
char *cfgfile = 0;
- int ch;
+ int ch, noaction = 0;
if (geteuid() != 0) {
/* No point in continuing. */
return 1;
}
- while ((ch = getopt(argc, argv, "c:dv")) != -1) {
+ while ((ch = getopt(argc, argv, "c:dnv")) != -1) {
switch (ch) {
case 'c':
if (cfgfile)
case 'd':
cfgstate.debug++;
break;
+ case 'n':
+ noaction = 1;
+ break;
case 'v':
cfgstate.verboselevel++;
break;
exit(1);
}
+ if (noaction) {
+ fprintf(stderr, "configuration OK\n");
+ exit(0);
+ }
+
carp_demote(CARP_INC, 0);
if (carp_init())