Source of this error: udevd [ PID ]: inotify_add_watch(6, /dev/sda, 10) failed: operation not permitted












2















We have this log in our syslog:



udevd [ PID ]: inotify_add_watch(6, /dev/sda, 10) failed: operation not permitted


Why do we get this error and how do we solve it?



Our environment: Ubuntu 12.04; LXC; we run inside a container; and I am not sure about SELinux (I don't have access) but it's not enabled.










share|improve this question

























  • thank you @sourcejedi , I edited.

    – Milad
    Jan 9 at 5:26











  • Thanks! Do you know what the host environment is - version of LXC, version of host OS, is it using AppArmor in combination with LXC?

    – sourcejedi
    Jan 9 at 17:17
















2















We have this log in our syslog:



udevd [ PID ]: inotify_add_watch(6, /dev/sda, 10) failed: operation not permitted


Why do we get this error and how do we solve it?



Our environment: Ubuntu 12.04; LXC; we run inside a container; and I am not sure about SELinux (I don't have access) but it's not enabled.










share|improve this question

























  • thank you @sourcejedi , I edited.

    – Milad
    Jan 9 at 5:26











  • Thanks! Do you know what the host environment is - version of LXC, version of host OS, is it using AppArmor in combination with LXC?

    – sourcejedi
    Jan 9 at 17:17














2












2








2


1






We have this log in our syslog:



udevd [ PID ]: inotify_add_watch(6, /dev/sda, 10) failed: operation not permitted


Why do we get this error and how do we solve it?



Our environment: Ubuntu 12.04; LXC; we run inside a container; and I am not sure about SELinux (I don't have access) but it's not enabled.










share|improve this question
















We have this log in our syslog:



udevd [ PID ]: inotify_add_watch(6, /dev/sda, 10) failed: operation not permitted


Why do we get this error and how do we solve it?



Our environment: Ubuntu 12.04; LXC; we run inside a container; and I am not sure about SELinux (I don't have access) but it's not enabled.







linux logs syslog inotify






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 12 at 13:17









Jeff Schaller

39.5k1054126




39.5k1054126










asked Jan 8 at 18:10









MiladMilad

133




133













  • thank you @sourcejedi , I edited.

    – Milad
    Jan 9 at 5:26











  • Thanks! Do you know what the host environment is - version of LXC, version of host OS, is it using AppArmor in combination with LXC?

    – sourcejedi
    Jan 9 at 17:17



















  • thank you @sourcejedi , I edited.

    – Milad
    Jan 9 at 5:26











  • Thanks! Do you know what the host environment is - version of LXC, version of host OS, is it using AppArmor in combination with LXC?

    – sourcejedi
    Jan 9 at 17:17

















thank you @sourcejedi , I edited.

– Milad
Jan 9 at 5:26





thank you @sourcejedi , I edited.

– Milad
Jan 9 at 5:26













Thanks! Do you know what the host environment is - version of LXC, version of host OS, is it using AppArmor in combination with LXC?

– sourcejedi
Jan 9 at 17:17





Thanks! Do you know what the host environment is - version of LXC, version of host OS, is it using AppArmor in combination with LXC?

– sourcejedi
Jan 9 at 17:17










1 Answer
1






active

oldest

votes


















1














Ubuntu12.04: How to disable a daemon process at startup



Debian Bug report logs - #620921
udev: Please detect lxc, and don't try to start there




At the first glance udev events are supported in the container. But for
the sake of optimization, I recommend to not use it as it will trigger
the events in all the containers.




In case the above is not clear, I suggest killing it with fire. Usually it would not be desirable for udev inside a container to be even thinking about touching sda etc. Usually there would not be anything that you would want udev to do.



Reading the following, you might guess my answer is toeing the systemd party line :-). Apparently LXC had some different opinions, at least at one time: https://stgraber.org/2013/12/21/lxc-1-0-your-second-container/#comments



I believe the commenter "wwwwww" is a pseudonym (!) of the systemd lead Lennart Poettering. Either that, or someone did a great imitation matching his writing style and his position on this issue :-).



Perhaps someone more familiar with LXC would know exactly which combinations of udev and LXC setups that LXC expects to do anything useful. And what conditions might generate a warning message like this. The above link offered a date range for Ubuntu, which claims the original Ubuntu 12.04 release should be fine. However it does not say whether or not it emits any spurious warnings. (It wouldn't be the first piece of software to do so:-))



Whatever the merits, if you don't need to access any physical device from inside LXC, disabling udev would seem a simple way to avoid seeing any udev warnings. "While we wait for people to figure out exactly how a device namespace should work". The LXC developer mentions "this is far from ideal" :-). This was in 2013, and there is still no device namespace (as of Linux v4.20).



The next relevant comment seems to be "Our default configuration will let udev create device nodes but only access those that are allowed in the configuration." In that sense your LXC was working as LXC want it to: it allowed you to create a device node /dev/sda, but did not allow you to access it.



I do not know why your udev creates /dev/sda, (presumably) does not complain about being unable to run blkid on it, but does complain about not being to watch it.





The kernel (as of v4.20) does not provide isolation for devices. There is no namespace for devices. Compared e.g. to network namespaces, which allow isolating network interfaces. For the list of namespaces which can be isolated, look in man 7 namespaces or man 2 clone.



If you're curious what a principled container runtime can do, the answer is that it can disable access to all devices (except a few virtual ones like /dev/null, /dev/pts/*, etc). I am more familiar with systemd-nspawn (and its documentation). At least with cgroups v1, nspawn uses the device control group to disable access to devices. cgroups v2 eventually gained an equivalent feature. In the mean time, nspawn prevents you from creating a device node by using seccomp(), and that works pretty well. Of course this means you must trust the container filesystem image not to contain the any of the "wrong" device nodes, so the cgroup solution is better.



Current systemd-udevd.service detects that it should not run if /sys has been mounted read-only.






share|improve this answer


























  • Thank you very much, but how can I be sure that it does not support or run udev correctly and can I check with "ps -ef | grep udev " command if it works on or not? and is there any other way to run it and not just disable it.

    – Milad
    Jan 9 at 14:52






  • 1





    @Milad I would ask what your plans are, that you want to be able to access physical devices from inside LXC. Otherwise I do not think there is any reason to want to run udev.

    – sourcejedi
    Jan 9 at 18:16











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493297%2fsource-of-this-error-udevd-pid-inotify-add-watch6-dev-sda-10-failed%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Ubuntu12.04: How to disable a daemon process at startup



Debian Bug report logs - #620921
udev: Please detect lxc, and don't try to start there




At the first glance udev events are supported in the container. But for
the sake of optimization, I recommend to not use it as it will trigger
the events in all the containers.




In case the above is not clear, I suggest killing it with fire. Usually it would not be desirable for udev inside a container to be even thinking about touching sda etc. Usually there would not be anything that you would want udev to do.



Reading the following, you might guess my answer is toeing the systemd party line :-). Apparently LXC had some different opinions, at least at one time: https://stgraber.org/2013/12/21/lxc-1-0-your-second-container/#comments



I believe the commenter "wwwwww" is a pseudonym (!) of the systemd lead Lennart Poettering. Either that, or someone did a great imitation matching his writing style and his position on this issue :-).



Perhaps someone more familiar with LXC would know exactly which combinations of udev and LXC setups that LXC expects to do anything useful. And what conditions might generate a warning message like this. The above link offered a date range for Ubuntu, which claims the original Ubuntu 12.04 release should be fine. However it does not say whether or not it emits any spurious warnings. (It wouldn't be the first piece of software to do so:-))



Whatever the merits, if you don't need to access any physical device from inside LXC, disabling udev would seem a simple way to avoid seeing any udev warnings. "While we wait for people to figure out exactly how a device namespace should work". The LXC developer mentions "this is far from ideal" :-). This was in 2013, and there is still no device namespace (as of Linux v4.20).



The next relevant comment seems to be "Our default configuration will let udev create device nodes but only access those that are allowed in the configuration." In that sense your LXC was working as LXC want it to: it allowed you to create a device node /dev/sda, but did not allow you to access it.



I do not know why your udev creates /dev/sda, (presumably) does not complain about being unable to run blkid on it, but does complain about not being to watch it.





The kernel (as of v4.20) does not provide isolation for devices. There is no namespace for devices. Compared e.g. to network namespaces, which allow isolating network interfaces. For the list of namespaces which can be isolated, look in man 7 namespaces or man 2 clone.



If you're curious what a principled container runtime can do, the answer is that it can disable access to all devices (except a few virtual ones like /dev/null, /dev/pts/*, etc). I am more familiar with systemd-nspawn (and its documentation). At least with cgroups v1, nspawn uses the device control group to disable access to devices. cgroups v2 eventually gained an equivalent feature. In the mean time, nspawn prevents you from creating a device node by using seccomp(), and that works pretty well. Of course this means you must trust the container filesystem image not to contain the any of the "wrong" device nodes, so the cgroup solution is better.



Current systemd-udevd.service detects that it should not run if /sys has been mounted read-only.






share|improve this answer


























  • Thank you very much, but how can I be sure that it does not support or run udev correctly and can I check with "ps -ef | grep udev " command if it works on or not? and is there any other way to run it and not just disable it.

    – Milad
    Jan 9 at 14:52






  • 1





    @Milad I would ask what your plans are, that you want to be able to access physical devices from inside LXC. Otherwise I do not think there is any reason to want to run udev.

    – sourcejedi
    Jan 9 at 18:16
















1














Ubuntu12.04: How to disable a daemon process at startup



Debian Bug report logs - #620921
udev: Please detect lxc, and don't try to start there




At the first glance udev events are supported in the container. But for
the sake of optimization, I recommend to not use it as it will trigger
the events in all the containers.




In case the above is not clear, I suggest killing it with fire. Usually it would not be desirable for udev inside a container to be even thinking about touching sda etc. Usually there would not be anything that you would want udev to do.



Reading the following, you might guess my answer is toeing the systemd party line :-). Apparently LXC had some different opinions, at least at one time: https://stgraber.org/2013/12/21/lxc-1-0-your-second-container/#comments



I believe the commenter "wwwwww" is a pseudonym (!) of the systemd lead Lennart Poettering. Either that, or someone did a great imitation matching his writing style and his position on this issue :-).



Perhaps someone more familiar with LXC would know exactly which combinations of udev and LXC setups that LXC expects to do anything useful. And what conditions might generate a warning message like this. The above link offered a date range for Ubuntu, which claims the original Ubuntu 12.04 release should be fine. However it does not say whether or not it emits any spurious warnings. (It wouldn't be the first piece of software to do so:-))



Whatever the merits, if you don't need to access any physical device from inside LXC, disabling udev would seem a simple way to avoid seeing any udev warnings. "While we wait for people to figure out exactly how a device namespace should work". The LXC developer mentions "this is far from ideal" :-). This was in 2013, and there is still no device namespace (as of Linux v4.20).



The next relevant comment seems to be "Our default configuration will let udev create device nodes but only access those that are allowed in the configuration." In that sense your LXC was working as LXC want it to: it allowed you to create a device node /dev/sda, but did not allow you to access it.



I do not know why your udev creates /dev/sda, (presumably) does not complain about being unable to run blkid on it, but does complain about not being to watch it.





The kernel (as of v4.20) does not provide isolation for devices. There is no namespace for devices. Compared e.g. to network namespaces, which allow isolating network interfaces. For the list of namespaces which can be isolated, look in man 7 namespaces or man 2 clone.



If you're curious what a principled container runtime can do, the answer is that it can disable access to all devices (except a few virtual ones like /dev/null, /dev/pts/*, etc). I am more familiar with systemd-nspawn (and its documentation). At least with cgroups v1, nspawn uses the device control group to disable access to devices. cgroups v2 eventually gained an equivalent feature. In the mean time, nspawn prevents you from creating a device node by using seccomp(), and that works pretty well. Of course this means you must trust the container filesystem image not to contain the any of the "wrong" device nodes, so the cgroup solution is better.



Current systemd-udevd.service detects that it should not run if /sys has been mounted read-only.






share|improve this answer


























  • Thank you very much, but how can I be sure that it does not support or run udev correctly and can I check with "ps -ef | grep udev " command if it works on or not? and is there any other way to run it and not just disable it.

    – Milad
    Jan 9 at 14:52






  • 1





    @Milad I would ask what your plans are, that you want to be able to access physical devices from inside LXC. Otherwise I do not think there is any reason to want to run udev.

    – sourcejedi
    Jan 9 at 18:16














1












1








1







Ubuntu12.04: How to disable a daemon process at startup



Debian Bug report logs - #620921
udev: Please detect lxc, and don't try to start there




At the first glance udev events are supported in the container. But for
the sake of optimization, I recommend to not use it as it will trigger
the events in all the containers.




In case the above is not clear, I suggest killing it with fire. Usually it would not be desirable for udev inside a container to be even thinking about touching sda etc. Usually there would not be anything that you would want udev to do.



Reading the following, you might guess my answer is toeing the systemd party line :-). Apparently LXC had some different opinions, at least at one time: https://stgraber.org/2013/12/21/lxc-1-0-your-second-container/#comments



I believe the commenter "wwwwww" is a pseudonym (!) of the systemd lead Lennart Poettering. Either that, or someone did a great imitation matching his writing style and his position on this issue :-).



Perhaps someone more familiar with LXC would know exactly which combinations of udev and LXC setups that LXC expects to do anything useful. And what conditions might generate a warning message like this. The above link offered a date range for Ubuntu, which claims the original Ubuntu 12.04 release should be fine. However it does not say whether or not it emits any spurious warnings. (It wouldn't be the first piece of software to do so:-))



Whatever the merits, if you don't need to access any physical device from inside LXC, disabling udev would seem a simple way to avoid seeing any udev warnings. "While we wait for people to figure out exactly how a device namespace should work". The LXC developer mentions "this is far from ideal" :-). This was in 2013, and there is still no device namespace (as of Linux v4.20).



The next relevant comment seems to be "Our default configuration will let udev create device nodes but only access those that are allowed in the configuration." In that sense your LXC was working as LXC want it to: it allowed you to create a device node /dev/sda, but did not allow you to access it.



I do not know why your udev creates /dev/sda, (presumably) does not complain about being unable to run blkid on it, but does complain about not being to watch it.





The kernel (as of v4.20) does not provide isolation for devices. There is no namespace for devices. Compared e.g. to network namespaces, which allow isolating network interfaces. For the list of namespaces which can be isolated, look in man 7 namespaces or man 2 clone.



If you're curious what a principled container runtime can do, the answer is that it can disable access to all devices (except a few virtual ones like /dev/null, /dev/pts/*, etc). I am more familiar with systemd-nspawn (and its documentation). At least with cgroups v1, nspawn uses the device control group to disable access to devices. cgroups v2 eventually gained an equivalent feature. In the mean time, nspawn prevents you from creating a device node by using seccomp(), and that works pretty well. Of course this means you must trust the container filesystem image not to contain the any of the "wrong" device nodes, so the cgroup solution is better.



Current systemd-udevd.service detects that it should not run if /sys has been mounted read-only.






share|improve this answer















Ubuntu12.04: How to disable a daemon process at startup



Debian Bug report logs - #620921
udev: Please detect lxc, and don't try to start there




At the first glance udev events are supported in the container. But for
the sake of optimization, I recommend to not use it as it will trigger
the events in all the containers.




In case the above is not clear, I suggest killing it with fire. Usually it would not be desirable for udev inside a container to be even thinking about touching sda etc. Usually there would not be anything that you would want udev to do.



Reading the following, you might guess my answer is toeing the systemd party line :-). Apparently LXC had some different opinions, at least at one time: https://stgraber.org/2013/12/21/lxc-1-0-your-second-container/#comments



I believe the commenter "wwwwww" is a pseudonym (!) of the systemd lead Lennart Poettering. Either that, or someone did a great imitation matching his writing style and his position on this issue :-).



Perhaps someone more familiar with LXC would know exactly which combinations of udev and LXC setups that LXC expects to do anything useful. And what conditions might generate a warning message like this. The above link offered a date range for Ubuntu, which claims the original Ubuntu 12.04 release should be fine. However it does not say whether or not it emits any spurious warnings. (It wouldn't be the first piece of software to do so:-))



Whatever the merits, if you don't need to access any physical device from inside LXC, disabling udev would seem a simple way to avoid seeing any udev warnings. "While we wait for people to figure out exactly how a device namespace should work". The LXC developer mentions "this is far from ideal" :-). This was in 2013, and there is still no device namespace (as of Linux v4.20).



The next relevant comment seems to be "Our default configuration will let udev create device nodes but only access those that are allowed in the configuration." In that sense your LXC was working as LXC want it to: it allowed you to create a device node /dev/sda, but did not allow you to access it.



I do not know why your udev creates /dev/sda, (presumably) does not complain about being unable to run blkid on it, but does complain about not being to watch it.





The kernel (as of v4.20) does not provide isolation for devices. There is no namespace for devices. Compared e.g. to network namespaces, which allow isolating network interfaces. For the list of namespaces which can be isolated, look in man 7 namespaces or man 2 clone.



If you're curious what a principled container runtime can do, the answer is that it can disable access to all devices (except a few virtual ones like /dev/null, /dev/pts/*, etc). I am more familiar with systemd-nspawn (and its documentation). At least with cgroups v1, nspawn uses the device control group to disable access to devices. cgroups v2 eventually gained an equivalent feature. In the mean time, nspawn prevents you from creating a device node by using seccomp(), and that works pretty well. Of course this means you must trust the container filesystem image not to contain the any of the "wrong" device nodes, so the cgroup solution is better.



Current systemd-udevd.service detects that it should not run if /sys has been mounted read-only.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 12 at 10:56

























answered Jan 9 at 9:51









sourcejedisourcejedi

23.3k437103




23.3k437103













  • Thank you very much, but how can I be sure that it does not support or run udev correctly and can I check with "ps -ef | grep udev " command if it works on or not? and is there any other way to run it and not just disable it.

    – Milad
    Jan 9 at 14:52






  • 1





    @Milad I would ask what your plans are, that you want to be able to access physical devices from inside LXC. Otherwise I do not think there is any reason to want to run udev.

    – sourcejedi
    Jan 9 at 18:16



















  • Thank you very much, but how can I be sure that it does not support or run udev correctly and can I check with "ps -ef | grep udev " command if it works on or not? and is there any other way to run it and not just disable it.

    – Milad
    Jan 9 at 14:52






  • 1





    @Milad I would ask what your plans are, that you want to be able to access physical devices from inside LXC. Otherwise I do not think there is any reason to want to run udev.

    – sourcejedi
    Jan 9 at 18:16

















Thank you very much, but how can I be sure that it does not support or run udev correctly and can I check with "ps -ef | grep udev " command if it works on or not? and is there any other way to run it and not just disable it.

– Milad
Jan 9 at 14:52





Thank you very much, but how can I be sure that it does not support or run udev correctly and can I check with "ps -ef | grep udev " command if it works on or not? and is there any other way to run it and not just disable it.

– Milad
Jan 9 at 14:52




1




1





@Milad I would ask what your plans are, that you want to be able to access physical devices from inside LXC. Otherwise I do not think there is any reason to want to run udev.

– sourcejedi
Jan 9 at 18:16





@Milad I would ask what your plans are, that you want to be able to access physical devices from inside LXC. Otherwise I do not think there is any reason to want to run udev.

– sourcejedi
Jan 9 at 18:16


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493297%2fsource-of-this-error-udevd-pid-inotify-add-watch6-dev-sda-10-failed%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre