Re: pexpect with apache
- From: "martdi" <martin.dion@xxxxxxxxx>
- Date: 18 Oct 2006 15:19:38 -0700
Since it wont require pyexpect, and based on the operations you
accomplish with your python script, maybe that a bash script instead of
a python one might be the best tool for the job you're trying to
accomplish.
martdi wrote:
Sudo is probably the best solution here, since in the file sudo.conf
you could restrict the www user only to the python script that requires
it.
Also, using either sudo or the setuid flag would remove the need of
pexpect since all the commands will be run as the designated user.
for setuid flag:
chmod u+s pythonScript.py
chown root pythonScript.py
for the sudo solution, add an entry to /etc/sudo.conf or /etc/sudoers ,
depending on distro:
the syntax for a line in sudo.conf is:
user hostlist = (userlist) commandlist
so you might want to add:
www localhost = NOPASSWD: /var/www/htdocs/pythonScript.py
note:
Replace the /var/www/htdocs/pythonScript.py with the path to where
your script is
the NOPASSWD: is a flag that tells sudo that no password is
required
Lee Harr wrote:
Well, first i don't think it is a good idea to have the python script
tu su to root, but for it to work, i think (Totally unsure about that)
www has to be in group wheel to be able to su.
Maybe sudo can help here.
.
- Follow-Ups:
- Re: pexpect with apache
- From: half.italian@xxxxxxxxx
- Re: pexpect with apache
- References:
- pexpect with apache
- From: half.italian@xxxxxxxxx
- Re: pexpect with apache
- From: martdi
- Re: pexpect with apache
- From: Lee Harr
- Re: pexpect with apache
- From: martdi
- pexpect with apache
- Prev by Date: Re: Flexable Collating (feedback please)
- Next by Date: Re: Getting method name from within the class method
- Previous by thread: Re: pexpect with apache
- Next by thread: Re: pexpect with apache
- Index(es):
Relevant Pages
|
|