linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: shaoning <shaoning.fan@gmail.com>
To: linux-hotplug@vger.kernel.org
Subject: can i use udev rules to send a dbus signal
Date: Wed, 08 Dec 2010 07:58:47 +0000	[thread overview]
Message-ID: <4CFF3C7A.4010608@gmail.com> (raw)

hi all

I met a problem . Does anybody help me ?
I wrote a udeve rules for ntfs filesystem mount , and i want to using
dbus-send to send a dbus signal .But it seems it can not work . When I
debuge, i saw /var/log/message said it send ok. But , in fact , it can
not work. Does anybody know this issue?

PS: When exec udev rules, it should be root , and i am using a normal
user to debug and see result.


[fan@fc13 rules.d]$ cat 10-media-by-label-auto-mount.rules |grep -v ^#
KERNEL!="sd[b-z][0-9]", GOTO="media_by_label_auto_mount_end"
IMPORT{program}="/sbin/blkid -o udev -p %N"
ENV{dir_name}="usb-%k"
ENV{DISPLAY}=":0.0"

ACTION="add", ENV{ID_FS_TYPE}="ntfs",
ENV{mount_options}="relatime,utf8,gid\x100,umask\02", RUN+="/bin/mkdir
-p /media/%E{dir_name}", RUN+="/bin/mount -t ntfs-3g -o
$env{mount_options} /dev/%k /media/%E{dir_name}",
RUN+="/usr/bin/nautilus --no-desktop /media/%E{dir_name}",
RUN+="/bin/dbus-send --session --type=signal /
com.zhou.dbustest.sayhelloworld"


ACTION="remove", RUN+="/bin/umount -l /media/%E{dir_name}",
RUN+="/bin/rmdir /media/%E{dir_name}"
LABEL="media_by_label_auto_mount_end"
[fan@fc13 rules.d]$


             reply	other threads:[~2010-12-08  7:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08  7:58 shaoning [this message]
2010-12-08 15:04 ` can i use udev rules to send a dbus signal Martin Pitt

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=4CFF3C7A.4010608@gmail.com \
    --to=shaoning.fan@gmail.com \
    --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).