From 176107aa3026ce03a09bd9a62e7a100e58d2cccc Mon Sep 17 00:00:00 2001 From: git-harry Date: Wed, 16 Sep 2015 13:31:53 +0100 Subject: [PATCH] Change recon_lock_path to /var/lock The Swift configuration item [filter:recon]/recon_lock_path is set to '/var/lock/swift' by openstack-ansible in the appropriate configuration files. The playbooks also create the directory if it does not exist. If the host is rebooted the directory '/var/lock/swift' is missing and must be recreated. /var/lock (/run/lock) is a tmpfs and so the directory /var/lock/swift will not persist between reboots. Swift attempts to create a directory in the directory specified by recon_lock_path however it does not recursively create any missing parent directories. This commit changes the value of [filter:recon]/recon_lock_path to that set by Swift, '/var/lock'. This allows it to create the directory '/var/lock/swift-recon-object-cron'. The creation of '/var/lock/swift' is also removed from the playbooks. Change-Id: I714367b02c7cf961e9e0bdee4e41f9e4e105b088 Closes-bug: #1496117 --- playbooks/roles/os_swift/tasks/swift_pre_install.yml | 1 - playbooks/roles/os_swift/templates/account-server.conf.j2 | 2 +- playbooks/roles/os_swift/templates/container-server.conf.j2 | 2 +- playbooks/roles/os_swift/templates/object-server.conf.j2 | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/playbooks/roles/os_swift/tasks/swift_pre_install.yml b/playbooks/roles/os_swift/tasks/swift_pre_install.yml index 3a23fc321f..ab4f44712d 100644 --- a/playbooks/roles/os_swift/tasks/swift_pre_install.yml +++ b/playbooks/roles/os_swift/tasks/swift_pre_install.yml @@ -67,7 +67,6 @@ - { path: "/etc/swift/ring_build_files" } - { path: "/openstack/log/{{ inventory_hostname }}", owner: "syslog", group: "syslog" } - { path: "/var/cache/swift" } - - { path: "/var/lock/swift" } - { path: "{{ swift_system_home_folder }}" } tags: - swift-dirs diff --git a/playbooks/roles/os_swift/templates/account-server.conf.j2 b/playbooks/roles/os_swift/templates/account-server.conf.j2 index 13bfc6d903..0dc96593a9 100644 --- a/playbooks/roles/os_swift/templates/account-server.conf.j2 +++ b/playbooks/roles/os_swift/templates/account-server.conf.j2 @@ -31,7 +31,7 @@ use = egg:swift#healthcheck use = egg:swift#recon log_facility = LOG_LOCAL2 recon_cache_path = /var/cache/swift -recon_lock_path = /var/lock/swift +recon_lock_path = /var/lock {% if swift.replication_network is not defined or swift.replication_network == swift.storage_network %} [account-replicator] diff --git a/playbooks/roles/os_swift/templates/container-server.conf.j2 b/playbooks/roles/os_swift/templates/container-server.conf.j2 index a6be47e4fe..a3cdb0f322 100644 --- a/playbooks/roles/os_swift/templates/container-server.conf.j2 +++ b/playbooks/roles/os_swift/templates/container-server.conf.j2 @@ -32,7 +32,7 @@ use = egg:swift#healthcheck use = egg:swift#recon log_facility = LOG_LOCAL3 recon_cache_path = /var/cache/swift -recon_lock_path = /var/lock/swift +recon_lock_path = /var/lock {% if swift.replication_network is not defined or swift.replication_network == swift.storage_network %} [container-replicator] diff --git a/playbooks/roles/os_swift/templates/object-server.conf.j2 b/playbooks/roles/os_swift/templates/object-server.conf.j2 index 549f092ae1..f12e1b8edb 100644 --- a/playbooks/roles/os_swift/templates/object-server.conf.j2 +++ b/playbooks/roles/os_swift/templates/object-server.conf.j2 @@ -33,7 +33,7 @@ use = egg:swift#healthcheck use = egg:swift#recon log_facility = LOG_LOCAL4 recon_cache_path = /var/cache/swift -recon_lock_path = /var/lock/swift +recon_lock_path = /var/lock {% if swift.replication_network is not defined or swift.replication_network == swift.storage_network %} [object-replicator]