LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-13-2006, 12:44 AM   #1
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Rep: Reputation: 30
/var/spool/postfix/trace/ permissions


here is something i have noticed, when i change the permissions on

/var/spool/postfix/trace/rolesj

the permissions on

/var/spool/mail/rolesj

change. Neither are links ...

[root@mail trace]# ls -lsa /var/spool/mail/rolesj
0 -rw------- 2 rolesj mail 0 May 2 13:41 /var/spool/mail/rolesj

[root@mail trace]# ls -lsa /var/spool/postfix/trace/rolesj
0 -rw------- 2 rolesj mail 0 May 2 13:41 /var/spool/postfix/trace/rolesj

when i restart postfix i get these error messages.

Jun 13 12:59:16 mail postfix/postfix-script: warning: not owned by
postfix: /var/spool/postfix/trace/smithh

etc,etc,etc

but if i change the permission on these files to make postfix the owner
then my users can't access there mail boxes...
 
Old 06-13-2006, 03:15 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You are incorrect. These files ARE links to something - most likely each other. You may be confused because they are hard links rather than symbolic links.

With a symbolic link the link has an "l" in first position of permissions then has --> pointing to the regular file to which it is linked. For hard links both items have the same information except for name because both are actually using the same inode. A symbolic link doesn't use the same inode for the link - it has a separate inode that points to the inode of the file to which it is linked.

The number before the owner (user) of the file is the number of hard links. Both your files have a "2" meaning each has at least one link. Given that all other parameters than name are the same for both and the fact changing one changes the other its an odds on bet they are hard links of each other.

To verify it use the -i flag of ls as it shows you the inode.

See the following examples:

HARD LINKS:
#Create the original file
Code:
touch hardlink1
# Notice the file has a 1 before the owner (user)
Code:
ls -lsa hardlink1
0 -rw-r--r-- 1 jlightne jlightne 0 Jun 13 16:06 hardlink1

# Create hardlink2 as a HARD link of hardlink1
Code:
ln hardlink1 hardlink2
# Notice now both files exist and both have the same details except for name. Both also now have a 2 before the owner (user).
Code:
ls -lsa hardlink*
0 -rw-r--r-- 2 jlightne jlightne 0 Jun 13 16:06 hardlink1
0 -rw-r--r-- 2 jlightne jlightne 0 Jun 13 16:06 hardlink2

# List the files with the inodes. Notice both have the same inode number (4131).
Code:
ls -lsai hardlink*
4131 0 -rw-r--r-- 2 jlightne jlightne 0 Jun 13 16:06 hardlink1
4131 0 -rw-r--r-- 2 jlightne jlightne 0 Jun 13 16:06 hardlink2

SOFT LINKS
# Create the original file and list it as above - pretty much the same.

Code:
touch softlink1
Code:
ls -lsa softlink1
0 -rw-r--r-- 1 jlightne jlightne 0 Jun 13 16:06 softlink1

# Now create the soft link named softlink2 linked to softlink1
Code:
ln -s softlink1 softlink2
# Notice how the details of the two files are different. One is a regular file and the other is a symbolic link (a/k/a slink).
Code:
ls -lsa softlink*
0 -rw-r--r-- 1 jlightne jlightne 0 Jun 13 16:06 softlink1
0 lrwxrwxrwx 1 jlightne jlightne 9 Jun 13 16:07 softlink2 -> softlink1

# Doing ls asking for inode you see that they have two separate inodes (4132 and 4133 respectively).
Code:
ls -lsai softlink*
4132 0 -rw-r--r-- 1 jlightne jlightne 0 Jun 13 16:06 softlink1
4133 0 lrwxrwxrwx 1 jlightne jlightne 9 Jun 13 16:07 softlink2 -> softlink1

Edit: By name above I mean of course the fully qualified path name. The basenames of the files can be (and in your case are) the same so long as they are in different directories.

Also hard links can't cross filesystem boundaries but symbolic links can (in fact this was the main benefit to slinks when they were first introduced).

Last edited by MensaWater; 06-14-2006 at 12:06 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Import Mail from /var/spool/mail (sendmail) to a MailDir Format in Postfix shawnbishop Linux - Software 0 04-06-2006 10:44 AM
/usr/spool and /var/spool davidsrsb Slackware 1 04-06-2006 05:57 AM
Postfix $HOME/mail/inbox instead of /var/spool/mail ramram29 Linux - Software 3 08-08-2004 01:28 AM
postfix error procmail: Couldn't create "/var/spool/mail/ bentman78 Linux - Software 4 05-26-2004 12:04 AM
/var/spool/clientmqueue chintanDesai Linux - Software 0 03-22-2004 03:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration