Current time: 11-29-2024, 02:56 AM Hello There, Guest! (LoginRegister)


Post Reply 
Writing CronJobs Web int. It's time!
Author Message
data-stream_ru Offline
Moderator
*****
Moderators

Posts: 471
Joined: Jan 2009
Reputation: 7
Post: #31
RE: Writing CronJobs Web int. It's time!
is the executed file exist?
And what about they chmod and owner?
(This post was last modified: 11-04-2009 01:38 PM by data-stream_ru.)
11-04-2009 01:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
WuChEn Offline
Junior Member
*

Posts: 192
Joined: Feb 2009
Reputation: 2
Post: #32
RE: Writing CronJobs Web int. It's time!
Yes its an execute file and this exist.

Full Pfad is:
/var/www/virtual/domain.tld/cgi-bin/perltest.pl

chmod tested with 750 and 755 and 777

Command an Cronejobs ad is

perl /var/www/virtual/domain.tld/cgi-bin/perltest.pl

If i add, it says:

File not found!

If i move File to

/var/www/virtual/perltest.pl

and change pfad an GUI to

perl /var/www/virtual/perltest.pl

it works.

perltest.pl has owner and user vu2001.

Whats wrong?

Greatz WuChEn
(This post was last modified: 11-04-2009 05:55 PM by WuChEn.)
11-04-2009 05:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
data-stream_ru Offline
Moderator
*****
Moderators

Posts: 471
Joined: Jan 2009
Reputation: 7
Post: #33
RE: Writing CronJobs Web int. It's time!
(11-04-2009 05:54 PM)WuChEn Wrote:  Yes its an execute file and this exist.

Full Pfad is:
/var/www/virtual/domain.tld/cgi-bin/perltest.pl

chmod tested with 750 and 755 and 777

Command an Cronejobs ad is

perl /var/www/virtual/domain.tld/cgi-bin/perltest.pl

If i add, it says:

File not found!

If i move File to

/var/www/virtual/perltest.pl

and change pfad an GUI to

perl /var/www/virtual/perltest.pl

it works.

perltest.pl has owner and user vu2001.

Whats wrong?

Greatz WuChEn

Mey be ispCP user have not access to cgi-bin

In comand line type
#sudo -u vu2001 perl /var/www/virtual/domain.tld/cgi-bin/perltest.pl

If it's executable, You may disable file checking in /var/www/ispcp/gui/client/cronjobs_add.php
Coment lines -

PHP Code:
//Check files and permission
/*

if(!file_exists($file)) {
    set_page_message(tr('File not found!'));
    return;
    } //No file!

if(!is_readable($file)) {
    set_page_message(tr('File not readable!'));
    return;
    }; //Wrong permissions!

if(strpos("cgi",$file) || strpos("pl",$file)) // only for cgi and pl and so..
{
    if(!is_executable($file)) {
    set_page_message(tr('Wrong permissions!'));
    return;
    }; //Wrong permissions!
}
*/ 

If it's not executable in command line, find your permission error.
Hmmmm...
Now I tested cronjob in my server under CentOS
perl /var/www/virtual/veterinars.ru/cgi-bin/ikonboard.cgi

I have not thise error.
(This post was last modified: 11-07-2009 02:52 PM by data-stream_ru.)
11-07-2009 02:45 PM
Visit this user's website Find all posts by this user Quote this message in a reply
WuChEn Offline
Junior Member
*

Posts: 192
Joined: Feb 2009
Reputation: 2
Post: #34
RE: Writing CronJobs Web int. It's time!
Without File Checking it runs. Smile
I test some Cronejobs and give a feedback.

---

Works all fine.
But without File Checking is not good. Sad
Every User can ADD Cronejobs without file checking and hcron says is running. Sad
But when the file not exist it says runnign too. Sad

Greatz WuChEN
(This post was last modified: 11-07-2009 11:13 PM by WuChEn.)
11-07-2009 09:28 PM
Visit this user's website Find all posts by this user Quote this message in a reply
data-stream_ru Offline
Moderator
*****
Moderators

Posts: 471
Joined: Jan 2009
Reputation: 7
Post: #35
RE: Writing CronJobs Web int. It's time!
(11-07-2009 09:28 PM)WuChEn Wrote:  Works all fine.
But without File Checking is not good. Sad
Every User can ADD Cronejobs without file checking and hcron says is running. Sad
But when the file not exist it says runnign too. Sad

Is it running under command line?
What is your OS?
I have a chmod 0755 on cgi-bin and 0555 on *.cgi
There simple php line
if(!file_exists($file))
It Have no any error...
Maybe php bug?
What is your php version?

Maybe you post any variable to script?
11-08-2009 09:39 PM
Visit this user's website Find all posts by this user Quote this message in a reply
WuChEn Offline
Junior Member
*

Posts: 192
Joined: Feb 2009
Reputation: 2
Post: #36
RE: Writing CronJobs Web int. It's time!
Okay.

On Commandline with user vu2000 not.
With user vu2001 no Problems.
By OS is Debian 5.0 Lenny.
I´m using PHP 5.2.11-0.dotdeb.1. Smile
I´m using ISPCP 1.0.3 from the trunk.
I think thats a chown Problem.

/var/www/virtual/domain.tld/

has Owner : vu2001
and Group : www-data

/var/www/virtual/domain.tld/htdocs/

has Owner : vu2001
and Group : vu2001

so the GUI with user and group vu2000 can´t acces the files to test.

Greatz WuChEn
11-08-2009 11:47 PM
Visit this user's website Find all posts by this user Quote this message in a reply
data-stream_ru Offline
Moderator
*****
Moderators

Posts: 471
Joined: Jan 2009
Reputation: 7
Post: #37
RE: Writing CronJobs Web int. It's time!
Maybe... You can chown GUI group to www-data
Or chown only cronjobs_add.php
(This post was last modified: 11-09-2009 01:35 PM by data-stream_ru.)
11-09-2009 01:35 PM
Visit this user's website Find all posts by this user Quote this message in a reply
WuChEn Offline
Junior Member
*

Posts: 192
Joined: Feb 2009
Reputation: 2
Post: #38
RE: Writing CronJobs Web int. It's time!
The GUI has group www-data.
Problem is not solved. *g

file check musst run as root or user that want to add. Big Grin

Any solution? Wink

Greatz WuChEn
11-09-2009 07:24 PM
Visit this user's website Find all posts by this user Quote this message in a reply
data-stream_ru Offline
Moderator
*****
Moderators

Posts: 471
Joined: Jan 2009
Reputation: 7
Post: #39
RE: Writing CronJobs Web int. It's time!
(11-09-2009 07:24 PM)WuChEn Wrote:  The GUI has group www-data.

Quote:so the GUI with user and group vu2000

???

Quote:Any solution?

If php script can't have permission to file which have one group, your system have bad configuration. Or your perl file haven't permission for group users.
11-10-2009 08:48 PM
Visit this user's website Find all posts by this user Quote this message in a reply
WuChEn Offline
Junior Member
*

Posts: 192
Joined: Feb 2009
Reputation: 2
Post: #40
RE: Writing CronJobs Web int. It's time!
ok, i try again to describ the problem.

the ispcp gui has

user: vu2000
group: www-data

so it runs with rights from vu2000.

user files has

user: vu2001
group: vu2001

cronejob_add and cronejob_edit runs as vu2000 because the gui run as user vu2000.

and vu2000 has no acces to user files.

if i run in console

sudo -u vu2000 perl /var/www/virtual/domain.tld/htdocs/file.pl

Could not open input file: /var/www/virtual/domain.tld/htdocs/file.pl

if i run in console

sudo -u vu2001 perl /var/www/virtual/domain.tld/htdocs/file.pl

it runs.

----

When a user Upload a file it becomes user and group vu2001 or vu2002.

FTP Users can´t change Owner ir Group.

So i must find a way, that the user vu2000 ( ISPCP GUI ) can check files and permission from files with user:group vu2001:vu2001.

I Use ISPCP 1.0.3 and someone has tel me that 1.0.0 have other folder rights than 1.0.3. Sad

Sorry for my bad english, i´m from germany. Big Grin

Greatz WuChEn
11-10-2009 10:34 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)