Solved

permissions for file written by script

Posted on 2004-10-09
4
238 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
Comment Utility
The user that the script runs as will need write access to the directory  home.jsp is in.
0
 

Author Comment

by:msibley
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now