Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 27th August 2010, 15:51
zabersoft zabersoft is offline
Member
 
Join Date: Aug 2010
Posts: 33
Thanks: 1
Thanked 2 Times in 1 Post
Default When does server.sh/php run?

Alright, this might seem like a stupid question - but let me explain ...

We are using ISPCP automation to set up a hosting environment where users can easily set up an account and get some default web applications available in their web root - all set up ready to go.

I saw the other thread where a guy was asking about pretty much the same I am here - and there till showed some nice example code on how to extend server.php to run some code whenever it was done doing its work - which then could be used to copy files to the users web root.

I have not explored this approach myself yet - as I have a more fundamental problem/question on my mind:

When the heck does server.php run? The Cron entry makes little sense to me - and it seems pretty random when it is invoked on my server. Sometimes directories pop up within seconds - sometimes it takes as much as 5 to 10 minutes before web directories are created.

Furthermore - invoking server.sh manually has varied results. Sometimes I get the "finished." message. Sometimes nothing. Sometimes I get the updating message - but still no new directories. Then they magically appear minutes later.

Logging seems to be broken as well - I have edited the config file and set debug level to 0 and looked through the code closely - but still nothing makes it to my log file. This makes me suspect something bad is going on...

As you can expect, this is leaving me somewhat confused. The thing is, we are building our system as a wizard type of thing at the end of which we want to take the user to their new site immediatly - So time is an issue here.

If your answer is: Your system is effed up - reinstall and try again - Then I'd say: Alright, fine, I kind of expected that answer
Reply With Quote
Sponsored Links
  #2  
Old 27th August 2010, 16:02
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,036
Thanks: 841
Thanked 5,656 Times in 4,464 Posts
Default

The server.php script runs exactly once a minute.

Quote:
Furthermore - invoking server.sh manually has varied results. Sometimes I get the "finished." message. Sometimes nothing. Sometimes I get the updating message - but still no new directories. Then they magically appear minutes later.
Then you might have some kind of addon or custom code in your setup which has an error and might block the action queue. To check out what is going on, enable debugging:

http://www.faqforge.com/linux/contro...n-ispconfig-3/

By the way, ISPCP is not ISPConfig! ISPCP is a software from a different company. But I guess you are talking about ISPConfig here.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.

Last edited by till; 27th August 2010 at 16:29.
Reply With Quote
  #3  
Old 27th August 2010, 16:09
zabersoft zabersoft is offline
Member
 
Join Date: Aug 2010
Posts: 33
Thanks: 1
Thanked 2 Times in 1 Post
Default Whoops sorry

Hey till!

Sorry about the ISPCP thing - I get confused with acronyms sometimes - haha. BTW: ISPConfig is much (much!) better than ISPCP! ;-)

I had of course not noticed the new server setting which enables debugging - which of course explains why I wasnt seeing anything in my log - I'll enable that and continue my tests here and see if I cant track down the cause of my issue.

If I can just get server.php to create directories reliably when I manually invoke it then I'll be a happy camper. I'll update this thread if I find any relevant results.

Thanks again till - I can't begin to explain how much I appreciate the fine work you guys are doing.
Reply With Quote
  #4  
Old 27th August 2010, 16:28
zabersoft zabersoft is offline
Member
 
Join Date: Aug 2010
Posts: 33
Thanks: 1
Thanked 2 Times in 1 Post
Default Problem tracked down

Alright, after having enabled debugging properly then the issue was easy to track down

All this weirdness with varying times that server.php was being invoked was due to me messing things up (of course)

I was manually invoking server.sh via php and this made the server.php script hang due to improper permissions ("unable to open logfile" was the error)

This blocked any other instance of server.php running untill my invoked process stopped running.

Hence the weirdness. Now I just need to figure out how to start server.sh without any permission problems and I am ready to rock.

Thanks again for pointing me in the right direction!
Reply With Quote
  #5  
Old 27th August 2010, 16:32
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,036
Thanks: 841
Thanked 5,656 Times in 4,464 Posts
Default

One additional note, if you run server.sh and you dont get any output at all, then there is most likely a php syntax error in the code. To get the php error output, comment out the line

ini_set('error_reporting','E_ALL & ~E_NOTICE');

in server.php.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 3rd September 2010, 11:09
jwarnier jwarnier is offline
Member
 
Join Date: Jan 2008
Location: Brussels, Belgium
Posts: 34
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by zabersoft View Post
Alright, this might seem like a stupid question - but let me explain ...

We are using ISPCP automation to set up a hosting environment where users can easily set up an account and get some default web applications available in their web root - all set up ready to go.

I saw the other thread where a guy was asking about pretty much the same I am here - and there till showed some nice example code on how to extend server.php to run some code whenever it was done doing its work - which then could be used to copy files to the users web root.
We are probably the company where the "other guy" works.

I know you probably already figured most of it, but I take this as an opportunity to clearly describe the way it works and link it to tasks in the bugtracker.

server.sh is really just a wrapper around server.php to set up a $PATH for command-lines executed by server.php and its modules and plugins.
It is started from root's cronjob every minute.

I think this server.sh (and cron_daily.sh) should disappear, but it is not a trivial task as long as there are commands like "which awk" executed in the code.
See http://www.howtoforge.com/forums/showthread.php?t=47801

If you have some time to spend on this and want to help, you are welcome. Even better if you know some PHP.

Quote:
Originally Posted by zabersoft View Post
I have not explored this approach myself yet - as I have a more fundamental problem/question on my mind:

When the heck does server.php run? The Cron entry makes little sense to me - and it seems pretty random when it is invoked on my server. Sometimes directories pop up within seconds - sometimes it takes as much as 5 to 10 minutes before web directories are created.

Furthermore - invoking server.sh manually has varied results. Sometimes I get the "finished." message. Sometimes nothing. Sometimes I get the updating message - but still no new directories. Then they magically appear minutes later.

Logging seems to be broken as well - I have edited the config file and set debug level to 0 and looked through the code closely - but still nothing makes it to my log file. This makes me suspect something bad is going on...

As you can expect, this is leaving me somewhat confused. The thing is, we are building our system as a wizard type of thing at the end of which we want to take the user to their new site immediatly - So time is an issue here.
This cronjob is run every minute, and as it is located in root's cronjob, you can read it as root with a "crontab -l" or edit it with a "crontab -e".
Logging is working perfectly for us.

Quote:
Originally Posted by zabersoft View Post
If your answer is: Your system is effed up - reinstall and try again - Then I'd say: Alright, fine, I kind of expected that answer
I don't think so.
Reply With Quote
  #7  
Old 3rd September 2010, 11:41
jwarnier jwarnier is offline
Member
 
Join Date: Jan 2008
Location: Brussels, Belgium
Posts: 34
Thanks: 5
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by jwarnier View Post
We are probably the company where the "other guy" works.

I know you probably already figured most of it, but I take this as an opportunity to clearly describe the way it works and link it to tasks in the bugtracker.

server.sh is really just a wrapper around server.php to set up a $PATH for command-lines executed by server.php and its modules and plugins.
It is started from root's cronjob every minute.

I think this server.sh (and cron_daily.sh) should disappear, but it is not a trivial task as long as there are commands like "which awk" executed in the code.
See http://www.howtoforge.com/forums/showthread.php?t=47801

If you have some time to spend on this and want to help, you are welcome. Even better if you know some PHP.
Also note we dumbly created something (basic) to easily extend server.php, while there already was the "mods" and "plugins" framework.
See http://www.howtoforge.com/forums/showthread.php?t=47951.

Any help to rewrite it as a plugin is welcome (we don't have resource to dedicate on this for the moment).
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Companion Script #2 for The Perfect Server - Fedora 13 x86_64 [ISPConfig 3]" MrCompTech Tips/Tricks/Mods 0 10th July 2010 06:11
Need to Run Jobqueue from PHP manually ethanlifka Tips/Tricks/Mods 1 21st March 2010 13:59
No run directory defined for saslauthd, not starting sbin Server Operation 1 30th January 2010 04:06
Make webstats run mphayesuk General 1 20th September 2006 19:14
Cannot run systemimager KCPoole HOWTO-Related Questions 1 6th May 2006 16:02


All times are GMT +2. The time now is 12:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.