Hi, I am running 389-ds on CentOs 6.7. I am trying to move 389-ds off the disk that contains my root to a second disk that has space for the directory to grow. Can someone please advise on the correct way to move files and maintain selinux contexts. I moved the files using the method below, but logs cannot be written to - please see error message at the bottom of this email.
Setup CentOs 6.7 selinux= enforcing Second disk /mnt/ds389/data/ /mnt/389ds/log/
i used cp -rcp to copy and preserve SELINUX contexts and user rights
1. Stop dirsrv 2. cp -rcp /var/lib/dirsrv/ /mnt/ds389/data/ 3. Checked selinux context using ls -Z dirsrv output: drwxrwx---. nobody nobody unconfined_u:object_r:dirsrv_var_lib_t:s0 slapd-eu-vc-pmldap01 4. renamed /var/lib/dirsrv (keep original files under a different name) 5. Create symbolic link # ln -s /mnt/389ds/data/ dirsrv
Logs 6. cp -rcp /var/log/dirsrv /mnt/389ds/log/ 7. Checked selinux context for /mnt/389ds/log drwx------. nobody nobody unconfined_u:object_r:dirsrv_var_log_t:s0 admin-serv drwxr-xr-x. nobody nobody unconfined_u:object_r:dirsrv_var_log_t:s0 slapd-eu-vc-pmldap01
8. Renamed /var/log/dirsrv t 9. Create symbolic link in /var/log ln -s /mtn/389ds/log/ dirsrv
10. Reboot server 11 $ sudo service dirsrv start
Error: etc/dirsrv/slapd-xxxxxxxxx/dse.ldif: nsslapd-errorlog: Cannot open errorlog file "/var/log/dirsrv/slapd-xxxxxxxxxx/errors", errors cannot be logged. Exiting.... [15/Nov/2015:15:00:12 +0000] - WARNING: can't open file /var/log/dirsrv/slapd-xxxxxxxx/access. errno 13 (Permission denied)[15/Nov/2015:15:00:12 +0000] dse_read_one_file - The entry cn=config in file /etc/dirsrv/slapd-xxxxx/dse.ldif (lineno: 10) is invalid, error code 53 (Server is unwilling to perform) - Cannot open accesslog directory "/var/log/dirsrv/slapd-xxxxxxx/access", client accesses will not be logged.[15/Nov/2015:15:00:12 +0000] dse - Could not load config file [dse.ldif][15/Nov/2015:15:00:12 +0000] dse - Please edit the file to correct the reported problems and then restart the server.
Kind regards
On Sun, 2015-11-15 at 15:14 +0000, Andy Spooner wrote:
Hi, I am running 389-ds on CentOs 6.7. I am trying to move 389-ds off the disk that contains my root to a second disk that has space for the directory to grow. Can someone please advise on the correct way to move files and maintain selinux contexts. I moved the files using the method below, but logs cannot be written to - please see error message at the bottom of this email.
Why not do:
mv /var/lib/dirsrv /var/lib/dirsrv-orig mkdir /var/lib/dirsrv mount /dev/mapper/vg-newdisk /var/lib/dirsrv cp -a /var/lib/dirsrv-orig/* /var/lib/dirsrv/ restorecon -r /var/lib/dirsrv/
Start your ds
This would be the way I would approach it, rather than trying to rename everything ...
Yes the solution will work nicely. I will setup on a test server. Thank you On Nov 15, 2015 23:30, "William Brown" wibrown@redhat.com wrote:
On Sun, 2015-11-15 at 15:14 +0000, Andy Spooner wrote:
Hi, I am running 389-ds on CentOs 6.7. I am trying to move 389-ds off the disk that contains my root to a second disk that has space for the directory to grow. Can someone please advise on the correct way to move files and maintain selinux contexts. I moved the files using the method below, but logs cannot be written to - please see error message at the bottom of this email.
Why not do:
mv /var/lib/dirsrv /var/lib/dirsrv-orig mkdir /var/lib/dirsrv mount /dev/mapper/vg-newdisk /var/lib/dirsrv cp -a /var/lib/dirsrv-orig/* /var/lib/dirsrv/ restorecon -r /var/lib/dirsrv/
Start your ds
This would be the way I would approach it, rather than trying to rename everything ...
-- Sincerely,
William Brown Software Engineer Red Hat, Brisbane
-- 389 users mailing list 389-users@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/389-users
389-users@lists.fedoraproject.org