this post was submitted on 05 Jun 2026
768 points (98.1% liked)

linuxmemes

31675 readers
1656 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • Don't come looking for advice, this is not the right community.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. πŸ‡¬πŸ‡§ Language/язык/Sprache
  • This is primarily an English-speaking community. πŸ‡¬πŸ‡§πŸ‡¦πŸ‡ΊπŸ‡ΊπŸ‡Έ
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  • Β 

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 3 years ago
    MODERATORS
     

    reupload because i mixed up sigterm and sigkill like a dumb fuck

    you are viewing a single comment's thread
    view the rest of the comments
    [–] cybervegan@lemmy.world 8 points 4 days ago* (last edited 4 days ago) (1 children)

    Nah man. "kill" doesn't shut the system down quickly. This is the "instant death" way - the kernel reset gun - no shutdown scripts, no disk sync, just reset to BIOS boot sequence, instantly:

    As root:

    echo 1 > /proc/sys/kernel/sysrq

    echo b > /proc/sysrq-trigger

    If you change out the "b" in the second command for "o" it will just halt the kernel instead of rebooting. Still switched on, but the system is doing absolutely nothing.

    I used to use this trick all the time to test high availability server clusters.

    [–] filcuk@lemmy.zip 3 points 4 days ago (1 children)

    Pardon my ignorance, how does halting the kernel help? We're you seeing if other instances jump in for the halted one?

    [–] cybervegan@lemmy.world 6 points 4 days ago (1 children)

    You mean in the context of high availability?

    tl;dr: It's to test if the cluster fail-over configuration is working properly.

    So this was before things like Kubernetes or Terraform were a thing, so had to be done by the operating system itself. The simplest HA cluster is made of two nodes, one in "active node", the other "passive". The active node does all the work, and the passive node just keeps its data synchronised with the active node. I used to use DRBD for this, which is a system for copying writes to the active node over a network link to the passive node. That only gives you a "second, up-to-date copy" which is not that useful on its own - you also need a way to automatically switch over to using the passive node if the active one "dies", and for that I used to use "heartbeat", which simply passes packets back and forth between the two cluster members - ping-pong style - and if the passive node notices that the active node hasn't sent its scheduled packet for, say, 10 seconds, it cuts it off the current active node (kills it), and promotes itself to the active role, thus preserving the service. Killing the "other node" is necessary to stop data corruption or user requests going to a node that can't actually service them, and is called STONITH - Shoot The Other Node In The Head. STONITH can involve an electronically controlled switch, which literally cuts off power to the "other" node, or can isolate it on the network, by shutting down its network ports on the switch, or in a VM setup, sending a notification to the hypervisor to kill the VM.

    The reason you need to be able to kill the kernel on the active node, is that when you manually shut down the active node, it automatically informs the passive node that it's going down, known as an "orderly fail-over", and you're not actually testing if the heartbeat fail-over works, you're just testing an orderly fail-over. Killing the active node's kernel tests that the passive node is properly configured to take over during a catastrophic failure of the active node. You can watch the heartbeat status go from "up" to "down", and then see the passive node decide to take over, promote itself and bring up its services, and begin processing requests.

    To make sure it's all working, you need to test orderly fail-overs first, from both nodes, then test disorderly fail-overs both ways, by using the kernel gun on the active node.

    Things moved on from Heartbeat-based HA clusters to multimode clusters managed by Corosync and other software, enabling other strategies to be employed. This was eventually supplanted by "orchestration" systems like Kubernetes, and proprietary Virtual Cloud systems that move this functionality to the platform rather than the operating system.

    [–] filcuk@lemmy.zip 2 points 3 days ago (1 children)

    I see! That's fascinating stuff. I only do simple home hosting, so I never get into deployments like this, or how things used to be done, but love to hear the intricacies of it.

    [–] cybervegan@lemmy.world 2 points 3 days ago

    Yeah it was wild, but I suspect few orgs do things that way any more.