All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev 16, two copies of udevd
Date: Fri, 06 Feb 2004 00:47:02 +0000	[thread overview]
Message-ID: <20040206004702.GA3897@vrfy.org> (raw)
In-Reply-To: <20040204011117.26382.qmail@web14912.mail.yahoo.com>

[-- 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);

  parent reply	other threads:[~2004-02-06  0:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2004-02-06  1:09 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040206004702.GA3897@vrfy.org \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.