-# $OpenBSD: dot.profile,v 1.45 2021/07/16 15:24:44 florian Exp $
+# $OpenBSD: dot.profile,v 1.46 2021/07/21 03:53:50 kn Exp $
# $NetBSD: dot.profile,v 1.1 1995/12/18 22:54:43 pk Exp $
#
# Copyright (c) 2009 Kenneth R. Westerback
mkdir -m u=rwx,go=rx -p /tmp/{ai,i}
# Start autoconfiguration daemons.
- [[ -x /sbin/resolvd ]] && /sbin/resolvd
- [[ -x /sbin/dhcpleased ]] && /sbin/dhcpleased
- [[ -x /sbin/slaacd ]] && /sbin/slaacd
+ # Hide legit "already running" errors when reentering the installer.
+ [[ -x /sbin/resolvd ]] && /sbin/resolvd 2>/dev/null
+ [[ -x /sbin/dhcpleased ]] && /sbin/dhcpleased 2>/dev/null
+ [[ -x /sbin/slaacd ]] && /sbin/slaacd 2>/dev/null
# Set up some sane tty defaults.
echo 'erase ^?, werase ^W, kill ^U, intr ^C, status ^T'
-/* $OpenBSD: dhcpleased.c,v 1.14 2021/07/12 15:09:18 beck Exp $ */
+/* $OpenBSD: dhcpleased.c,v 1.15 2021/07/21 03:53:50 kn Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
char *saved_argv0;
int pipe_main2frontend[2];
int pipe_main2engine[2];
- int frontend_routesock, rtfilter;
+ int frontend_routesock, rtfilter, lockfd;
int rtable_any = RTABLE_ANY;
char *csock = _PATH_DHCPLEASED_SOCKET;
#ifndef SMALL
if (geteuid())
errx(1, "need root privileges");
+ lockfd = open(_PATH_LOCKFILE, O_CREAT|O_RDWR|O_EXLOCK|O_NONBLOCK, 0600);
+ if (lockfd == -1)
+ errx(1, "already running");
+
/* Check for assigned daemon user */
if (getpwnam(DHCPLEASED_USER) == NULL)
errx(1, "unknown user %s", DHCPLEASED_USER);
-/* $OpenBSD: dhcpleased.h,v 1.6 2021/06/20 08:31:45 florian Exp $ */
+/* $OpenBSD: dhcpleased.h,v 1.7 2021/07/21 03:53:50 kn Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define _PATH_LOCKFILE "/dev/dhcpleased.lock"
#define _PATH_DHCPLEASED_SOCKET "/dev/dhcpleased.sock"
#define DHCPLEASED_USER "_dhcp"
#define DHCPLEASED_RTA_LABEL "dhcpleased"
-/* $OpenBSD: resolvd.c,v 1.15 2021/07/18 15:18:49 deraadt Exp $ */
+/* $OpenBSD: resolvd.c,v 1.16 2021/07/21 03:53:50 kn Exp $ */
/*
* Copyright (c) 2021 Florian Obser <florian@openbsd.org>
* Copyright (c) 2021 Theo de Raadt <deraadt@openbsd.org>
#define ROUTE_SOCKET_BUF_SIZE 16384
#define ASR_MAXNS 10
+#define _PATH_LOCKFILE "/dev/resolvd.lock"
#define _PATH_UNWIND_SOCKET "/dev/unwind.sock"
#define _PATH_RESCONF "/etc/resolv.conf"
#define _PATH_RESCONF_NEW "/etc/resolv.conf.new"
-#define _PATH_LOCKFILE "/var/run/resolvd.lock"
#ifndef nitems
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
lockfd = open(_PATH_LOCKFILE, O_CREAT|O_RDWR|O_EXLOCK|O_NONBLOCK, 0600);
if (lockfd == -1)
- errx(1, "already running, " _PATH_LOCKFILE);
+ errx(1, "already running");
if (!debug)
daemon(0, 0);
-/* $OpenBSD: slaacd.c,v 1.60 2021/05/01 11:53:24 florian Exp $ */
+/* $OpenBSD: slaacd.c,v 1.61 2021/07/21 03:53:50 kn Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
char *saved_argv0;
int pipe_main2frontend[2];
int pipe_main2engine[2];
- int frontend_routesock, rtfilter;
+ int frontend_routesock, rtfilter, lockfd;
int rtable_any = RTABLE_ANY;
char *csock = _PATH_SLAACD_SOCKET;
#ifndef SMALL
if (geteuid())
errx(1, "need root privileges");
+ lockfd = open(_PATH_LOCKFILE, O_CREAT|O_RDWR|O_EXLOCK|O_NONBLOCK, 0600);
+ if (lockfd == -1)
+ errx(1, "already running");
+
/* Check for assigned daemon user */
if (getpwnam(SLAACD_USER) == NULL)
errx(1, "unknown user %s", SLAACD_USER);
-/* $OpenBSD: slaacd.h,v 1.33 2021/03/21 18:25:24 florian Exp $ */
+/* $OpenBSD: slaacd.h,v 1.34 2021/07/21 03:53:50 kn Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define _PATH_LOCKFILE "/dev/slaacd.lock"
#define _PATH_SLAACD_SOCKET "/dev/slaacd.sock"
#define SLAACD_USER "_slaacd"
#define SLAACD_RTA_LABEL "slaacd"