diff options
author | Ivan Shapovalov | 2023-12-23 06:59:07 +0300 |
---|---|---|
committer | Ivan Shapovalov | 2023-12-23 08:40:58 +0300 |
commit | c07d448f7e1b078b85fd55a6245c350d47dab07c (patch) | |
tree | 78462b12722ce5364770fc561ad0083a8d732c21 /PKGBUILD | |
parent | 54f2b025a2c1bcf85d72a92378aa89edc2530f40 (diff) | |
download | aur-c07d448f7e1b078b85fd55a6245c350d47dab07c.tar.gz |
Do not start podman-system-service if we have one
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 39 |
1 files changed, 24 insertions, 15 deletions
@@ -96,20 +96,27 @@ EOF # 4. Run podman-system-service to create a dockerd-compatible control socket # and point every broken tool in existence towards it. - export DOCKER_HOST="unix://$PWD/docker.sock" - podman system service --time 0 "$DOCKER_HOST" >&2 & - podman_pid="$!" - - _kill_podman() { - trap - EXIT - if [[ $podman_pid ]]; then - msg2 "Stopping podman service instance (PID ${podman_pid})..." - kill "$podman_pid" - wait "$podman_pid" - podman_pid= - fi - } - trap _kill_podman EXIT + # (Do not run podman-system-service if one is already available.) + if [[ -e /var/run/docker.sock ]]; then + : + elif [[ -e /run/user/$UID/podman/podman.sock ]]; then + export DOCKER_HOST="unix:///run/user/$UID/podman/podman.sock" + else + export DOCKER_HOST="unix://$PWD/docker.sock" + podman system service --time 0 "$DOCKER_HOST" >&2 & + podman_pid="$!" + + _kill_podman() { + trap - EXIT + if [[ $podman_pid ]]; then + msg2 "Stopping podman service instance (PID ${podman_pid})..." + kill "$podman_pid" + wait "$podman_pid" + podman_pid= + fi + } + trap _kill_podman EXIT + fi # 5. Set $DAPPER_CACHE_HOME to hopefully persist (some) caches # FIXME: point this to $HOME after we make sure this works @@ -134,7 +141,9 @@ EOF make archpkg # 8. Stop the podman-system-service instance. - _kill_podman + if command -v _kill_podman &>/dev/null; then + _kill_podman + fi } package() { |