Solved

permissions for file written by script

Posted on 2004-10-09
4
266 Views
Last Modified: 2010-04-20
I'm trying to write a perl script to write a file that will be readable by a tomcat program.  The script is admin.pl in a cgi-bin directory of a domain and the file has owner fv88 and group psacln.  The file I'm trying to a file (home.jsp) in a subdir of the tomcat4 directory.  Files in that directory have the owner as root and group as tomcat4.

I've tried the following without success:
1. chmod home.jsp to 777.  This is a plesk server with umask of 022, and plesk doesn't like 777 (but I don't know if that matters here or not).
2. added fv88 to the tomcat4 group.

How can I configure things so the script admin.pl will overwrite home.jsp?

msibley
0
Comment
Question by:msibley
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
owensleftfoot earned 125 total points
ID: 12267740
The user that the script runs as will need write access to the directory  home.jsp is in.
0
 

Author Comment

by:msibley
ID: 12268506
Wouldn't either of 1 or 2 above have done that?  Do scripts run as a different user than the owner of the script file?
msibley
0
 

Author Comment

by:msibley
ID: 12268645
figured it out . . . it was a permissions problem in a directory up the tree.

Thanks anyway, I'll give you the pts.

msibley
0
 
LVL 1

Expert Comment

by:jeffparis
ID: 13701159
in php, I know I have to do this before chmodding:

            $o_umask = umask(0);
                  

And this after chmodding:
            umask($o_umask);


0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Ubuntu not booting - How get past GRUB? 3 57
number in printf 13 32
LogmeIn using Linux Ubuntu 16.04 6 63
parallel rsync issues with Ubuntu 1 27
Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question