From owner-freebsd-current@FreeBSD.ORG Sat Jun 26 21:00:07 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 332B11065679 for ; Sat, 26 Jun 2010 21:00:07 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 88AF28FC1D for ; Sat, 26 Jun 2010 21:00:05 +0000 (UTC) Received: by qyk12 with SMTP id 12so72559qyk.13 for ; Sat, 26 Jun 2010 14:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Dgg0cesZX98SNxj+wMc/cgCn7rSjfCKctYBYjU+ox1o=; b=O1FAt7jpYupNrLS2p0xCI5tIEahHVrYcx7Rjx9RG3A+wEF5VaLKaAtYRREC2rzWGVh muenmYrzFag8Ze3YexclNfpyd+K3D4iMUC5a6No1x48+ej1a6yRjAFP1gpj4EmJO6qRV 7u7AW4w7TKKc/uHxERzt7CFAxC4Zv4oQjODvg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=A7CY5B6LoJP0/7pk079dfgdDckPxAaN8t+9tI1vgAfPbeIxQUYcZpJmaA+O+sQWuOD eIKUAbFkgPpoHsFKOZTjtLndZtU98XcvPqTYtuAHitby1jTwk+dCOg1JiE67p1qmjDAP HeVDp6rBDXyAvxhr30jTN3N8JC72+Qho/NzlY= MIME-Version: 1.0 Received: by 10.229.182.16 with SMTP id ca16mr1496955qcb.88.1277586005385; Sat, 26 Jun 2010 14:00:05 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Sat, 26 Jun 2010 14:00:05 -0700 (PDT) In-Reply-To: References: <201006262229.09747.hselasky@c2i.net> Date: Sat, 26 Jun 2010 14:00:05 -0700 Message-ID: From: Garrett Cooper To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: Patch for rc.d/devd on FreeBSD 9-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 21:00:07 -0000 On Sat, Jun 26, 2010 at 1:45 PM, Garrett Cooper wrote: > On Sat, Jun 26, 2010 at 1:29 PM, Hans Petter Selasky 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 /*