• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Adding mysql to chrooted permantely

Fabhino22Elz

Basic Pleskian
Hi,

i follwoed this article here and added the mysql to my chrooted template. That works, until the server is restarted.

Is there a way to add the mysql permanentyl to the chrooted template?

greetings and thx for your anwers.

tom
 
The link to the article is missing, is it this one: How to chroot MySQL client for users?

My guess is that the mount isn't being performed after a reboot. There are several ways how to set this up, e.g. one is to use crontab.

You might want to look at the current crontab first:
Code:
crontab -l

and back it up:
Code:
crontab -l > /root/crontab-backup.txt

then edit it:
Code:
crontab -e

and enter in a new line at the end (press G and o to move to the end and start editing on a new line; press ESC then :x to save and quit):
Code:
@reboot /usr/bin/sh /path/to/the/mountscript.sh

(if you've made a mistake, press ESC and :q! to quit without saving, start over)

Create a mount script first and test it by running it manually, only add it to crontab once you're satisfied with it.
 
First - Thanks to your answer! :)

Yes, that is the right article.

Before i start my test 2 more questions:
  1. I only need a shell script that runs the mount after every reboot, is that right?
  2. In the article i have to run that mount order and that stuff for every domain. is there a way to apply that directly to all domains?
Greetings
 
You're welcome!
I only need a shell script that runs the mount after every reboot, is that right?
Yes, but do test to double check.
In the article i have to run that mount order and that stuff for every domain. is there a way to apply that directly to all domains?
The procedure could be automated fully, including the initial setup when the domain is created. I'd consider the number of domains or, better said, how often would this need to be done manually, before deciding on how far to take it.

For full automation, I'd look into using Plesk Event Handlers and go from there, including using a bit less hackish and a more complex mount script than I'm about to suggest.

But if you'd like to keep it simple (hackish but KISS, which isn't necessarily bad) and limit the automation to reboots only, I suggest using shell scripting to generate a list of domains and iterate over the list with a for loop to perform a bind mount for each domain. The script could be triggered by the crontab, as mentioned in the previous post.

Like I mentioned, it all depends on how far you'd like to take this...
 
Back
Top