Waiting for apt locks without hacky Bash scripts
blog.sinjakli.co.uk
Waiting for apt locks without hacky Bash scripts
1–10 of 30 posts
Re: Waiting for apt locks without hacky Bash scripts
#2Re: Waiting for apt locks without hacky Bash scripts
#3Re: Waiting for apt locks without hacky Bash scripts
#4> Be aware that removing the lock file is not a solution and may break your system.
Guess what? My system is already broken! It’s refusing to do what I want it to do (install a package so that I can test it) in favor of doing what some remote agent (the update service) told it to do.
At this point I just immediately delete the .lock file when I see that message. Never has given me any problems. If it did, I’d just reimage the VM and probably be done sooner than if I had waited for that lock.
Re: Waiting for apt locks without hacky Bash scripts
#5Re: Waiting for apt locks without hacky Bash scripts
#6Re: Waiting for apt locks without hacky Bash scripts
#7Re: Waiting for apt locks without hacky Bash scripts
#8Coming from Gentoo, encountering Debianesque systems only later, that all-out locking really surprised me. Portage, the Gentoo package manager, only takes a lock at the very end of the installation, when a file tree (result of compilation etc) is merged into the "live" filesystem - so that those merges are serialized and checked for collisions.
Re: Waiting for apt locks without hacky Bash scripts
#9Please use Packer to build your images; don't do it on ASG instance deploy.
If somebody in the company tells you you're not allowed to build your own images, tell them to go fuck themselves, and write an e-mail to that guy's boss's boss explaining how much engineering time you're wasting (and how likely the products are to fail due to ASGs trying to bootstrap systems on the fly) because they won't let you cut an AMI.
Re: Waiting for apt locks without hacky Bash scripts
#10I have a little app (written in golang) installed on each box that effectively is a task runner. Tasks can be written to do anything, including apt-get installing software.
If apt-get fails to run, the task fails (context.WithTimeout) and is run again at a later date. No random hacks needed. Everything is built to be idempotent, self-healing and eventually consistent.