mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 22:21:10 +02:00
enter_chroot: try to avoid sudo when deleting sync pid file
The sync pid file is created without using sudo which means we should be able to delete it without using sudo. By default, run `rm` directly and if it fails, fall back to sudo like we historically have. BUG=None TEST=`cros_sdk --enter true`; see pid file deleted Change-Id: I26d898f6d594eb9ea4652335468345dd11303122 Reviewed-on: http://gerrit.chromium.org/gerrit/8644 Commit-Ready: Mike Frysinger <vapier@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
0c80dfb97d
commit
470be99f4f
@ -418,7 +418,8 @@ function teardown_env {
|
|||||||
# starting the syncer process when this occurs by deleting the
|
# starting the syncer process when this occurs by deleting the
|
||||||
# PID file.
|
# PID file.
|
||||||
kill $(<"${SYNCERPIDFILE}") && \
|
kill $(<"${SYNCERPIDFILE}") && \
|
||||||
sudo rm -f "${SYNCERPIDFILE}" || \
|
{ rm -f "${SYNCERPIDFILE}" 2>/dev/null || \
|
||||||
|
sudo rm -f "${SYNCERPIDFILE}" ; } ||
|
||||||
debug "Unable to clean up syncer process.";
|
debug "Unable to clean up syncer process.";
|
||||||
|
|
||||||
debug "Unmounting chroot environment."
|
debug "Unmounting chroot environment."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user