cPanel & WHM Version 108 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!
This object is in archive! 

option to turn off jailshell for crontab

worthers shared this idea 9 years ago
Open Discussion

With recent releases of 11.38 crontab's are now run using jailshell even if no shell access is given to a user. Please can there be an option to switch this back to previous behaviour, presumably by using normal shell as default for crontab.

Replies (3)

photo
1

The nosuid option breaks sendmail.

photo
1

Not all hosting providers want to force jailshell for this. It tends to leave orphaned virtfs mounts open, and this causes problems when trying to reboot a server.

photo
2

Submitting this possible fix from a user. Please note that this change is meant as a suggestion to the developers, and will not function as a work around, since the code that actually handles this is compiled into the binary.


/usr/local/cpanel/Cpanel/Cron/Edit.pm

<code>

#Return value indicates whether the contents changed.

sub _force_crontab_shell {

my ( $contents_sr, $shell ) = @_;

+ return 0 if (-e "/var/cpanel/cronshell_disable");

my @crontab = split( m{\n}, $$contents_sr );


my @shell_lines = grep m{^\s*['"]?SHELL}, @crontab;


if ($shell) {

if ( scalar(@shell_lines) == 1 && $shell_lines[0] =~ m{^\s*SHELL\s*=\s*"?\Q$shell\E"?\s*$} ) {

return 0;

}

}

elsif ( !@shell_lines ) {

return 1;

}

</code>

Leave a Comment
 
Attach a file