Operating System - HP-UX
1823308 Members
3346 Online
109653 Solutions
New Discussion юеВ

HPUX 11.X file permisions query

 
Suresh_36
Occasional Advisor

HPUX 11.X file permisions query


One of our daemon during runtime creates files with 666 permissions.But at the customer site we observed that it creates 644. I
checked umask on the customer system. It is same as mine 022. I don't see any issue in that. All our daemons run as root.

All these files are opened and processed.There are roughly 19000 files.All the file descriptors are opened and closed properly while processing.While some of the files gets processed fine with the above permission. But randomly it fails at some file.After that all other files fails with permission denied EACCES 13 while trying to open those files for processing.

What can be the reason ? Any pointers are highly appreciated ...


Thanks and Regards
Suresh



12 REPLIES 12
T G Manikandan
Honored Contributor

Re: HPUX 11.X file permisions query

What do you mean by a daemon?
Is that a script which does this?
Then check that out whether any permission handling is done there.

REvert
Mark Grant
Honored Contributor

Re: HPUX 11.X file permisions query

If the permissions are being created incorrectly, it is 99% certain that umask is set wrong somewhere. However, as your appliaction runs as root, this probably isn't the problem.

Firstly, does the customer site have ACL's. I'm not sure if they are relevant but I hope so because the only other thing that sort of makes sense to me is filesystem corruption.
Never preceed any demonstration with anything more predictive than "watch this"
Steven E. Protter
Exalted Contributor

Re: HPUX 11.X file permisions query

Seems likely you are running into a kernel limit.

My guess based on this info is nfiles.

nfiles/nproc can be raised by increaseing the maxusers parameter.

sam
kernel
configurable parameters

bump up maxusers, process new kernel boot.

There are other possible causes including poorly written "daemons"

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Suresh_36
Occasional Advisor

Re: HPUX 11.X file permisions query

I checked customer's umask .It is 022 same as my system. In my system files gets created with 666.
The files created on customer system are having 644 most of the times.


The problem is happening on 3 of the customer systems.How can I confirm is it because of file system corruption.?
T G Manikandan
Honored Contributor

Re: HPUX 11.X file permisions query

Any problems things are logged to /var/adm/syslog/syslog.log

If the case was of any file system problem check this log for any errors!
Suresh_36
Occasional Advisor

Re: HPUX 11.X file permisions query

I checked up the code. The file descriptors are opened and closed properly. I doubt if that can be any issue with nfiles. However I will check this with the customer.Any other pointers....
Suresh_36
Occasional Advisor

Re: HPUX 11.X file permisions query

I checked up the syslog file
I see the following
What does this mean ?

NSTATS 1074494784 1073904383 A=2506 PTR=172526
XSTATS 1074494784 1073904383 RR=3406 RNXD=3405 RFwdR=3406 RDupR=0 RFail=0 RFErr=0 RErr=0 RAXFR=0 RLame=0 ROpts=0 SSysQ=22 SAns=15765 SFwdQ=158483 SDupQ=1240502 SErr=0 RQ=175032 RIQ=0 RFwdQ=158483 RDupQ=784 RTCP=0 SFwdR=3406 SFail=154987 SFErr=0 SNaAns=0 SNXD=15744



T G Manikandan
Honored Contributor

Re: HPUX 11.X file permisions query

Those messages are from DNS
Jeroen Peereboom
Honored Contributor

Re: HPUX 11.X file permisions query

Suresh,

you talk about daemons. So these are started at boot time. How do you check the umask setting?
I think it's not enough to login as root and type 'umask'. The init process, that starts all daemons using rc, but it doesn't use something like /etc/profile for setting some variables or the umask.

Did you check the startup scripts of these daemons? What happens if you just add a line 'umask 022' to the startup script?

I have no solution for your access denied error.

JP
Suresh_36
Occasional Advisor

Re: HPUX 11.X file permisions query

Hi,
These daemons are started at boot time. But the customer stops and starts the daemons everyday to take some backup. I will check the customer to set proper umask for the shell in which they are starting the daemons.

What else cam be the reasons for Permssion Access denied.
Jeroen Peereboom
Honored Contributor

Re: HPUX 11.X file permisions query

Suresh,

reading through the replies:
- If the error occurs for a file, opening all subsequent files give an error. I think this means your daemon is 'poorly written'. Are you sure the files are always closed? Can you trace opening and closing files to make really sure all files opened are also closed?
- Not an NFS filesystem, I assume.
- If you suspect the filesystem, unmount it and do an fsck.


JP
Suresh_36
Occasional Advisor

Re: HPUX 11.X file permisions query

I checked all my functions for descriptors. The file descriptors open/close is done properly.However, are there any specific patches for HPUX11.X w.r.t file descriptors ?