View Single Post
  #2  
Old 20th September 2010, 15:59
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,983
Thanks: 825
Thanked 5,372 Times in 4,219 Posts
Default

If I understand your explanation correctly, you have to restart apache with a one minute cronjob. So your changes get applied after about one minute. Thats the same time that the normal ispconfig system takes to apply the changes, so I dont see the real benefit in the time to get changes applied.

If you want to get changes applied faster, then the approach that was used in ispconfig 2 might be a good choice.

1) Comment out the server.sh root cronjob.
2) create a bash script, e.g. /usr/local/bin/ispconfig_server.sh with the following content:

Code:
#!/bin/bash

export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin

. /etc/profile

error ()
{
  echo "ERROR: $1"
  exit 1
}

ID="id -u"
MYUID=`$ID 2>/dev/null`

if [ ! -z "$MYUID" ];
then
  if [ $MYUID != 0 ];
  then
    error "You need root privileges to run this script! / Vous devez avoir les privileges root pour executer ce script!";
  fi
fi

while (true) do
  if [ -f /usr/local/ispconfig/interface/web/temp/.run ]; then
    touch /usr/local/ispconfig/server/temp/.run2
    rm -f /usr/local/ispconfig/interface/web/temp/.run
    /usr/bin/php -q /usr/local/ispconfig/server/server.php
    rm -f /usr/local/ispconfig/server/temp/.run2
  fi
  sleep 10
done

exit 0
Start this shell script in the background, it will run forever until you kill it or you reboot the server. It has a very low resource usage. The script checks every 10 seconds if a file /usr/local/ispconfig/interface/web/temp/.run exists and if that file exists it will start the ispconfig update process. You can even reduce the time to less then 10 seconds if nescessary.

So if you want to start an update from the ispconfig interface then, you just execute this php command:

touch('/usr/local/ispconfig/interface/web/temp/.run');

This variant is only usable on single server systems, thats why we dont use it in ispconfig 3.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.

Last edited by till; 20th September 2010 at 16:05.
Reply With Quote