linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev 16, two copies of udevd
@ 2004-02-04  1:11 Jon Smirl
  2004-02-04  1:19 ` Kay Sievers
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Jon Smirl @ 2004-02-04  1:11 UTC (permalink / raw)
  To: linux-hotplug

When I boot I'm getting two copies of udevd running.  If I kill them, then
insert/remove a device I only get one udevd. Maybe a race condition when first
starting udevd?

==Jon Smirl
jonsmirl@yahoo.com

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
@ 2004-02-04  1:19 ` Kay Sievers
  2004-02-04  1:30 ` Jon Smirl
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Kay Sievers @ 2004-02-04  1:19 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Feb 03, 2004 at 05:11:17PM -0800, Jon Smirl wrote:
> When I boot I'm getting two copies of udevd running.  If I kill them, then
> insert/remove a device I only get one udevd. Maybe a race condition when first
> starting udevd?

Are you mounting a tmpfs over udev?
The lockfile is placed in there, so it is lost if you mount it over.


Kay


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
  2004-02-04  1:19 ` Kay Sievers
@ 2004-02-04  1:30 ` Jon Smirl
  2004-02-05 17:25 ` Greg KH
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jon Smirl @ 2004-02-04  1:30 UTC (permalink / raw)
  To: linux-hotplug

Yes, I'm mounting a tmpfs. I'm using the tmpfs becuase I've been having trouble
with stale nodes in my udev dir when I crash the kernel.

How is this going to work in final form? Will I need an initial /dev with mknod
for the 4-5 minimal devices needed to boot, and then can I mount a tmpfs over
this to hold udev devices?

--- Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Tue, Feb 03, 2004 at 05:11:17PM -0800, Jon Smirl wrote:
> > When I boot I'm getting two copies of udevd running.  If I kill them, then
> > insert/remove a device I only get one udevd. Maybe a race condition when
> first
> > starting udevd?
> 
> Are you mounting a tmpfs over udev?
> The lockfile is placed in there, so it is lost if you mount it over.
> 
> 
> Kay
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
> Linux-hotplug-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel


==Jon Smirl
jonsmirl@yahoo.com

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
  2004-02-04  1:19 ` Kay Sievers
  2004-02-04  1:30 ` Jon Smirl
@ 2004-02-05 17:25 ` Greg KH
  2004-02-05 23:49 ` Kay Sievers
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2004-02-05 17:25 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Feb 03, 2004 at 05:30:24PM -0800, Jon Smirl wrote:
> Yes, I'm mounting a tmpfs. I'm using the tmpfs becuase I've been having trouble
> with stale nodes in my udev dir when I crash the kernel.
> 
> How is this going to work in final form? Will I need an initial /dev with mknod
> for the 4-5 minimal devices needed to boot, and then can I mount a tmpfs over
> this to hold udev devices?

I don't know, what do you think it should look like?

:)

greg k-h


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
                   ` (2 preceding siblings ...)
  2004-02-05 17:25 ` Greg KH
@ 2004-02-05 23:49 ` Kay Sievers
  2004-02-05 23:56 ` Jon Smirl
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Kay Sievers @ 2004-02-05 23:49 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Feb 05, 2004 at 09:25:05AM -0800, Greg KH wrote:
> On Tue, Feb 03, 2004 at 05:30:24PM -0800, Jon Smirl wrote:
> > Yes, I'm mounting a tmpfs. I'm using the tmpfs becuase I've been having trouble
> > with stale nodes in my udev dir when I crash the kernel.
> > 
> > How is this going to work in final form? Will I need an initial /dev with mknod
> > for the 4-5 minimal devices needed to boot, and then can I mount a tmpfs over
> > this to hold udev devices?
> 
> I don't know, what do you think it should look like?

Jon, please try the current bk tree. We switched away from the socket file,
that gets missing with the tmpfs mount.
It should work now, cause we can't listen twice on the same socket in
abstract namespace.

Greg, it seems we can remove the lock file code completely.
Anyone willing to try? Just comment out the one_and_only() and look if
you can produce any situation with two udevd's running. It works for me
nice without it, also on tmpfs.


thanks,
Kay


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
                   ` (3 preceding siblings ...)
  2004-02-05 23:49 ` Kay Sievers
@ 2004-02-05 23:56 ` Jon Smirl
  2004-02-06  0:01 ` Jon Smirl
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jon Smirl @ 2004-02-05 23:56 UTC (permalink / raw)
  To: linux-hotplug

I just tried current bk. I still get two copies of udevd running.

--- Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Thu, Feb 05, 2004 at 09:25:05AM -0800, Greg KH wrote:
> > On Tue, Feb 03, 2004 at 05:30:24PM -0800, Jon Smirl wrote:
> > > Yes, I'm mounting a tmpfs. I'm using the tmpfs becuase I've been having
> trouble
> > > with stale nodes in my udev dir when I crash the kernel.
> > > 
> > > How is this going to work in final form? Will I need an initial /dev with
> mknod
> > > for the 4-5 minimal devices needed to boot, and then can I mount a tmpfs
> over
> > > this to hold udev devices?
> > 
> > I don't know, what do you think it should look like?
> 
> Jon, please try the current bk tree. We switched away from the socket file,
> that gets missing with the tmpfs mount.
> It should work now, cause we can't listen twice on the same socket in
> abstract namespace.
> 
> Greg, it seems we can remove the lock file code completely.
> Anyone willing to try? Just comment out the one_and_only() and look if
> you can produce any situation with two udevd's running. It works for me
> nice without it, also on tmpfs.
> 
> 
> thanks,
> Kay


==Jon Smirl
jonsmirl@yahoo.com

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
                   ` (4 preceding siblings ...)
  2004-02-05 23:56 ` Jon Smirl
@ 2004-02-06  0:01 ` Jon Smirl
  2004-02-06  0:01 ` Kay Sievers
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jon Smirl @ 2004-02-06  0:01 UTC (permalink / raw)
  To: linux-hotplug

--- Jon Smirl <jonsmirl@yahoo.com> wrote:
> I just tried current bk. I still get two copies of udevd running.
> 
Not true. My pull went into PENDING so I ran the old code.

Fixing that problem now I only have one copy of udevd running.

==Jon Smirl
jonsmirl@yahoo.com

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
                   ` (5 preceding siblings ...)
  2004-02-06  0:01 ` Jon Smirl
@ 2004-02-06  0:01 ` Kay Sievers
  2004-02-06  0:08 ` Kay Sievers
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Kay Sievers @ 2004-02-06  0:01 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Feb 05, 2004 at 03:56:37PM -0800, Jon Smirl wrote:
> I just tried current bk. I still get two copies of udevd running.

What says "lsof |grep udevd"?

Kay

> --- Kay Sievers <kay.sievers@vrfy.org> wrote:
> > Jon, please try the current bk tree. We switched away from the socket file,
> > that gets missing with the tmpfs mount.
> > It should work now, cause we can't listen twice on the same socket in
> > abstract namespace.


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
                   ` (6 preceding siblings ...)
  2004-02-06  0:01 ` Kay Sievers
@ 2004-02-06  0:08 ` Kay Sievers
  2004-02-06  0:32 ` Greg KH
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Kay Sievers @ 2004-02-06  0:08 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Feb 05, 2004 at 04:01:39PM -0800, Jon Smirl wrote:
> --- Jon Smirl <jonsmirl@yahoo.com> wrote:
> > I just tried current bk. I still get two copies of udevd running.
> > 
> Not true. My pull went into PENDING so I ran the old code.
> 
> Fixing that problem now I only have one copy of udevd running.

Ahh, nice. I feel better now :)
Looks promising, next thing to kill is the lock file.

Kay


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
                   ` (7 preceding siblings ...)
  2004-02-06  0:08 ` Kay Sievers
@ 2004-02-06  0:32 ` Greg KH
  2004-02-06  0:47 ` Kay Sievers
  2004-02-06  1:09 ` Greg KH
  10 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2004-02-06  0:32 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Feb 06, 2004 at 12:49:46AM +0100, Kay Sievers wrote:
> 
> Jon, please try the current bk tree. We switched away from the socket file,
> that gets missing with the tmpfs mount.
> It should work now, cause we can't listen twice on the same socket in
> abstract namespace.
> 
> Greg, it seems we can remove the lock file code completely.

I agree, it should be safe to remove that now, which is a very good
thing.

Care to send a patch?  Or I can do it.

thanks,

greg k-h


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
                   ` (8 preceding siblings ...)
  2004-02-06  0:32 ` Greg KH
@ 2004-02-06  0:47 ` Kay Sievers
  2004-02-06  1:09 ` Greg KH
  10 siblings, 0 replies; 12+ messages in thread
From: Kay Sievers @ 2004-02-06  0:47 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

On Thu, Feb 05, 2004 at 04:32:16PM -0800, Greg KH wrote:
> On Fri, Feb 06, 2004 at 12:49:46AM +0100, Kay Sievers wrote:
> > 
> > Jon, please try the current bk tree. We switched away from the socket file,
> > that gets missing with the tmpfs mount.
> > It should work now, cause we can't listen twice on the same socket in
> > abstract namespace.
> > 
> > Greg, it seems we can remove the lock file code completely.
> 
> I agree, it should be safe to remove that now, which is a very good
> thing.
> 
> Care to send a patch?  Or I can do it.

Here we go...



[-- Attachment #2: 01-kill-lockfile.patch --]
[-- Type: text/plain, Size: 2121 bytes --]

===== Makefile 1.103 vs edited =====
--- 1.103/Makefile	Thu Feb  5 02:41:19 2004
+++ edited/Makefile	Fri Feb  6 01:39:07 2004
@@ -241,7 +241,6 @@
 	@echo \#define UDEV_PERMISSION_FILE	\"$(configdir)\udev.permissions\" >> $@
 	@echo \#define UDEV_BIN		\"$(DESTDIR)$(sbindir)/udev\" >> $@
 	@echo \#define UDEVD_BIN	\"$(DESTDIR)$(sbindir)/udevd\" >> $@
-	@echo \#define UDEVD_LOCK	\"$(udevdir)/\.udevd.lock\" >> $@
 
 # config files automatically generated
 GEN_CONFIGS =	$(LOCAL_CFG_DIR)/udev.conf
===== udev-remove.c 1.17 vs edited =====
--- 1.17/udev-remove.c	Thu Jan 15 16:22:25 2004
+++ edited/udev-remove.c	Fri Feb  6 01:24:11 2004
@@ -34,7 +34,6 @@
 #include "logging.h"
 #include "namedev.h"
 #include "udevdb.h"
-#include "libsysfs/libsysfs.h"
 
 static int delete_path(char *path)
 {
===== udevd.c 1.13 vs edited =====
--- 1.13/udevd.c	Thu Feb  5 10:32:51 2004
+++ edited/udevd.c	Fri Feb  6 01:37:52 2004
@@ -21,7 +21,6 @@
 
 #include <pthread.h>
 #include <stddef.h>
-#include <sys/types.h>
 #include <sys/wait.h>
 #include <signal.h>
 #include <unistd.h>
@@ -30,7 +29,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
-#include <fcntl.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
@@ -324,7 +322,6 @@
 	switch (signum) {
 		case SIGINT:
 		case SIGTERM:
-			unlink(UDEVD_LOCK);
 			exit(20 + signum);
 			break;
 		default:
@@ -332,28 +329,6 @@
 	}
 }
 
-static int one_and_only(void)
-{
-	char string[50];
-	int lock_file;
-
-	lock_file = open(UDEVD_LOCK, O_RDWR | O_CREAT, 0x640);
-	if (lock_file < 0)
-		return -1;
-
-	/* see if we can lock */
-	if (lockf(lock_file, F_TLOCK, 0) < 0) {
-		dbg("file is already locked, exit");
-		close(lock_file);
-		return -1;
-	}
-
-	snprintf(string, sizeof(string), "%d\n", getpid());
-	write(lock_file, string, strlen(string));
-
-	return 0;
-}
-
 int main(int argc, char *argv[])
 {
 	int ssock;
@@ -368,10 +343,6 @@
 	int retval;
 
 	init_logging("udevd");
-
-	/* only let one version of the daemon run at any one time */
-	if (one_and_only() != 0)
-		exit(0);
 
 	signal(SIGINT, sig_handler);
 	signal(SIGTERM, sig_handler);

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: udev 16, two copies of udevd
  2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
                   ` (9 preceding siblings ...)
  2004-02-06  0:47 ` Kay Sievers
@ 2004-02-06  1:09 ` Greg KH
  10 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2004-02-06  1:09 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Feb 06, 2004 at 01:47:02AM +0100, Kay Sievers wrote:
> On Thu, Feb 05, 2004 at 04:32:16PM -0800, Greg KH wrote:
> > On Fri, Feb 06, 2004 at 12:49:46AM +0100, Kay Sievers wrote:
> > > 
> > > Jon, please try the current bk tree. We switched away from the socket file,
> > > that gets missing with the tmpfs mount.
> > > It should work now, cause we can't listen twice on the same socket in
> > > abstract namespace.
> > > 
> > > Greg, it seems we can remove the lock file code completely.
> > 
> > I agree, it should be safe to remove that now, which is a very good
> > thing.
> > 
> > Care to send a patch?  Or I can do it.
> 
> Here we go...

Applied, thanks.

greg k-h


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-02-06  1:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-04  1:11 udev 16, two copies of udevd Jon Smirl
2004-02-04  1:19 ` Kay Sievers
2004-02-04  1:30 ` Jon Smirl
2004-02-05 17:25 ` Greg KH
2004-02-05 23:49 ` Kay Sievers
2004-02-05 23:56 ` Jon Smirl
2004-02-06  0:01 ` Jon Smirl
2004-02-06  0:01 ` Kay Sievers
2004-02-06  0:08 ` Kay Sievers
2004-02-06  0:32 ` Greg KH
2004-02-06  0:47 ` Kay Sievers
2004-02-06  1:09 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).