diff --git a/files/swift/rsyncd.conf b/files/swift/rsyncd.conf index 4e0dcbf944..c670531b31 100644 --- a/files/swift/rsyncd.conf +++ b/files/swift/rsyncd.conf @@ -1,79 +1,79 @@ uid = %USER% gid = %GROUP% -log file = /var/log/rsyncd.log -pid file = /var/run/rsyncd.pid +log file = %SWIFT_DATA_DIR%/logs/rsyncd.log +pid file = %SWIFT_DATA_DIR%/run/rsyncd.pid address = 127.0.0.1 [account6012] max connections = 25 path = %SWIFT_DATA_DIR%/1/node/ read only = false -lock file = /var/lock/account6012.lock +lock file = %SWIFT_DATA_DIR%/run/account6012.lock [account6022] max connections = 25 path = %SWIFT_DATA_DIR%/2/node/ read only = false -lock file = /var/lock/account6022.lock +lock file = %SWIFT_DATA_DIR%/run/account6022.lock [account6032] max connections = 25 path = %SWIFT_DATA_DIR%/3/node/ read only = false -lock file = /var/lock/account6032.lock +lock file = %SWIFT_DATA_DIR%/run/account6032.lock [account6042] max connections = 25 path = %SWIFT_DATA_DIR%/4/node/ read only = false -lock file = /var/lock/account6042.lock +lock file = %SWIFT_DATA_DIR%/run/account6042.lock [container6011] max connections = 25 path = %SWIFT_DATA_DIR%/1/node/ read only = false -lock file = /var/lock/container6011.lock +lock file = %SWIFT_DATA_DIR%/run/container6011.lock [container6021] max connections = 25 path = %SWIFT_DATA_DIR%/2/node/ read only = false -lock file = /var/lock/container6021.lock +lock file = %SWIFT_DATA_DIR%/run/container6021.lock [container6031] max connections = 25 path = %SWIFT_DATA_DIR%/3/node/ read only = false -lock file = /var/lock/container6031.lock +lock file = %SWIFT_DATA_DIR%/run/container6031.lock [container6041] max connections = 25 path = %SWIFT_DATA_DIR%/4/node/ read only = false -lock file = /var/lock/container6041.lock +lock file = %SWIFT_DATA_DIR%/run/container6041.lock [object6010] max connections = 25 path = %SWIFT_DATA_DIR%/1/node/ read only = false -lock file = /var/lock/object6010.lock +lock file = %SWIFT_DATA_DIR%/run/object6010.lock [object6020] max connections = 25 path = %SWIFT_DATA_DIR%/2/node/ read only = false -lock file = /var/lock/object6020.lock +lock file = %SWIFT_DATA_DIR%/run/object6020.lock [object6030] max connections = 25 path = %SWIFT_DATA_DIR%/3/node/ read only = false -lock file = /var/lock/object6030.lock +lock file = %SWIFT_DATA_DIR%/run/object6030.lock [object6040] max connections = 25 path = %SWIFT_DATA_DIR%/4/node/ read only = false -lock file = /var/lock/object6040.lock +lock file = %SWIFT_DATA_DIR%/run/object6040.lock diff --git a/lib/swift b/lib/swift index a4faf0310e..5ba7e56f3e 100644 --- a/lib/swift +++ b/lib/swift @@ -95,13 +95,13 @@ function configure_swift() { setup_develop $SWIFT_DIR # Make sure to kill all swift processes first - swift-init all stop || true + swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true # First do a bit of setup by creating the directories and # changing the permissions so we can run it as our user. USER_GROUP=$(id -g) - sudo mkdir -p ${SWIFT_DATA_DIR}/{drives,cache} + sudo mkdir -p ${SWIFT_DATA_DIR}/{drives,cache,run,logs} sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_DIR} # Create a loopback disk and format it to XFS. @@ -143,8 +143,8 @@ function configure_swift() { sudo chown -R $USER: ${node} done - sudo mkdir -p ${SWIFT_CONFIG_DIR}/{object,container,account}-server /var/run/swift - sudo chown -R $USER: ${SWIFT_CONFIG_DIR} /var/run/swift + sudo mkdir -p ${SWIFT_CONFIG_DIR}/{object,container,account}-server + sudo chown -R $USER: ${SWIFT_CONFIG_DIR} if [[ "$SWIFT_CONFIG_DIR" != "/etc/swift" ]]; then # Some swift tools are hard-coded to use ``/etc/swift`` and are apparently not going to be fixed. @@ -311,7 +311,7 @@ function configure_swiftclient() { function init_swift() { local node_number # Make sure to kill all swift processes first - swift-init all stop || true + swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true # This is where we create three different rings for swift with # different object servers binding on different ports. @@ -363,15 +363,15 @@ function start_swift() { # proxy service so we can run it in foreground in screen. # ``swift-init ... {stop|restart}`` exits with '1' if no servers are running, # ignore it just in case - swift-init all restart || true - swift-init proxy stop || true + swift-init --run-dir=${SWIFT_DATA_DIR}/run all restart || true + swift-init --run-dir=${SWIFT_DATA_DIR}/run proxy stop || true screen_it swift "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONFIG_DIR}/proxy-server.conf -v" } # stop_swift() - Stop running processes (non-screen) function stop_swift() { # screen normally killed by unstack.sh - swift-init all stop || true + swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true } # Restore xtrace