Date: Sun, 7 Jun 2020 10:37:09 +0200 From: <driesm.michiels@gmail.com> To: "'Douglas Thrift'" <douglaswth@gmail.com> Cc: <ports@FreeBSD.org>, "'Roy Marples'" <roy@marples.name>, <woodsb02@FreeBSD.org> Subject: RE: FreeBSD Port: dhcpcd-9.1.0 Message-ID: <001301d63ca6$d5ddaa00$8198fe00$@gmail.com> In-Reply-To: <8f21b571-a4d2-ad5d-b4b7-3e36436fa018@gmail.com> References: <8f21b571-a4d2-ad5d-b4b7-3e36436fa018@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multipart message in MIME format. ------=_NextPart_000_0014_01D63CB7.9966C820 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > -----Original Message----- > From: owner-freebsd-ports@freebsd.org <owner-freebsd- > ports@freebsd.org> On Behalf Of Douglas Thrift > Sent: zondag 7 juni 2020 1:54 > To: woodsb02@FreeBSD.org > Cc: ports@FreeBSD.org > Subject: FreeBSD Port: dhcpcd-9.1.0 > > Hello, > > I just upgraded to dhcpcd 9.1.0 and I'm running into some weird issues. > The first thing I noticed was that the value for `pidfile` changed which made a > `service dhcpcd restart igb0` fail initially. After figuring this out, I was able to > stop the previous dhcpcd manually and then I discovered that the `pidfile` > was still incorrect: > > pidfile="/var/run/dhcpcd/dhcpcd-$ifn.pid" > > should actually be: > > pidfile="/var/run/dhcpcd/$ifn.pid" > > However, even after changing that, running `service dhcpcd start igb0` was > sticking to the foreground rather than daemonizing and returning me to a > prompt. I tried a number of ways to pass the -b/--background flag, but even > just running `dhcpcd -b igb0` manually did not daemonize. I reckon you are running FreeBSD 13-CURRENT (as I am)? I actually had the same problem and noticed some error messages in /var/log/messages.log. Roy has provided a patch for the dhcpcd source in attachments, this fixed it for me. It has already been committed to master and should be fixed in the new dhcpcd-9.1.1 release. > Could you look into these issues? > > Thanks! > -- > Douglas William Thrift > <https://douglasthrift.net/> > _______________________________________________ > freebsd-ports@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" ------=_NextPart_000_0014_01D63CB7.9966C820 Content-Type: application/octet-stream; name="dhcpcd-buf.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dhcpcd-buf.diff" diff --git a/src/privsep.c b/src/privsep.c index ce4f0565..ce84ff80 100644 --- a/src/privsep.c +++ b/src/privsep.c @@ -131,6 +131,20 @@ ps_dropprivs(struct dhcpcd_ctx *ctx) return 0; } +static int +ps_setbuf(int fd) +{ + socklen_t len = (socklen_t)sizeof(struct ps_msg); + + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &len, sizeof(len)) == -1 || + setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &len, sizeof(len)) == -1) + { + logerr(__func__); + return -1; + } + return 0; +} + pid_t ps_dostart(struct dhcpcd_ctx *ctx, pid_t *priv_pid, int *priv_fd, @@ -160,6 +174,7 @@ ps_dostart(struct dhcpcd_ctx *ctx, case 0: *priv_fd = fd[1]; close(fd[0]); + ps_setbuf(*priv_fd); break; default: *priv_pid = pid; @@ -181,6 +196,7 @@ ps_dostart(struct dhcpcd_ctx *ctx, logerr("%s: eloop_event_add", __func__); return -1; } + ps_setbuf(*priv_fd); return pid; } ------=_NextPart_000_0014_01D63CB7.9966C820--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001301d63ca6$d5ddaa00$8198fe00$>