Solved

permissions for file written by script

Posted on 2004-10-09
4
258 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Weird Samba Connectivity Issue... 7 40
Remove a folder in Linux 9 104
AWS - HAProxy- KeepAlived 5 43
Securing Azure Oracle instance of Linux VM 4 58
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

777 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