サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
Appleイベント
utcc.utoronto.ca/~cks
Go 1.21 will (probably) download newer toolchains on demand by default For some time, Go modules have supported specifying the minimum version of Go required by the module in go.mod, through the go directive. Once you can have modules that specify a minimum Go version, you have a design question of what should happen when an older version of Go tries to do something with a module that says it requ
Unix broadly and Linux specifically has long had three functions that can do file locks, flock(), fcntl(), and lockf(). The latter two are collectively known as 'POSIX' file locks because they appear in the POSIX specification (and on Linux lockf() is just a layer over fcntl()), while flock() is a separate thing with somewhat different semantics (cf), as it originated in BSD Unix. In /proc/locks,
Unix's special way of marking login shells goes back to V2 Unix (at least) Many Unix shells have some command line argument that tells them that they are a login shell; for example, Bash has '-l' (also '--login'), and I think that '-l' has become the de facto standard. However, this argument is not how Unix programs like sshd and login actually tell your shell that it's a login shell; instead, for
We have a reasonable number of Linux servers, almost all of them running various versions of Ubuntu. Like pretty much everyone configuring Linux servers, we give them some swap space; the Linux kernel traditionally is much happier if it has a bit of swap space (cf), although you don't want too much. For a long time we used a separate disk partition for this (or a mirrored pair of them in a separat
If you've been running x86 Linux servers for long enough, you've probably noticed two changes in the kernel's text console. On the one hand, the text console has gotten substantially bigger, sporting sizes like 128x40 instead of the much smaller old sizes, for example 80x25. On the other hand, text output to the console has generally gotten slower, usually much slower than you would expect for the
Suppose, not hypothetically, that you have a machine that periodically has its load average briefly soar to relatively absurd levels for no obvious reason; the machine is normally at, say, 0.5 load average but briefly spikes to 10 or 15 a number of times a day. You would like to know why this happens. Capturing 'top' output once a minute doesn't show anything revealing, and since these spikes are
A while ago, I read Julia Evans' Teaching by filling in knowledge gaps and hit the section using Evans' shell brackets cheat sheet as an example. One of the uses of brackets in Bash and other shells is "process substitution" (also Wikipedia), where you can use a redirection with a process instead of a file as an argument to commands: diff <(rpm -qa) <(ssh server2 "rpm -qa") Process substitution is
Since Go 1.13, Go has embedded information about the modules used to build a program into its binary, and has reported them if you used 'go version -m ...' (release notes). This information has historically included a variety of things, including the path and module that the program was built from, an indication of any module replacements being used, and a marker that the program was being built f
Rust 1.x seems to not always be backward compatible in practice For a long time now, I've needed (or at least wanted) to simultaneously put a stress load on a test NFS fileserver and a stress CPU and memory load on another machine. Back in the old days on Linux, I would have done this by compiling the Linux kernel repeatedly, but in today's modern age the Linux kernel isn't big enough any more; it
One of the unusual things about Go is that it started out with the approach of directly making system calls on Unix, instead of calling the standard C library functions that correspond to those system calls. There are reasonably good reasons for Go to make direct system calls and this works well on Linux, but other Unixes are different. The official API for Illumos and Solaris system calls require
Even in Go, concurrency is still not easy (with an example) Go is famous for making concurrency easy, through good language support for goroutines. Except what Go makes easy is only one level of concurrency, the nuts and bolts level of making your code do things concurrently and communicating back and forth through channels. Making it do the right things concurrently is still up to you, and unfort
An exploration of why Python doesn't require a 'main' function Many languages start running your program by calling a function of yours that must have a specific name. In C (and many C derived languages), this is just called main(); in Go, it's main.main() (the main() function in the main package). Python famously doesn't require any such function, and won't automatically call a function called ma
Fedora 31 has decided to allow (and have) giant process IDs (PIDs) Every new process and thread on Linux gets a new PID (short for process ID). PIDs are normally assigned sequentially until they hit some maximum value and roll over. The traditional maximum PID value on Unixes has been some number related to a 16-bit integer, either signed or unsigned, and Linux is no exception; the kernel default
I'll start with my tweet: One of the frustrating things about operating ZFS on Linux is that the ARC size is critical but ZFS's auto-tuning of it is opaque and apparently prone to malfunctions, where your ARC will mysteriously shrink drastically and then stick there. Linux's regular filesystem disk cache is very predictable; if you do disk IO, the cache will relentlessly grow to use all of your fr
Over on Twitter, I saw the following question (via): There is lot of conversation around generics in #go, can't we have something like OpenGo, where community can implement generics , rather that waiting for official #go generics to happen ? Something like OpenJDK There are many answers for why this won't happen, but one that does not usually get said out loud is that Go is Google's language, not
In The output of Linux pipes can be indeterministic (via), Marek Gibney noticed that the following shell command has indeterminate output: (echo red; echo green 1>&2) | echo blue This can output any of "blue green" (with a newline between them), "green blue", or "blue"; the usual case is "blue green". Fully explaining this requires surprisingly arcane Unix knowledge. The "blue green" and "green bl
For reasons beyond the scope of this entry, today I feel like writing down a broad and simplified overview of how modern Linux systems boot. Due to being a sysadmin who has stubbed his toe here repeatedly, I'm going to especially focus on points of failure. The system loads and starts the basic bootloader somehow, through either BIOS MBR booting or UEFI. This can involve many steps on its own and
There's real reasons for Linux to replace ifconfig, netstat, et al One of the ongoing system administration controversies in Linux is that there is an ongoing effort to obsolete the old, cross-Unix standard network administration and diagnosis commands of ifconfig, netstat and the like and replace them with fresh new Linux specific things like ss and the ip suite. Old sysadmins are generally grump
In Three Months of Go (from a Haskeller's perspective) (via), Michael Walker makes the following observation in passing: I do find it a little strange that gofmt has been completely accepted, whereas Python’s significant whitespace (which is there for exactly the same reason: enforcing readable code) has been much more contentious across the programming community. As it happens, I have a theory ab
A perhaps surprising consequence of Requires dependencies in systemd I tweeted: Oh right. This service restarted because I said 'Requires=rsyslog.service' & I updated rsyslogd (which restarted it). Moral: don't do that. The systemd.unit manpage tells you that this will happen if you read it carefully. In the section on Requires: If this unit gets activated, the units listed here will be activated
Everyone knows what ^D does on Unix; it generates an end of file, so that cat or various other programs will exit (especially if they have accidentally wound up reading from standard input). But this is just the usual effects of typing ^D; it is not what it actually does. What ^D actually does is simple but subtle: Typing ^D causes the tty driver to immediately finish a read(). Normally doing a re
It turns out that the meaning of 'load average' on Unixes is rather more divergent than I thought it was. So here's the story as I know it. In the beginning, by which I mean 3 BSD, the load average counted how many processes were runnable or in short term IO wait (in a decaying average). The BSD kernel computed this count periodically by walking over the process table; you can see this in for exam
The chroot() system call is one of those that I think of as being really old. Up until a while back, if you'd pressed me I'd have guessed that it originated in V7. Then I dug into it and in that tweet claimed it was from 4.2 BSD. This is what you'd kind of expect and what it sort of looks like, but it turns out to be wrong and the history of chroot() seems to be much more interesting than I expect
Today on Linux, ZFS is your only real choice for an advanced filesystem Yesterday I wrote about what I consider advanced filesystems are in general, namely filesystems with the minimum feature of checksums so you know when your data has been damaged and ideally with some ability to use redundancy to repair from damage. As far as I know, today on Linux there are only two filesystems that are advanc
Suppose, not entirely hypothetically, that you initially set up a server with one system disk but have come to wish that it had a mirrored pair of them. The server is in production and in-place migration to software RAID requires a downtime or two, so as a cheap 'in case of emergency' measure you stick in a second disk and then clone your current system disk to it with dd (remember to fsck the roo
Let's start with the tweets: @thatcks: Everyone should strongly consider adding 'consoleblank=0' to the kernel command line on your Linux servers. #sysadmin @thatcks: The Linux kernel blanking the console screen is both unnecessary and dangerous on modern servers and modern setups. You want it off. By default if you leave a Linux machine sitting idle at a text console, the kernel will blank the di
The bytes and events data for NFS mounts in /proc/self/mountstats The per NFS mount mountstats performance stats (see here for an introduction) have two sets of high level statistics, reported in the bytes: and events: lines. Both of these come from counters that are described in comments in include/linux/nfs_iostat.h in the kernel source. Of the two, the simpler is bytes:. A typical bytes: line l
Don't use ab for your web server stress tests (I like siege instead) Like many other people, I sort of automatically reach for the venerable ab Apache program when I want to do some sort of a web server stress test. I've heard that it has flaws and it's not the best program out there, but surely it's good enough for the basics, right? Well, no, as I found out recently. I don't know exactly why or
Here's something that I've recently had my nose smacked with: Every place where users can authenticate over the network to your systems should log successful authentications, including the source IP address. Every place. No exceptions. And all of the pieces (minimally user name, remote IP, and time) should be logged explicitly in one place; you should not have to piece together this information by
このページを最初にブックマークしてみませんか?
『utcc.utoronto.ca』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く