Compare commits

...

2 Commits

Author SHA1 Message Date
lilydjwg lilydjwg
603e09f8b1 Merge branch 'run-inside-service' into 'master'
feat(arch-nspawn): use --keep-unit when running inside a service

See merge request archlinux/devtools!197
2025-07-26 14:10:13 +00:00
lilydjwg
2c792e44aa feat(arch-nspawn): use --keep-unit when $DEVTOOLS_KEEP_UNIT is set to 1 2024-04-28 11:28:11 +08:00

View File

@@ -61,13 +61,20 @@ nspawn_args=(
--directory="$working_dir"
--setenv="PATH=/usr/local/sbin:/usr/local/bin:/usr/bin"
--register=no
--slice="devtools-$(systemd-escape "${SUDO_USER:-$USER}")"
--machine="arch-nspawn-$$"
--as-pid2
--console=autopipe
--timezone=off
)
if [[ ${DEVTOOLS_KEEP_UNIT:-0} == 1 ]]; then
nspawn_args+=(--keep-unit)
else
nspawn_args+=(
--slice="devtools-$(systemd-escape "${SUDO_USER:-$USER}")"
--machine="arch-nspawn-$$"
)
fi
if (( ${#cache_dirs[@]} == 0 )); then
mapfile -t cache_dirs < <(pacman-conf --config "${pac_conf:-$working_dir/etc/pacman.conf}" CacheDir)
fi