Template and Wrong permision's. [message #37830] |
Tue, 27 October 2009 11:05 |
AshleyUk
Messages: 6 Registered: October 2009 Location: Essex, UK
|
Junior Member |
|
|
Hello,
I used the basic CentOS 5 Minimal Template, and then updated the template using yum and installed ISPConfig2.
I then shutdown most proccesses mysql,httpd,postfix e.t.c, then shutdown the VPS and tared the template up using " tar -pczf /vz/template/cache/CentOS-5.4-i386-ISPConfig.tar.gz ." while I was inside /vz/private/118
I have done a few templates now and they are all fine, however this one if I use it on the same node it's fine, however if I use it on another node mysql can not start.
For example the directory /var/run/mysql is not owned by mysql:mysql but instead some random number's like 140:140.
Is there a reason for this? Should I be excluding the run directory will it just get created when the VPS boot's up again, why am I not having problems with the other templates ive made?
Thanks,
Ashley
|
|
|
|
|
Re: Template and Wrong permision's. [message #37836 is a reply to message #37834] |
Tue, 27 October 2009 14:29 |
AshleyUk
Messages: 6 Registered: October 2009 Location: Essex, UK
|
Junior Member |
|
|
Hello,
Still getting this problem, if template is used on the Node it was created on it's fine however straight away i move the tar.gz to another node mysql fails to start becuase of user/group ownership of certain directories.
For example
running ls -l in /var/run shows :
drwxr-xr-x 2 102 104 4096 Oct 27 14:56 mysqld
Where the actual output for the mysqld folder should be
drwxr-xr-x 2 mysql mysql 4096 Oct 27 14:56 mysqld
running "chown -R mysql:mysql mysqld", mysql then starts fine, however I am trying to release these template's for openvz hosts.
I know it must be possible as for example the 3rd party OS templates on openvz.org work fine.
Im using "tar -pczf --numeric-owner /vz/template/cache/CentOS-5.4-i386-ISPConfig2.tar.gz" to tar the files after changing to "/vz/private/#vzid#" directory and stopping the VPS.
Thanks,
Ashley
[Updated on: Tue, 27 October 2009 14:31] Report message to a moderator
|
|
|
|
|
Re: Template and Wrong permision's. [message #37839 is a reply to message #37838] |
Tue, 27 October 2009 15:14 |
|
AshleyUk wrote on Tue, 27 October 2009 17:55 |
I'm using tar -pczf --numeric-owner /vz/template/cache/CentOS-5.4-i386-ISPConfig2.tar.gz .
|
See, the problem is tar's option 'f' requires an argument, a name of a tarball file. When you run it with 'f --numeric-owner' you specify '--numeric-owner' as a name of a tarball. All the other arguments are treated as files/directories to be (in your case) added to the tarball. Yes, tar is an old program with somewhat strange options, that sometimes lead to strange results.
So run ls in the directory you ran the tar in and be amazed that you have a file named --numeric-owner (and to remove it, use rm -- --numeric-owner, here -- is for rm to treat the following arguments as file names, not options).
Also, do not skip the part where I recommend checking the timestamp on a created tarball, and removing the old tarball before creating a new one.
Kir Kolyshkin
|
|
|
Re: Template and Wrong permision's. [message #37840 is a reply to message #37839] |
Tue, 27 October 2009 15:18 |
AshleyUk
Messages: 6 Registered: October 2009 Location: Essex, UK
|
Junior Member |
|
|
Hello,
Thanks for your helping, I now created using the correct command, I then checked and it come back with the same uid and gid as the original output from the VPS, so now just waiting for it to be tested on another node and will get back to you.
Thanks,
Ashley
[Updated on: Tue, 27 October 2009 15:23] Report message to a moderator
|
|
|
|