Article 4VKB6 Sometimes lxc-slackware breaks due to erroneously created ${DEV}/null file

Sometimes lxc-slackware breaks due to erroneously created ${DEV}/null file

by
crts
from LinuxQuestions.org on (#4VKB6)
Some packages may redirect stderr to /dev/null during container creation. When the script tries to execute
Code:mknod -m 666 ${DEV}/null c 1 3in the configuration stage it will abort with an error. This patch mitigates the problem.
Code:--- lxc-slackware.org 2019-11-24 10:50:33.428626035 +0100
+++ lxc-slackware.mod 2019-11-24 11:02:37.717571177 +0100
@@ -90,6 +90,12 @@
# http://www.vislab.uq.edu.au/howto/lxc/MAKEDEV.sh
DEV=$rootfs/dev
mkdir -p ${DEV}
+
+# Some install scripts may have redirected stderr to
+# /dev/null and thus created a file named /dev/null.
+# It must be removed before attempting to create
+# the device /dev/null.
+[[ -e ${DEV}/null ]] && rm -rf ${DEV}/null
mknod -m 666 ${DEV}/null c 1 3
mknod -m 666 ${DEV}/zero c 1 5
mknod -m 666 ${DEV}/random c 1 8PS:
I am aware that the test '[[ -e ${DEV}/null ]]' is probably redundant and that I am overly cautious here.latest?d=yIl2AUoC8zA latest?i=cVlN0i2ZZe8:LBAJqqKYAhs:F7zBnMy latest?i=cVlN0i2ZZe8:LBAJqqKYAhs:V_sGLiP latest?d=qj6IDK7rITs latest?i=cVlN0i2ZZe8:LBAJqqKYAhs:gIN9vFwcVlN0i2ZZe8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments