ISPConfig Realtime with Xinetd?

Discussion in 'Tips/Tricks/Mods' started by BjoernHH, Feb 28, 2017.

  1. BjoernHH

    BjoernHH New Member

    Hello,

    I have already ask my question in the german forum, but there was no idea.
    Perhaps here in the larger forum someone has an idea?

    With the old syscp I had, with an instructions from the web, build a realtime-creating instead of the creating by the cronjobs.
    (We don't' use web-forms, we fill the tables with odbc from a desktop-access-db)

    Everything needed for it was a xinetd-entry
    {
    id = ispconfigtest
    port = 7927
    socket_type = stream
    protocol = tcp
    user = root
    group = root
    server = /usr/local/ispconfig/server/server.sh
    server_args =
    type = UNLISTED
    wait = no
    only_from = 127.0.0.1
    }
    and a php-file
    <?php
    $timeout = 15;
    $socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
    if($socket !== false) {
    echo "socket ok"."<br>";
    $time = time();
    while(!@socket_connect($socket, '127.0.0.1', 7927)) {
    $err = socket_last_error($socket);
    echo "error:".$err."<br>";
    echo socket_strerror ($err)."<br>";;
    break;
    if($err == 115 || $err == 114) {
    if((time() - $time) >= $timeout) {
    break;
    }
    sleep(1);
    continue;
    }
    }
    @socket_close($socket);
    } else {
    echo "ok";
    }
    ?>


    The xinetd calls the same script as the cron before.

    Unfortunately this does not work anymore with ISPConfig, although all entries from the datalog are processed, systemuser created, etc ... but the /etc/apache2/sites-available/mydomain.vhosts are only written empty.

    I have looked into a few variables from the apache2_plugin.inc.php and have seen that the $tmp_vhost_arr is not filled properly (contains a "1").
    If I call the server.sh, with the same data in all the tables, from cron, the $tmp_vhost_arr contains the correct data.

    I have no idea where that can come from...

    Has someone here perhaps an idea or has already done that?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You mean that you insert the data in the ispconfig db directly? In that case, you should use the ISPConfig remote api and not manipulate the database data. ISPConfig will not work correctly when it does not get the correct configuration transaction data in the sys_datalog table as it gets created by the remote api and ispconfig interface.
     
  3. BjoernHH

    BjoernHH New Member

    The inserting of data in sys_datalog and the other tables is not the problem (when i have enough time i will change the insertion from odbc to api to be on the safe side in case of updates of ISPConfig.)
    The problem at the moment is the server.sh and the default cronjob for the script.
    When i start server.sh with the default cronjob, everthing works fine, but when i start server.sh with the xinetd-script above also everthing works fine except the /etc/apache2/sites-available/mydomain.vhosts .. they are generated, but empty.
    Directorys, systemsusers, permissions, etc are all ok, it's only the mydomain.vhosts files which is broken (also when i insert with ispconfig interface and then run the server.sh with xinetd)
     

Share This Page