1831185 Members
2863 Online
110021 Solutions
New Discussion

Write permissions

 
Ricardo_19
Occasional Advisor

Write permissions

Hy guys. I have 3 server HP-UX 11.0 I'm using server2 and when the user oraprod using the applicattion or using rlogin or remsh, writes anything on server3 under /usr/tmp, the file permissions are rw------ , but when this user is logged in server3 the file is 664. When I do de same from server2 to server1 the file is 664 too. I'd like that the user under server2 using rlogin or other writes 664 under /var/tmp under oracle3. Can anybody help me? Why is this happening? Thanks in advance!
Just do it
12 REPLIES 12
John Palmer
Honored Contributor

Re: Write permissions

Look for a umask command in the login scripts..
/etc/profile
Users .profile

Regards,
John
Christopher McCray_1
Honored Contributor

Re: Write permissions

Hello,

What is the umask set to in /etc/profile?

Is it different then what is set up for the user remsh'ing into as?

You may want to source in the .profile prior to running commands, like in the example given in the man pages:

# remsh otherhost . .profile 2>&- \; command

Hope this helps

Chris
It wasn't me!!!!
Robert-Jan Goossens
Honored Contributor

Re: Write permissions

Hi,

You can check umask on server server3.


Kind regards,

Robert-Jan.
Ricardo_19
Occasional Advisor

Re: Write permissions

Thank you John, but I looked the files and they're the same. Do you have any other suggestion?
Just do it
Ricardo_19
Occasional Advisor

Re: Write permissions

Guys, I must be doing some thing wrong, and I don't know if I made myself clear. The application on server2 use the user 'oraprod' to write files into server3 under /usr/tmp and use the user 'oratest' to write files into server1 under /usr/tmp but the files in server1 keeps 664 and and server3 keeps 6--. But if write directly in the directory in server3 the files are created with 664. I need 664 even with the remote conexion. Thank you for your help.
Just do it
Ricardo_19
Occasional Advisor

Re: Write permissions

And the /etc/profile are the same in the 3 servers
Just do it
Bill Hassell
Honored Contributor

Re: Write permissions

You need to type the command: umask
when logged in as each user. Something you may have missed in the description: are you using Xwindows? If so, you may be getting messed up with the no-profile startup that is the default (dumb as it sounds) for CDE environment. The key is that there must be an explicit umask set for the default creation of files. Another thing is the method of creation: are you using vi or touch? Or are you using an Oracle program to create the files?

To simplify, use an explicit telnet session to each server, then touch a file in /var/tmp (there is no such thing as /usr/tmp--it was obsolete 10 years ago and replaced with a temporary symlink, see man tlinstall). Check the results. Then do the same with rlogin. NOTE: this is from Unix to Unix...using Unix commands on a Windows PC throws in some additional uncertainty.

And finally, remsh will always bypass the login profiles so you must explicitly set permissions. rcp requires -p to retain the permissions of the source file at the destination. telnet, remsh, rlogin and remsh are not equivalent commands nor do they inherit the same environment.


Bill Hassell, sysadmin
Ricardo_19
Occasional Advisor

Re: Write permissions

Guys, you were all rights. I'm sorry I'm new using HP-UX. Bill you opened my mind. I've changed the umask under /etc/profile and now, rlogin, remsh and telnet are working as I wish. But the files handled by database are still in 600 format. I dont't know which file I have to modify. I'm using OracleApplicattions on Server2 I use a user to login into this and background, I think that appltest make a conexion whith server3 and the user oraprod is responsable for creating the files. I tried to change the .login and .profile (oraprod) but this didn't work. Can you help me a little bit more? Thank you a lot.
Just do it
Jean-Luc Oudart
Honored Contributor

Re: Write permissions

What user do you use to start the listener / application server ?
What are the permissions (umask) of this user when you 1st started the services ?

Jean-Luc
fiat lux
John Palmer
Honored Contributor

Re: Write permissions

Have you restarted your application? umask is a setting associated with a process and is inherited from its parent. After changing the .profile, you'd have to restart all the processes.

Also, I'd look to add the umask command to the script that starts the application, rather than relying on .profile. That way you know exactly what the umask setting is and are not relying on the inherited setting.

Regards,
John

Gerhard Roets
Esteemed Contributor

Re: Write permissions

It is important to note that umask is only applicable to new files being created. Current file permissions will not be automagically be updated. If you need the current existing file permissions changed you will need to do them manually with the chmod command.

Gerhard
Ricardo_19
Occasional Advisor

Re: Write permissions

I really restarted the application, to tell you the true, I stoped the application and the database, and started all over again. It's getting a little confused for me because I'm not so good dealing with oracle database, I used to be a windows guy. I found the script that start the appl, but I couldn't found anything there, so I put the umask 00 into the file, but that didn't work either and the script (appl_start.sh) in this case call other scripts, other interesting thing is that in server1 everything is working fine, and when I compare the files its all the same, as far as I could see of course, the directory permissions, the owner, the scripts etc. But ok guys, thank you a lot for your help and comments. I don't want to disturb you anymore with this doubt. I'll try to verify other files and search a little more in order to correct the problem, and carefully follow everythind you said to me. Rgs.
Just do it