Re: Using java process to write file failes
Re: Using java process to write file failes
- Subject: Re: Using java process to write file failes
- From: Sacha Mallais <email@hidden>
- Date: Wed, 7 Sep 2005 09:22:13 -0700
On Sep 7, 2005, at 6:14 AM, Wolfram Stebel wrote:
Hi all,
i'm trying to extract some data from my apache logs.
the following code creates a file (owner appserver:admin) first.
With the "more | grep" i try to append data to the file.
This gives me the error "access denied", so i think, the Process p
is not
running under "appserver" user.
How can i do such shell commands under the correct user?
Clearly, in development the code does the job without access problems.
First, using "more" in this context is extremely unlikely to work:
"more" is a pager (meaning it outputs a text file page by page so
that you can see it all). What you probably want is "cat <file> |
grep <blah>". However, even that is not necessary, instead: "grep
<blah> <file>"
Next, as for permissions, you're best bet is to make sure the
permissions on the file is correct. Any other solution will have the
same effect, and that is the easiest, so you might as well do that.
Try this to determine if it actually is a permissions problem:
sudo -u appserver cd /path/to/file
If that fails, there is a permissions problem with the parent
directories. If that works, try this next:
sudo -u appserver cat /path/to/file/<file>
If that fails, there is a permissions problem with the file itself.
sacha
--
Sacha Michel Mallais -- President / Senior Developer
Global Village Consulting Inc. http://www.global-village.net/
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden