Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 24th January 2011, 17:16
SupuS SupuS is offline
HowtoForge Supporter
 
Join Date: May 2006
Posts: 202
Thanks: 68
Thanked 14 Times in 12 Posts
Default Mysql under jailkit - Invalid cross-device link when linking mysqld.sock

Hi,

I need enable mysql command for chrooted shell accounts on Ubuntu 10.04 server.

I put /usr/bin/mysql to jailkit chrooted applications section under server configuration. mysql command were sucessfully added to chroot but without creating mysql socket. Here is part of /var/log/ispconfig/cron.log:

Code:
ln: creating hard link `/var/www/clients/client1/web2/var/run/mysqld/mysqld.sock' => `/var/run/mysqld/mysqld.sock': Invalid cross-device link
As described on this thread the reason should be bad harddisk layout. On server are root, tmp and boot partitions but ubuntu adds tmpfs partition for /var/run.

Here is output of mount:

Code:
rootfs on / type rootfs (rw)
none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
none on /dev type devtmpfs (rw,relatime,size=4091184k,nr_inodes=1022796,mode=755)
none on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/disk/by-uuid/501c4db5-c8fe-4462-9aa3-e3fd3a19926a on / type ext4 (rw,relatime,errors=remount-ro,barrier=1,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group)
none on /sys/fs/fuse/connections type fusectl (rw,relatime)
none on /sys/kernel/debug type debugfs (rw,relatime)
none on /sys/kernel/security type securityfs (rw,relatime)
none on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)
none on /var/run type tmpfs (rw,nosuid,relatime,mode=755)
none on /var/lock type tmpfs (rw,nosuid,nodev,noexec,relatime)
none on /lib/init/rw type tmpfs (rw,nosuid,relatime,mode=755)
/dev/md3 on /tmp type ext4 (rw,nosuid,noexec,relatime,barrier=1,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group)
Is some solution for creating mysql socket in chrooted environment in ubuntu 10.04?

Any help will appreciated.

SupuS
Reply With Quote
Sponsored Links
  #2  
Old 25th January 2011, 12:06
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,388
Thanks: 833
Thanked 5,485 Times in 4,317 Posts
Default

Creating a hrd link is not possible from one partition to another. But maybe you can use the mount command to mount /var/run into the jail.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
SupuS (25th January 2011)
  #3  
Old 25th January 2011, 15:59
SupuS SupuS is offline
HowtoForge Supporter
 
Join Date: May 2006
Posts: 202
Thanks: 68
Thanked 14 Times in 12 Posts
Default

Quote:
Originally Posted by till View Post
Creating a hrd link is not possible from one partition to another. But maybe you can use the mount command to mount /var/run into the jail.
Thank you till. It works. I mounted socket by:

Code:
mount --bind /var/run/mysqld /var/www/clients/clientX/webX/var/run/mysqld/
this situation should be covered directly by ISPConfig because after reboot setting will lost.

SupuS
Reply With Quote
  #4  
Old 26th January 2011, 08:37
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,388
Thanks: 833
Thanked 5,485 Times in 4,317 Posts
Default

ISPConfig has no daemon or start script which get started at boot time where you could add that. So it might be the best way if you create your own script for that.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 19th November 2013, 11:26
zion zion is offline
Junior Member
 
Join Date: Nov 2013
Posts: 15
Thanks: 5
Thanked 0 Times in 0 Posts
Default

I'v created a new custom plugin which does two things when a new chroot is created:
1. mount --bind /var/run/mysqld /home/clients/clientx/webxx/var/run/mysqld/
2. add a new line to /etc/fstab for /var/run/mysqld

My problem is when I delete a chroot site with ispconfig, because I have to umount /var/run/mysqld at first and I can delete files only after umount.

So my question is:
Can I create a delete function in my custom plugin which runs _before_ the main shelluser_jailkit_plugin.inc.php plugin? Is there a weight or something like that?

Or can you recommend me any other way to handle mysql in jailkit chroot?
Reply With Quote
  #6  
Old 19th November 2013, 11:37
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,388
Thanks: 833
Thanked 5,485 Times in 4,317 Posts
 
Default

Quote:
Originally Posted by zion View Post
So my question is:
Can I create a delete function in my custom plugin which runs _before_ the main shelluser_jailkit_plugin.inc.php plugin? Is there a weight or something like that?
yes.Just ensure that the name of the plugin that contains this fubnction is first in alphabet.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
zion (19th November 2013)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
After updating Fedora 13 - Unable to login in kernel 3 and 5 Besrilo Kernel Questions 6 12th August 2010 19:01
ISPConfig3 Mail Warn Errors reason8 General 3 25th November 2009 13:58
Debian Lenny apt-get update failed to fetch qriz Installation/Configuration 3 31st October 2009 22:19
ISPConfig Installation error linuxuser1 Installation/Configuration 4 26th February 2008 06:38
Management/system config/settings & /server/settings not working!! dactor Installation/Configuration 9 6th February 2008 09:11


All times are GMT +2. The time now is 11:34.


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