« Back to Technical Questions

/dev/null is a regular file, mknod won't work

Combination View Flat View Tree View
Somehow /dev/null became a regular file.
 
bash-2.05b# ls -la /dev/null
-rw-r--r--  1 root root 0 Mar 18 10:11 /dev/null
 
I can remove the file, but as soon as I try to create it with mknod /dev/null c 1 3, i receive "Operation not permitted"
 
Does anyone know how to fix the problem?
 
 
Thanks!
Christian

Hi Christian,

Please try to built your application with capabilities for example:
@BCAPABILITIES=
SYS_NICE
NET_ADMIN
SYS_TIME
MKNOD
SYS_MODULE
SYS_ADMIN
SYS_CHROOT
@DEVFS=
/dev/loop0 b 7 0
/dev/loop1 b 7 1
/dev/loop2 b 7 2
/dev/null c 1 3
/dev/myown b 2 2

please refer Capabilities section in advanced guide in below url for more information

http://developer.cisco.com/web/axp/docs

Thanks,
raghavendra

Hi,

the application did work properly, and runs well on an other router. Somehow /dev/null became a regular file, so I would need a way to make it a character file again without redeploying the application.


Lg