1

I am using /dev/xconsole to send system logs from rsyslog. That works great, because I am don't have to store the logs on disk.

I would like to have another similar file , i.e /dev/xconsole1 where I can send other kind of logs.

How can I create such special file?

When I go to /dev and ls it does not show complete major/minor number:

prw-r----- 1 root adm           0  2014-Oct-11  13:12:02  xconsole

it only shows 0. In contrast, other special files have both.

brw-rw---T 1 root disk     8,   1  2014-Oct-08  03:42:35  sda1

I know how to create special files using mknod, but to do that, I need the major/minor number.

1 Answer 1

4

Not every file under /dev is a device file that has major/minor numbers.

Example

$ ls -l |grep initctl
prw-------. 1 root root             0 Sep 17 13:27 initctl

$ stat initctl 
  File: ‘initctl’
  Size: 0           Blocks: 0          IO Block: 4096   fifo
Device: 5h/5d   Inode: 8882        Links: 1
Access: (0600/prw-------)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:initctl_t:s0
Access: 2014-09-17 13:27:12.140761620 -0400
Modify: 2014-09-17 13:27:12.140761620 -0400
Change: 2014-09-17 13:27:12.140761620 -0400
 Birth: -

Files with a p...... in their permissions bits are named pipes, and are created using mkfifo.

References

3
  • on my system, /dev/xconsole gets created automatically. How can I find out who creates it? And in case I need a second file (/dev/xconsole2), how can I make it to be created automatically as well? Nov 14, 2014 at 11:56
  • @MartinVegter - It's likely being created by udev. I'd ask it as a new Q though.
    – slm
    Nov 15, 2014 at 3:08
  • I have asked a new question as you suggested Nov 16, 2014 at 3:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .