Skip to content

34 comments

A server... running arch...

Brave.

20 points

I wasn't even aware -- Arch has been super stable for me once I set it up (and setting it up actually kind of forces a deeper understanding than most other distros).

I've been recklessly running pacman -Syu for years without even knowing the pacman tool super deeply (I always have to look up pacman -Qs in the manual) and have had relatively little trouble

6 points

You shouldn't just use pacman -Syu and do nothing else.

This wiki page explains some nuances of pacman you should be aware of

When pacman removes a package that has a configuration file, it normally creates a backup copy of that config file and appends .pacsave to the name of the file. Likewise, when pacman upgrades a package which includes a new config file created by the maintainer differing from the currently installed file, it saves a .pacnew file with the new configuration. pacman provides notice when these files are written.

When .pacnew files are created, typically you check the difference between the unchanged-currently-using-version with the pacnew version. The pacdiff tool helps with this.

3 points

Maybe I'm an outlier then. I've had a couple of instances where it's failed to boot after an upgrade.

More importantly however is security. Bleeding edge software won't be as thoroughly tested as the software on Ubuntu/Debian ect.

2 points

It's not as unstable as people think. I have three raspberry pi servers running arch, and besides the one on a shifty internet connection that's only available over VPN for a reason out of my control, they have all been exceptionally stable.

1 points

My laptop runs on Arch. It's not unstable per-se, although I have had a few issues after upgrades. My personal server runs Ubuntu 16.04 LTS, which I'm far more comfortable with. It gets security updates, but runs older software that is security tested more. It just makes me more comfortable that the server is secure, even if I don't update straight away.

1 points

Interesting read, great job on recovering the server. My only nagging thought while reading the whole thing was: Surely just getting the box config into ansible or similar would have skipped the entire thing. Investing in build tools has allowed me to basically forget systems administration for anything other than my personal desktop. When a box is bad I just torch it and rebuild it.

3 points

This box does hold an embarassing amount of not yet backed-up state -- Nothing mission critical, but there are databases for projects that I don't have backed up anywhere except on the local disk, and to torch the box I'd need to snapshot the FS at the very least (I'm running ceph, so theoretically I could add another node, rebalance, then torch the one node).

I do use ansible, so I definitely understand the savings though (and I'm not sure if I noted it in the article, but I was actually playing with Kubernetes before the incident, another big piece of the servers-as-cattle puzzle) -- I'm just not sure it would have changed much if I had run the update (and fubar'd the boot) from an ansible script or myself. Ansible would have helped on the rebuild though, but technically if I had set up the box with ansible, and this problem happened, it'd happen over and over again until I decided NOT to do the update (then I'd be back to figuring it out and trying to debug it, maybe on a spare machine).

"torching a box and rebuilding" is definitely the goal though (rephrased, treating my servers as cattle and not pets), but I'm not quite there yet -- in particular the backup issue is my biggest worry. I think the system I've used that's gotten me the closest to this was CoreOS's Ignition. CoreOS had multiple partitions for upgrades, and would rollback automatically IIRC if an upgrade failed, and encouraged you to provision systems using Ignition and completely map out your system in YAML basically -- brilliiant as far as I'm concerned.

At the end of the day it seems like it's almost impossible for someone to truly run a group of servers as cattle and torch at will -- surely the DB/data cold-storage servers you'll have to be more careful with? How are people handling this?

1 points

Depends on your budget and performance requirements. You mention k8s: run your mysql as a container with a persistent volume claim backed by ceph.

Now you only care about the health of your ceph and k8s cluster, which is more than one machine, and you should be able to always drain at least one if it's bad and rebuild it. Now you need to have the discipline to only wreck one machine at a time, but it's a more manageable problem.

EDIT: Just to be clear as well, I really like your write-up. The world needs more of them. And carefully bringing a system back to life is a valuable skill, I just like not having to rely on it.

2 points

Hey man, if this is your article, just wanted to mention that iptables should have a config file at /etc/iptables/iptables.rules.

2 points

Hey it absolutely is! thanks for noting -- I was wondering where the hell the file was! I've used iptables restore and had to try and make sense of the output when debugging some issues with kube-router once, but I never learned enough about iptables since I've been using ufw to abstract it anywhere I could...

I'll update the blog post, thanks again

1 points

No problem! The file is the configuration it loads on startup, and the command iptables-save is the same thing, but for the current configuration.

2 points

A tip to avoid the fear of updates: use something the lvm snapshot for the / partition of the system.

2 points

I think I'll make an effort to document and publish the weird problems I run into. I never really think about it since the problems seem so trivial (I've been doing this stuff since the 1990s), but just having it indexed and searchable online could help someone some day.

So, thanks for sharing. You saved someone's day.

1 points

Yeah that was the hope -- I have a ton of blog posts in the pipeline but this one might actually help someone at some point, especially if what happened wasn't strictly just user error on my part!

Much better than finding a random forum thread where someone's like "nvm fixed it"

1 points

Use pacmatic, it makes finding and updating .pacnew files almost brainless, and would go a long way to keeping things running.

(I use alias pacman="sudo pacmatic" in my bashrc.)

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.