[SOLVED] LXC and Centos6 - problems with su and mysqld

raider700

Member
Nov 22, 2015
3
0
21
Hello together,i have some problems with the usage of LXC on Proxmox 4.The plan is to generate a minimal LAMP containers for multiple websites.At the moment i got stucked at the basics and i'm not able to detect the source of the problem:* su ... fails* service mysqld start ... failsThe container was created with the following command:
Code:
pct create 104 container_v:vztmpl/centos-6-default_20150829_amd64.tar.xz --hostname  centos6 --password XXXXXXXX --rootfs container_v:0 --pool container_v --cpulimit 1 --cpuunits 1024 --memory 256 --swap 512
-----------------------------------------To the first problem with su :Then i entered the container and tried to change the user:
Code:
proxmox00a:/etc/pve/lxc# pct start 104proxmox00a:/etc/pve/lxc# pct enter 104[centos6 /]# useradd testuser[centos6 /]# su testusersu: /bin/bash: Permission denied
There is no additional information in the logfiles.The output of the strace uploaded to pastebin: pastebin.com/dAkZczbPIs there any LXC.* Option to change the behavior?(The correct position is /etc/pve/lxc/.conf right?)-----------------------------------------The second problem with mysqld is also strange.When i try to start i geht the following message:
Code:
bash-4.1# service mysqld startMySQL Daemon failed to start.Starting mysqld:                                           [FAILED]bash-4.1# tail -n 15 /var/log/mysqld.log 151122 13:04:09 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended151122 13:05:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist151122 13:05:03 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it./usr/libexec/mysqld: Can't create/write to file '/tmp/ib84Fdgq' (Errcode: 13)151122 13:05:03  InnoDB: Error: unable to create temporary file; errno: 13151122 13:05:03 [ERROR] Plugin 'InnoDB' init function returned error.151122 13:05:03 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.151122 13:05:03 [ERROR] Can't start server : Bind on unix socket: Permission denied151122 13:05:03 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?151122 13:05:03 [ERROR] Aborting151122 13:05:03 [Note] /usr/libexec/mysqld: Shutdown complete151122 13:05:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
The permission for the /tmp folder seams to be right:(chown root:root /tmp; chmod 1777 /tmp)
Code:
bash-4.1# ls -lisa /tmp/total 108220755  4 drwxrwxrwt  2 root root  4096 Nov 22 12:09 .155002  4 drwxr----- 21 root root  4096 Nov 22 12:26 ..220763 64 -rw-r--r--  1 root root 59131 Nov 22 11:39 mysql-strace.txt220765 36 -rw-r--r--  1 root root 30915 Nov 22 12:09 su-strace.txt
Maybe there is also only a problem with some missing LXC settings.The strace of the start is also on pastebin: pastebin.com/8HUnw0Sy-----------------------------------------I hope someone can help me with the problems.Kindly regards,Raider700
 
Last edited:
Re: LXC and Centos6 - problems with su and mysqld

I could identify the problem:
The creation with a size of "0GB" doesn't create a image file.
The the files of the system is visible on the host without a loop mount (we need that)

Is there any way to create the visible filesystem but don't break the permissions?
 
Re: LXC and Centos6 - problems with su and mysqld

Thx to the support for the fast response and the solution!
Problem was the NFS option "no_root_squash" on the NFS Server and the permissions of the root folder in the container (chmod 755 /).
 
Was a bug in the creation of size=0 storages. A while ago we started using stricter permissions in our storage backend resulting in `rwxr-----` on the container's root when it is a directory. Fix is about to be committed to git. In the mean time the above mentioned `chmod` followed by a restart of the container (or doing it on the $storage/images/$vmid/vm-$vmid-disk-1.subvol directory before starting it) should do the trick.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!