Live data from Hacker News

Reclaiming the lost art of Linux server administration

pietrorea.com

91–100 of 485 posts

Re: Reclaiming the lost art of Linux server administration

#91
post #25

Earlier quoted context omitted.

Not sure what you are saying, bash behaves as bash when invoked as /bin/bash, and Bourne-shell-ish when invoked as /bin/sh. Lots more detail in the man page. I've never seen use of aliases in a bash script...? They are generally for CLI convenience.

Alias expansion within scripts is mandated by POSIX. When bash is not in POSIX mode, it violates the standard. $ ll /bin/sh lrwxrwxrwx. 1 root root 4 Nov 24 08:40 /bin/sh -> bash $ cat s1 #!/bin/sh alias p=printf p hello\\n $ cat s2 #!/bin/bash alias p=printf p world\\n $ ./s1 hello $ ./s2 ./s2: line 3: p: command not found

Sure but someone putting #!/bin/bash at the top of their script, written for non-POSIX bash, won't have that issue...

Re: Reclaiming the lost art of Linux server administration

#92
post #86
post #61

I have over 20 years of Linux/FreeBSD sysadmin experience ranging from universities to major silicon valley companies in both cloud and on-prem. When it comes to companies I mostly support cloud these days but when it comes to me and my family I accept every downside and host as almost all of our digital lives in a 42u rack in a gutted closet in our house with static IPs and business fiber. I know where our data live…

Yes but you have talent and a lifetime of experience, plus space for a noisy 42u rack full of servers, but not everybody does...

They never suggested otherwise. They simply shared their current setup.

Re: Reclaiming the lost art of Linux server administration

#93
post #86
post #61

I have over 20 years of Linux/FreeBSD sysadmin experience ranging from universities to major silicon valley companies in both cloud and on-prem. When it comes to companies I mostly support cloud these days but when it comes to me and my family I accept every downside and host as almost all of our digital lives in a 42u rack in a gutted closet in our house with static IPs and business fiber. I know where our data live…

Yes but you have talent and a lifetime of experience, plus space for a noisy 42u rack full of servers, but not everybody does...

People who have been woodworking for decades can own very expensive tools so that they can create very complicated things.

People who are experts in cars can own very expensive cars and tools to tune them.

People who have been working in music can have very expensive instruments and expensive headphones, microphones, sequencers, etc.

We seem to be looking down on experienced "computer experts" and wanting to take their tools away. It's been grinding my gears lately.

Re: Reclaiming the lost art of Linux server administration

#94

Blame the folks demonizing/shaming having "pet" servers and pushing immutable infrastructure. Linux server administration is quite enjoyable, and with how well apps these days can scale vertically, it really takes a special kind of workload to need (and actually saturate) fleets of servers.

In my experience Pet servers are a good starting point (you really should _graduate_ from Pet servers into all the various immutable/cattle stuff), but it can quickly require discipline from the Admins.

They can't be doing one-off undocumented config, package, and network/firewall changes which make it impossible to setup another server reliably. At $company I moved us to Terraform+Packer (to get them used to immutable deploys, but still just an EC2 instance) then Pulumi+Docker+Fargate so we could fix our deployment velocity. The CTO was constantly afraid everything would break; mostly cause it actually would break all the time. Now basically anyone can deploy even if they're not a SysAdmin.

That's not to say you can't automate a Pet Server, but it's a lot more likely for someone to "just once" make some changes and now you don't trust your automation. In our case we had SaltStack and we were blocked by the CTO from running it unless it was off-hours/weekend.

Re: Reclaiming the lost art of Linux server administration

#95
Honestly after discovering NixOS I have a new found joy of administering Linux servers. It's easy and painless, everything is declarative and versioned, and new machines can be set up for new projects or scaling in a matter of minutes.

This "cattle not pets" mentality doesn't make sense for everything and is highly inefficient if the OS itself seamlessly supports immutable workloads and configuration.

Re: Reclaiming the lost art of Linux server administration

#96

Earlier quoted context omitted.

Relying on bash is a recipe for non-portability.

If you're not publishing your scripts and you're running your own infrastructure, you probably don't care about portability at all.

None of the BSDs use bash in their base. Apple recently switched from bash to zsh. OpenBSD uses a descendent of pdksh.

Another major user of a pdksh descendent is Android (mksh), with a truly massive install base.

Some of the bash problem, besides portability, is GPLv3. That was a major factor for Apple. I don't want my script portability linked to corporate patent issues. For this and other reasons, I don't use bash-specific features, ever.

Re: Reclaiming the lost art of Linux server administration

#97
post #78

Earlier quoted context omitted.

I settled with using /bin/sh for portability. If there is something that can't be done with sh but can be done with bash then it means a python script is better anyway. I don't want to deal with bashism and ksh and deb/ub/rh different takes on bash. It's frustrating that most google search results and shell script search results on SO almost always mean bash and sh.

Yes, well if a script I wrote has somehow ended up on a machine without bash, then I'd be more worried about other assumptions the script makes.

That's missing the point.

Some server I know don't have vim. Traefik docker image is running ash and not bash. Tomcat image hasn't vim. Etc. /bin/sh is there. No worry about assumptions. No bashism, no fish, no zsh.

Re: Reclaiming the lost art of Linux server administration

#98
I don't know, abstraction is the name of the game and it makes my job 1000x easier. I have multiple servers running in my house that host everything from Plex to small little apps I've written, it all runs in containers and I couldn't be happier. Is being able to setup a Wordpress site with a script really something we should strive for?

I've always been a fan on "standing on the shoulders of giants" and it's served me very well to have this mindset. I'm fine to dive deep when I have to but diving deep just to dive deep.... not so much.

Semi-recently I had need of a simple blog for a friends/family thing, I spun up a wordpress and mysql container and was done. Over a decade ago I used to setup and manage wordpress installs but it's not a skill I need.

I find this article a little odd since they talk about server admin but then also scripting setup script for your server which is more in the "cattle" category for me and less in the "pet" that I would consider "server administration".

Re: Reclaiming the lost art of Linux server administration

#100

Earlier quoted context omitted.

That's when it clicked for me.. comparing my hourly salary rate vs. the cost of running these services "in the cloud." Entirely eliminating "system administration" from my duties was absolutely a net win for me and our team.

> Entirely eliminating "system administration" from my duties... ... and adding "cloud administration". What is it with people doing completely one-sided analysis even when they experiment the thing by themselves? Is cloud administration less time consuming than system administration? That's not my experience, so I'm quite interested on how it got so.

> Is cloud administration less time consuming than system administration?

Infinitely, and if you look at it from a startup lens it only makes sense. One needs to point only at the recent log4j incident. This is obviously a gigantic black swan event, but even just ongoing security patching at the OS level can be a full-time gig. There is absolutely no substitution for being able to ship code to a platform that just runs it and scales it for you.

Andy Jassey had a great slide a few years back at Reinvent, when talking about Lambda -- "in the future, 100% of the code that you write will be business logic". If you really think about that: how many times have you had to write some kind of database sharding logic, or cache invalidation, or maintaining encrypted environment variables, whatever. That idea that you can toss that -- and what that gives to teams, not having to spend massive timesinks and budgets and hiring and all of that on -- effectively -- solved problems, you really start to understand how you can move faster.

Post reply on HN