Plesk 10 cronjobs

Since the release of the Plesk 10 control panel, there has been a huge difference in how cronjobs are handled. With Plesk 9 and prior, cronjobs were just executed with the system’s default shell, usually sh or bash. However since Plesk 10, the default policy is to run everything under a chrooted environment, which makes things much more secure actually, so I applaud this decision from Parallels.

From an administrator point of view, it might require some changes to what you’re used to though. I experienced this when migrating from Plesk 9 to 10, when some of my cronjobs no longer worked properly. These were cronjobs that triggered a page through the wget utility, however my mailbox got flooded with cron errors saying that the wget binary could no longer be found. After some puzzling I realized the above change between Plesk 9 and 10, that the way of execution had changed to a chrooted shell.

All that needs to be done to get it working is copy the wget binary and it’s required libraries to the vhost’s directory. For example:

cp /usr/bin/wget /var/www/vhosts/example.com/bin/

Now that the binary is in place, it will still need some of the libraries it’s depending on. By using ldd it can be determined which libaries are needed. It could return something like this:

ldd /var/www/vhosts/example.com/bin/wget
        linux-gate.so.1 =>  (0xb77d2000)
        libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0xb777f000)
        libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0xb7627000)
        libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7623000)
        librt.so.1 => /lib/i686/cmov/librt.so.1 (0xb7619000)
        libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb74d3000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb74bf000)
        /lib/ld-linux.so.2 (0xb77d3000)
        libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb74a6000)

All these libraries should be in the lib directory of the vhost. There are probably a few that aren’t there yet, but they can just be copied over from /usr/lib or any alternative path mentioned by ldd.

That’s pretty much it, after these steps are done everything should now work and the cronjobs should be back up.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">