Fix sed busy (#2426)

* fix sed device or resource busy errors

Signed-off-by: Jonathan Sloan <jsloan117@gmail.com>

* update info

Signed-off-by: Jonathan Sloan <jsloan117@gmail.com>

* update docs

Signed-off-by: Jonathan Sloan <jsloan117@gmail.com>

* log and fail if config is a mountpoint

Signed-off-by: Jonathan Sloan <jsloan117@gmail.com>

* correct mountpoint check

Signed-off-by: Jonathan Sloan <jsloan117@gmail.com>

Signed-off-by: Jonathan Sloan <jsloan117@gmail.com>
This commit is contained in:
Jonathan Sloan 2022-12-03 03:15:30 -05:00 committed by GitHub
parent ea0b525e71
commit 3a7320e5cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -130,12 +130,12 @@ Compose sample:
- OPENVPN_PASSWORD=pass
```
### If you only need to mount one file
### Do not mount single config file
You might not need to mount a folder of configs. You may just have one config file you want to use.
In that case you can just mount it directly. Mounting it as `default.ovpn` will let you omit `OPENVPN_CONFIG` as well.
Do not mount a single config directly. The container will fail if you try, since it causes sed errors when modify-openvpn-config.sh is executed.
Instead mount the directory where the config exists.
Compose sample:
```
- /volume1/docker/ipvanish/my-preferred-config-file.ovpn:/etc/openvpn/custom/default.ovpn
```bash
sed: cannot rename /etc/openvpn/custom/sedHeF3gS: Device or resource busy
```

View File

@ -159,6 +159,11 @@ if [[ -z ${CHOSEN_OPENVPN_CONFIG:-""} ]]; then
fi
fi
# log message and fail if attempting to mount config directly
if mountpoint -q "$CHOSEN_OPENVPN_CONFIG"; then
fatal_error "You're mounting a openvpn config directly, dont't do this it causes issues (see #2274). Mount the directory where the config is instead."
fi
MODIFY_CHOSEN_CONFIG="${MODIFY_CHOSEN_CONFIG:-true}"
# The config file we're supposed to use is chosen, modify it to fit this container setup
if [[ "${MODIFY_CHOSEN_CONFIG,,}" == "true" ]]; then