From 633caca8a409fb0685809082b7fc86d433d33f17 Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Fri, 15 May 2020 06:23:38 -0700 Subject: Fix ftp dir permission in sftp-server container Container entrypoint descendant script in atmoz/sftp:alpine image is changing mount binded ftp dir owner to 'root' which makes removing it by 'clean' action not possible hence adding o+w permission for it. Change-Id: I0d9339db80c4cd8e31c4368ac63741c531a626fa Issue-ID: INT-1577 Signed-off-by: Bartek Grzybowski --- .../mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml | 1 + test/mocks/mass-pnf-sim/pnf-sim-lightweight/fix-sftp-perms.sh | 2 ++ test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh | 5 ++--- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100755 test/mocks/mass-pnf-sim/pnf-sim-lightweight/fix-sftp-perms.sh diff --git a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml index a13a76bd7..4e3c5a240 100644 --- a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml +++ b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/docker-compose-template.yml @@ -35,6 +35,7 @@ services: - "${PORTSFTP}:22" volumes: - ./files/onap/:/home/onap/ + - ./fix-sftp-perms.sh:/etc/sftp.d/fix-sftp-perms.sh restart: on-failure command: onap:pano:1001 diff --git a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/fix-sftp-perms.sh b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/fix-sftp-perms.sh new file mode 100755 index 000000000..b9f4dae85 --- /dev/null +++ b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/fix-sftp-perms.sh @@ -0,0 +1,2 @@ +#!/bin/bash +chmod o+w /home/onap diff --git a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh index b1aa43749..1751d07c5 100755 --- a/test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh +++ b/test/mocks/mass-pnf-sim/pnf-sim-lightweight/simulator.sh @@ -94,9 +94,6 @@ function compose(){ cd config envsubst < vsftpd_ssl-TEMPLATE.conf > vsftpd_ssl.conf cd - - - set_vsftpd_file_owner - } function build_image(){ @@ -109,6 +106,8 @@ function build_image(){ } function set_vsftpd_file_owner() { + # This is to avoid "500 OOPS: cannot open config file" + # on vsftpd daemon start sudo chown root ./config/vsftpd_ssl.conf } -- cgit 1.2.3-korg