Why files get created with srwxrwxrwt under /dev/?


 
Thread Tools Search this Thread
Operating Systems Solaris Why files get created with srwxrwxrwt under /dev/?
# 1  
Old 09-15-2015
Why files get created with srwxrwxrwt under /dev/?

Code:
$ uname -a
SunOS myhost 5.11 11.2 sun4v sparc sun4v

I see following 0 byte (regular)files getting created under /dev/mydisks directory :

Code:
srwxrwxrwt   1 gusr   dba       0 Sep 14 23:57 VF_10
srwxrwxrwt   1 gusr   dba       0 Sep 14 23:57 DATA1
srwxrwxrwt   1 gusr   dba       0 Sep 14 23:57 DATA2

Code:
$ echo test > testfile
bash: testfile: Permission denied

Even though the command above returns an error I see the file being created with 'srwxrwxrwt'
Code:
$ ls -ltr
total 0
srwxrwxrwt   1 gusr   dba       0 Sep 14 23:57 testfile
srwxrwxrwt   1 gusr   dba       0 Sep 14 23:57 VF_10
srwxrwxrwt   1 gusr   dba       0 Sep 14 23:57 DATA1
srwxrwxrwt   1 gusr   dba       0 Sep 14 23:57 DATA2

$ file testfile
testfile:       socket

Note that this happens for regular files only under /dev directory. What setting or env. is causing this behavior?
Why 0 byte files? Why regular files get 'srwxrwxrwt' under /dev?
Are these really 'socket' files?

Last edited by DukeNuke2; 09-15-2015 at 03:56 AM..
# 2  
Old 09-15-2015
They are not regular files, which permissions would have started with a dash, but file named domain sockets as file rightly reports.

Last edited by jlliagre; 09-15-2015 at 07:16 AM..
# 3  
Old 09-15-2015
Well, my concern is when I try to create a regular file under /dev it gets created as 0 byte file with srwxrwxrwt. Why?
# 4  
Old 09-15-2015
Are you creating them, though? In your test above you get 'permission denied'. Which is what you'd expect trying to write to socket files, which don't work that way.
# 5  
Old 09-15-2015
My intention is to create a text file under /dev directory.
But whenever I try creating it through a program or even from the command line as mentioned earlier they get created as 'socket' files. Some weird process is doing this.
# 6  
Old 09-15-2015
I wonder if it's some odd property of the filesystem itself. I don't know Solaris in any detail but /dev/ is often its own pseudo-filesystem with unusual properties. Usually one doesn't make txt files under /dev.
# 7  
Old 09-15-2015
In fact, /dev is not a regular file system.

Source code for the open call on Illumos /dev file system is here: Cross Reference: /illumos-gate/usr/src/uts/common/fs/dev/sdev_vnops.c It's been a few years since that was forked from OpenSolaris code, but it's probably still really close to Solaris 11.2 /dev file system code.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automating partitioning setup of /dev/sda on /dev/sdc

Objective: To recreate the partitioning setup of /dev/sda on /dev/sdc How would I parse the below information and initialize variables (an array?) that can be used to build sgdisk commands in a script, regardless of the number of partitions? Something along the lines of: sgdisk -n... (12 Replies)
Discussion started by: RogerBaran
12 Replies

2. Shell Programming and Scripting

Listing the file name and no of records in each files for the files created on a specific day

Hi, I want to display the file names and the record count for the files in the 2nd column for the files created today. i have written the below command which is listing the file names. but while piping the above command to the wc -l command its not working for me. ls -l... (5 Replies)
Discussion started by: Showdown
5 Replies

3. Solaris

Lun remove, stuck in /dev/dsk and /dev/rdsk

So, we removed a LUN from the SAN and the system is refusing to remove the references to it in the /dev folder. I've done the following: devfsadm -Cv powermt -q luxadm -e offline <drive path> luxadm probe All those commands failed to remove the path. The drive stills shows up as <drive... (13 Replies)
Discussion started by: DustinT
13 Replies

4. Red Hat

Info on /dev/dm files

Hi, I was looking at my /dev directory and found some files of the pattern dm?. I searched on google and found that it is a device manager file for LVM. But nothing but that. Can someone give me some info on when these files are created and if we can use this as instead of... (7 Replies)
Discussion started by: prithvirao17
7 Replies

5. Shell Programming and Scripting

Count todays created files and old files

Hello experts, I used following approach to get listing of all files of remote server. Now I have remote server file information on same server. I am getting listing in the output.txt I want to count today's created files and old files. I want to compare the numbers... (11 Replies)
Discussion started by: dipeshvshah
11 Replies

6. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies

7. UNIX for Dummies Questions & Answers

Files created by particular user

How i get the all the files created by particular user?? (2 Replies)
Discussion started by: Anshu
2 Replies

8. UNIX for Dummies Questions & Answers

files created within last 10 mins

Any simple 1 liners to check a directory to see if a file was created within the last 10 mins? (5 Replies)
Discussion started by: frustrated1
5 Replies

9. UNIX for Dummies Questions & Answers

Two Files Created For Every One?

Hello, my linux box is, for some reason, creating two files when I creat one. For example, if I create a file via the VI editor called TestFile, the box will create: TestFile TestFile~ Does anyone have any ideas as to why I'm getting that second file with the ~ at the end of it? ... (1 Reply)
Discussion started by: Atama
1 Replies

10. UNIX for Dummies Questions & Answers

mv files to /dev/null

im having trouble with moving files in a directory into /dev/null for file in $HOME/.trashcan/ do mv $file /dev/null done the error msg i get is: mv: /dev/null: not a directory. does anyone know how to fix this? thanks primal (16 Replies)
Discussion started by: primal
16 Replies
Login or Register to Ask a Question