HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   Error (in server.sh debug) (http://www.howtoforge.com/forums/showthread.php?t=59671)

almere 23rd November 2012 05:24

Error (in server.sh debug)
 
Hi,

That's debug from server.sh . Because of this i cant update anything. Please, help!


Code:


root@s1 ~ # /usr/local/ispconfig/server/server.sh
23.11.2012-05:21 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
23.11.2012-05:21 - DEBUG - Found 5 changes, starting update process.
23.11.2012-05:21 - DEBUG - Calling function 'insert' from plugin 'cron_jailkit_plugin' raised by event 'cron_insert'.
23.11.2012-05:21 - DEBUG - Added programs to jailkit chroot with command: /usr/local/ispconfig/server/scripts/create_jailkit_programs.sh /var/www/clients/client1/web8 '/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico'
23.11.2012-05:21 - DEBUG - Added cron programs to jailkit chroot with command: /usr/local/ispconfig/server/scripts/create_jailkit_programs.sh /var/www/clients/client1/web8 '/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php'
usermod: no changes
23.11.2012-05:21 - DEBUG - Added jailkit user to chroot with command: /usr/local/ispconfig/server/scripts/create_jailkit_user.sh web8 /var/www/clients/client1/web8 /home/web8 /bin/bash
PHP Fatal error:  Call to a member function mkdir() on a non-object in /usr/local/ispconfig/server/plugins-available/cron_jailkit_plugin.inc.php on line 302


almere 23rd November 2012 05:39

Quote:

Originally Posted by almere (Post 288638)
Hi,

That's debug from server.sh . Because of this i cant update anything. Please, help!


Code:


root@s1 ~ # /usr/local/ispconfig/server/server.sh
23.11.2012-05:21 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
23.11.2012-05:21 - DEBUG - Found 5 changes, starting update process.
23.11.2012-05:21 - DEBUG - Calling function 'insert' from plugin 'cron_jailkit_plugin' raised by event 'cron_insert'.
23.11.2012-05:21 - DEBUG - Added programs to jailkit chroot with command: /usr/local/ispconfig/server/scripts/create_jailkit_programs.sh /var/www/clients/client1/web8 '/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico'
23.11.2012-05:21 - DEBUG - Added cron programs to jailkit chroot with command: /usr/local/ispconfig/server/scripts/create_jailkit_programs.sh /var/www/clients/client1/web8 '/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php'
usermod: no changes
23.11.2012-05:21 - DEBUG - Added jailkit user to chroot with command: /usr/local/ispconfig/server/scripts/create_jailkit_user.sh web8 /var/www/clients/client1/web8 /home/web8 /bin/bash
PHP Fatal error:  Call to a member function mkdir() on a non-object in /usr/local/ispconfig/server/plugins-available/cron_jailkit_plugin.inc.php on line 302




Well....

I had to comment 3 lines in file "/usr/local/ispconfig/server/plugins-available/cron_jailkit_plugin.inc.php"

In function _add_jailkit_user.
Now it looks like this:

Code:


       
        function _add_jailkit_user()
        {
                        //add the user to the chroot
            $jailkit_chroot_userhome = $this->_get_home_dir($this->parent_domain['system_user']);
                       
                        if(!is_dir($this->parent_domain['document_root'].'/etc')) mkdir($this->parent_domain['document_root'].'/etc');
                        if(!is_file($this->parent_domain['document_root'].'/etc/passwd')) exec('touch '.$this->parent_domain['document_root'].'/etc/passwd');
                       
                        // IMPORTANT!
                        // ALWAYS create the user. Even if the user was created before
                        // if we check if the user exists, then a update (no shell -> jailkit) will not work
                        // and the user has FULL ACCESS to the root of the server!
                        $command = '/usr/local/ispconfig/server/scripts/create_jailkit_user.sh';
                        $command .= ' '.escapeshellcmd($this->parent_domain['system_user']);
                        $command .= ' '.escapeshellcmd($this->parent_domain['document_root']);
                        $command .= ' '.$jailkit_chroot_userhome;
                        $command .= ' '.escapeshellcmd("/bin/bash");
                        exec($command);
                               
                        $this->app->log("Added jailkit user to chroot with command: ".$command,LOGLEVEL_DEBUG);
                               
                        mkdir(escapeshellcmd($this->parent_domain['document_root'].$jailkit_chroot_userhome), 0755, true);
                        chown(escapeshellcmd($this->parent_domain['document_root'].$jailkit_chroot_userhome), escapeshellcmd($this->parent_domain['system_user']));
                        chgrp(escapeshellcmd($this->parent_domain['document_root'].$jailkit_chroot_userhome), escapeshellcmd($this->parent_domain['system_group']));
                       
        }


What is the right solution for it?

P.S. is it a good cron command for Debian Squeeze? /usr/bin/php /var/www/site.com/web/path/admin/cron.php

till 23rd November 2012 09:06

I guess you use one of the prereleases as this code is not in a final version. If you use a prerelease, then update to the latest version from the 3.0.5 stable branch to fix this.

Quote:

/usr/bin/php /var/www/site.com/web/path/admin/cron.php
No. Better enter just the URL in the cron field in ispconfig, thats more secure. Cron command:

http://site.com/path/admin/cron.php


All times are GMT +2. The time now is 10:31.

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