Plesk changes SHELL variable for cron tasks

Created:

2017-01-19 05:01:51 UTC

Modified:

2017-08-08 13:18:25 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Plesk changes SHELL variable for cron tasks

Symptoms

  • SHELL variable is set to chroot, even when the command that changes it was executed:
# /usr/local/psa/bin/server_pref --update -crontab-secure-shell /bin/bash
# cat /var/spool/cron/crontabs/customer
---

# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (crontabzhawEG installed on Sat Jan 7 01:09:37 2017)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
MAILTO=""
SHELL="/opt/psa/bin/chrootsh"
0 0 * * * ls /


When Plesk user changes any scheduled task,  SHELL variable is changed from '/bin/sh' to '/usr/local/psa/bin/chrootsh'. It causes some scheduled tasks to fail, as it is not possible to get access to system binaries.

Cause

Permissions are not set correctly for a subscription or a service plan. This is Plesk a bug with ID PPPM-5607, which is expected to be fixed in future Plesk updates.

Resolution

1. Enable option Setup of potentially insecure web scripting options that override provider's policy:

  • For subscription: Subscriptions > example.com > Account > Customize > Permissions
  • For service plan: Service Plans > Service Plan Name > Permissions

 

2. Change shell by executing the following command: 

# /usr/local/psa/bin/server_pref --update -crontab-secure-shell /bin/bash

 

Alternatively, the attached custom fix can be applied. Just replace the file in /usr/local/psa/admin/plib/Scheduler/.

 

Note: Download and apply the fix for appropriate Plesk version

Attachments:

Have more questions? Submit a request
Please sign in to leave a comment.