Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a directory with log files and I'm putting logs from script launched by users into them. Logging with syslog isn't possible in this case.

I want the users to have only write permissions on log files. The problem is, that write permissions must be restricted, so that they can only append to that files. The underlying filesystem is XFS.

The following doesn't work:

# chattr +a test.log
chattr: Inappropriate ioctl for device while reading flags on test.log

Is there any other solution for this? Thank you for your hints.

Update:

The solution was:

# xfs_io
> open test.log
> chattr +a
> close
share|improve this question
    
Sounds like a job for access control lists (ACLs). Search for this on google or SF. –  slm Dec 30 '12 at 14:59
    
Which version of Linux, kernel, distribution? –  ewwhite Dec 30 '12 at 17:07
1  
    
Already asked for deletion there. Sorry for that. –  metalhead Dec 31 '12 at 9:58

1 Answer 1

up vote 3 down vote accepted

AFAIK chattr only works on ext* (ext{2,3,4}) and some other specific filesystems. The xfs_io man page does mention chattr though.

share|improve this answer
    
Actually, this worked out pretty well for me. Thank you. I had to open files through xfs_io and then used chattr command on them. –  metalhead Dec 30 '12 at 17:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.