Skip to content

Commit

Permalink
run.sh: remove garbages on boot
Browse files Browse the repository at this point in the history
Now rootlesskit is running with --pidns.

After restarting the instances, it is likely that same PIDs are reused
and hence docker/docker/pkg/pidfile gets confused:
https://github.com/moby/moby/blob/0105613eb2245c705446ce327396922bbee4e9d6/pkg/pidfile/pidfile.go#L26

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Jun 3, 2019
1 parent 729142a commit 203581c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions common/common.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,4 @@ export PATH
: ${XDG_CONFIG_HOME=$HOME/.config}
: ${XDG_CACHE_HOME=$HOME/.cache}
export XDG_DATA_HOME XDG_CONFIG_HOME XDG_CACHE_HOME

10 changes: 10 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#!/bin/bash
set -eu -o pipefail
# clean up (workaround for crash of previously running instances)
(
if ! [[ -w $XDG_RUNTIME_DIR ]]; then
echo &>2 "XDG_RUNTIME_DIR needs to be set and writable"
exit 1
fi
rootlesskit=$(realpath $(dirname $0))/bin/rootlesskit
cd $XDG_RUNTIME_DIR
$rootlesskit rm -rf docker docker.* containerd runc crio usernetes
)
exec $(dirname $0)/bin/task $@

0 comments on commit 203581c

Please sign in to comment.