linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Piter PUNK <piterpk@terra.com.br>
To: linux-hotplug@vger.kernel.org
Subject: Re: Some changes in write-cd-rules script
Date: Wed, 01 Nov 2006 15:44:37 +0000	[thread overview]
Message-ID: <4548C0E5.6080703@terra.com.br> (raw)
In-Reply-To: <45410738.9040501@terra.com.br>

md wrote:
> Your first problem is that you do not understand the locking rules used
> by the script.
> 
>> +if ! egrep "^ENV{ID_CDROM}=\"\?\*\", ENV{ID_PATH}=\"$ID_PATH\"" /etc/udev/rules.d/* &>/dev/null ; then 
>> +	# Prevent concurrent processes from modifying the file at the same time.
>> +	lock_rules_file
> 
> This creates a race.

You are correct. The test needs to be after the lock_rules_file.
In our script (cdrom-symlinks.sh) it is after the locking.

> Also, checking all files in the directory is broken because some may not
> be rules files.

I don't know that. I was thinking udev looks in all files under
/etc/udev/rules.d. Now i test renaming some files to DONTRUN, README,
etc.. and it really doesn't read this files. Changing the grep to
*.rules will solve it.

> I think that there are other problems, but I have not examined carefully
> the script.

Good, i will be happy with your feedback.

							Piter PUNK
-- 
     |        E-Mail: piterpk@terra.com.br        (personal)
    .|.               roberto.batista@ntux.com.br (professional)
    /V\
   // \\      UIN:116043354  Homepage:http://piterpunk.info02.com.br
  /(   )\
   ^`~'^         ----> Slackware Linux - The Best One! <----
  #105432

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
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

      parent reply	other threads:[~2006-11-01 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-26 19:06 Some changes in write-cd-rules script Piter PUNK
2006-11-01 14:13 ` md
2006-11-01 15:44 ` Piter PUNK [this message]

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=4548C0E5.6080703@terra.com.br \
    --to=piterpk@terra.com.br \
    --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 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).