I'm developing daemon monitoring SD card directory with using fanotify.
But, all users have their own mount namespace, so daemon can't receive fanotify event though user app writes SD card (same directory with above).
How can I monitor all mount namespace?
Each mount point needs to be manually added by fanotify_mark().
Here is is a good example:
Related
I mistakenly edited the /etc/deny.hosts file and added following entry-
ALL: ALL. Now, I'm unable to do SSH into it. After searching, I found that it denies all users from accessing the system. Does any one have idea on how to overcome this?
If the Root device of the Instance is an EBS, below steps will help you to come out of the situation.
Stop the Instance (Instance1)
Detach the Root Volume
Attach the Volume to a different running Instance (Instance2) as a non-Root device.
Mount the device on Instance2
Find the newly attached volume name using lsblk and then try to mount the volume.
Edit the deny.hosts file, it will be under /mountpath/etc/deny.hosts
Detach the Volume from Instance2 and re-Attach it to the Instance1 as Root Device.
I am writing a C program in Linux user space for an HMI. I want to detect the pendrive when inserted into the USB port on my SBC. I am running Lubuntu on it. So it is not having udev libraries. When I try to install udev on SBC, it is asking for dependencies and version compatibility issues are coming. Is there any other way to detect the Pendrive insertion from user space.
When I mount a device ex: /dev/sdc1(pendrive) to a particular folder ex: /mnt/vj, its being mounted properly. If I remove the pendrive without unmounting it then when next time pendrive inserted its being detected as /dev/sdd1 . How to fix the logical name for a pendrive in such cases. I want it to be /dev/sdc1 always. Is it possible?
Thanks in anticipation.
You can implement your own event listening daemon instead of udev. Youhave to create a netlink socket of type NETLINK_KOBJECT_UEVENT. By parsing the events, you will be able to detect the insertion of your drive.
It is not possible to ensure the name is always the same but you can probably create a symlink to the proper block device after detecting the event.
Check the link ubuntu 12.04 libudev-dev won't install because of dependencies that should mostly resolve your udev installation/dependencies issue if related to it.
udev is one of the easiest ways for detecting hardware plug-in and fetching of device information. Checkout libudev that is part of udev (Device manager of Linux kernel). Apart from managing device nodes in the /dev directory while hardware devices are added into the system or removed from it, the udev also handles all related user-space events that are raised during various operations such as addition/removal.
libudev allows access to device information and also provides a monitoring interface like udev_monitor that connects to device event source. udev_monitor_get_fd provides file descriptor that can be used with select system call for monitoring.
Check this link that has information related to usage of libudev http://www.signal11.us/oss/udev/
I am having issues with incrond IN_CREATE option. I am able to successfully monitor the directory created in a specific folder which are locally created. But incrond is not able to monitor NFS mounted directories.
I have added an cifs NFS mount /mnt/DIR which is added to incrontab. Do you know why it is not able to monitor changes under /mnt/DIR?.
Thanks,
It doesn't work, because there is no inotify support in NFS.
IOW, there is nothing in the NFS protocol which allows a client to specify some kind of interest in some file/directory, nor does the NFS protocol support the server pushing such notifications back to the client.
Are the terms used in Amazon Web Services Attach volume and Deattach volume used in reference of Amazon Elastic Block Storage; exactly same as Unix/Linux Mount and Unmount a device?
The attach volume and detach volume is the same as opening up you're computer and attaching or detaching a new disk. After you run the attach command you still need to mount the volume on the computer, format etc... same process as after you connect a new drive.
Attaching a volume means to make it physically available as a device to the operating system (as a block device). To be used as a file system, it must be mounted. Note that a raw EBS device is not formatted.
Here's a step-by-step guide to mounting an EBS volume
Brand-new EBS Volume:
http://support.rightscale.com/06-FAQs/FAQ_0012_-_How_do_I_partition,_format_and_mount_an_EBS_volume%3F
Pre-existing EBS Volume:
http://support.rightscale.com/12-Guides/Dashboard_Users_Guide/Clouds/AWS_Region/EBS_Volumes/Actions/Attach_an_EBS_Volume_to_an_instance
I have a ASUS laptop with Fedora 13. My problem is that any USB storage I connect does not automount. I have other computer with Fedora 13 which does not have the problem.
I have not be able to find any difference in configuration between my laptop and other computers that work.
So to try to trace down the problem I started to looomk for documentation on how it was supposed to work. I have looked at udev, devkit, hal , dbus, polkit, gnome and others.
I want to know which events, logs, config files and monitor programs that I can use to track down the events that takes place from when I attach an USB stick and until i have a window up and running in GNOME.
So far I have traced that udev detects the disk and creates /dev/sdb (and /dev/sdb1 for partition 1) and that event about device added is sent as messages on dbus. I am able to mount the disk manually with udisks but not with gnome-disk-utility (palmiset).
There is many different applications involved to automount a disk, I want to find out where in the chain of events does it fail.
I just found the reason it did not mount. I had a leftover file from earlier udev version. File 60-persistent-storage.rules existed in both /etc/udev/rules.d and in /lib/udev/rules.d . The former overruled the last one. When removing the one in /etc/udev/rules.d the USB drives mounted correctly again.