Date: Sat, 26 Jun 2010 14:00:05 -0700 From: Garrett Cooper <yanefbsd@gmail.com> To: Hans Petter Selasky <hselasky@c2i.net> Cc: freebsd-current@freebsd.org Subject: Re: Patch for rc.d/devd on FreeBSD 9-current Message-ID: <AANLkTilnYGNz7V6z6AkeKsqUvOMN8yLvO57GM1gOIsTD@mail.gmail.com> In-Reply-To: <AANLkTilVB_E-BiOtC-gENBQ7FdPTLcmu8qpmdwU1GyXd@mail.gmail.com> References: <201006262229.09747.hselasky@c2i.net> <AANLkTilVB_E-BiOtC-gENBQ7FdPTLcmu8qpmdwU1GyXd@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 26, 2010 at 1:45 PM, Garrett Cooper <yanefbsd@gmail.com> wrote:
> On Sat, Jun 26, 2010 at 1:29 PM, Hans Petter Selasky <hselasky@c2i.net> w=
rote:
>> Hi,
>>
>> Sometimes utilities that are started by devd require libraries outside
>> /usr/lib. One example is the webcamd utility which is started by devd up=
on USB
>> device insertion. What do you think about the following patch:
>>
>> --- devd =A0 =A0 =A0 =A0(revision 209463)
>> +++ devd =A0 =A0 =A0 =A0(local)
>> @@ -4,7 +4,7 @@
>> =A0#
>>
>> =A0# PROVIDE: devd
>> -# REQUIRE: netif
>> +# REQUIRE: netif ldconfig
>> =A0# BEFORE: NETWORKING mountcritremote
>> =A0# KEYWORD: nojail shutdown
>
> Funny since I was just monkeying around with this. This doesn't appear
> to be the only issue with devd:
>
> # devd
> devd: devd already running, pid: 430
> # pgrep 430; echo $?
> 1
> #
>
> Looks like /etc/rc.d/devd restart is broken :(...
This seems to fix that.
Thanks,
-Garrett
Index: devd.cc
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- devd.cc (revision 209530)
+++ devd.cc (working copy)
@@ -739,6 +739,7 @@
static void
event_loop(void)
{
+ bool warn_user_about_cleanup;
int rv;
int fd;
char buffer[DEVCTL_MAXBUF];
@@ -804,6 +805,17 @@
new_client(server_fd);
}
close(fd);
+ close(server_fd);
+
+ if (unlink(PIPE) =3D=3D 0) {
+ cfg.remove_pidfile();
+ warn_user_about_cleanup =3D false;
+ } else
+ warn_user_about_cleanup =3D true;
+
+ if (warn_user_about_cleanup =3D=3D true)
+ warn("cleanup failed");
+
}
=0C
/*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTilnYGNz7V6z6AkeKsqUvOMN8yLvO57GM1gOIsTD>
