frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Atomic symlink deployments that work on macOS URL

https://github.com/mojoatomic/atomic-deployments
1•mojoatomic•2h ago
Most "atomic" deployment scripts aren't atomic. If you're using the standard symlink swap pattern for zero-downtime deploys, you've probably seen this:

bash ln -sfn releases/20260112 current Looks atomic. It's not. Run it through strace:

symlink("releases/20260112", "current") = -1 EEXIST unlink("current") = 0 symlink("releases/20260112", "current") = 0 There's a window where current doesn't exist. Under load, some requests get ENOENT. The fix is well-documented for Linux:

bash ln -s releases/20260112 .tmp/current.$$ mv -T .tmp/current.$$ current The mv -T calls rename(2) which atomically replaces the symlink. Problem solved. Except on macOS. BSD mv doesn't have -T, and it follows symlinks differently. The Capistrano/Deployer communities have known about this for over a decade. Most just accept the race condition on Mac, or tell you to develop on Linux. I needed something that works on both (MSP managing mixed fleets - Linux servers, Mac dev machines, CI runners on both). The solution turned out to be Python's os.replace(), which calls rename(2) directly:

bash if [[ "$platform" == "linux" ]]; then ln -s "releases/$rel_id" "$tmp_link" mv -T "$tmp_link" "current" else ln -s "releases/$rel_id" "$tmp_link" python3 -c "import os; os.replace('$tmp_link', 'current')" fi I wrapped this in a deployment script with: * Platform detection (GNU vs BSD coreutils) * Directory-based locking with stale PID detection * Automatic rollback on SIGINT/SIGTERM * State machine cleanup (knows whether to rollback vs just clean up temp files) Single bash script, no runtime dependencies beyond python3 (which is everywhere now). GitHub: [https://github.com/mojoatomic/atomic-deployments.git]

Q: Why not just use Capistrano/Deployer/Shipit? A: Those are great if you're already in that ecosystem. I needed a single script I could drop into any CI pipeline without pulling in Ruby/PHP/Node. Also, Deployer's own code shows it falls back to non-atomic on systems without mv -T. Q: Why not use containers/Kubernetes? A: Not everyone is on k8s. Lots of us still deploy to VMs, bare metal, edge devices. Symlink swaps are still the simplest zero-downtime pattern for those environments. Q: Python dependency defeats the "no dependencies" claim A: Fair. But python3 ships with macOS and virtually every Linux distro. It's as close to "always there" as you get. The alternative is writing a small C binary, which creates a different dependency problem. Q: What about NFS/network filesystems? A: Don't. rename(2) atomicity guarantees don't hold across network filesystems. This is for local filesystems only. Q: What about the renameat2() RENAME_EXCHANGE flag? A: That's Linux 3.15+ only and requires glibc 2.28+. It does a true atomic swap of two paths, which is even better. But it's not portable, so I stuck with the symlink + rename pattern that works everywhere. Q: Does this handle shared directories (logs, uploads, etc.)? A: Not in scope for this script. It just does the atomic swap. Capistrano-style shared directory symlinking is a separate concern.

Key technical points 1. ln -sfn is unlink + symlink, not atomic 2. mv -T on Linux calls rename(2) which IS atomic 3. BSD mv follows symlinks, breaking the pattern 4. Python's os.replace() calls rename(2) directly on all POSIX systems 5. Capistrano's workaround (create symlink in subdirectory, mv with relative path) works but requires their Ruby runtime 6. The script detects platform by checking if mv --version returns GNU, not by uname (more reliable for edge cases like GNU coreutils on Mac via Homebrew)

Veritensor – open-source tool to scan AI models for malware and license issues

https://github.com/ArseniiBrazhnyk/Veritensor
1•arseniibr•32s ago•1 comments

Minnesota sues Trump administration to block surge of federal immigration agents

https://www.reuters.com/world/minnesota-sues-trump-administration-block-surge-federal-immigration...
1•mickle00•34s ago•0 comments

Show HN: AI Elements Vue – A Port of Vercel's AI Elements UI Library

https://github.com/vuepont/ai-elements-vue
1•peoray•2m ago•0 comments

Discord dataset of 78M messages, voice sessions, actions and servers

https://twitter.com/H4ckmanac/status/2010691804132454708
1•circularfoyers•2m ago•0 comments

Generative AI and the end of permanent car paint

https://realizeai.substack.com/p/the-evolution-of-personalization
1•rafaelmdec•2m ago•0 comments

Ask HN: DevOps Learning Resources

1•jack_pp•3m ago•0 comments

PauseOS: Distraction-Free Phone OS

https://pauseos.com/
2•MinimalAction•5m ago•0 comments

You can now reserve a hotel room on the Moon for $250k

https://arstechnica.com/space/2026/01/you-can-now-reserve-a-hotel-room-on-the-moon-for-250000/
2•dangle1•6m ago•0 comments

Great Green Wall 2.0: China is geoengineering deserts with blue-green algae

https://www.scmp.com/news/china/science/article/3338326/great-green-wall-20-china-geoengineering-...
2•jnord•6m ago•0 comments

Who told you you couldn't do that?

https://theaiunderwriter.substack.com/p/who-told-you-you-couldnt-do-that
1•participant26•9m ago•0 comments

Wireless Power Beamed from Moving Aircraft

https://spectrum.ieee.org/wireless-power-movin-airplane
1•WaitWaitWha•12m ago•0 comments

Queen bumblebees are poor foragers thanks to sparse tongue hair

https://www.sciencenews.org/article/queen-bumblebees-tongue-hair-foraging
1•WaitWaitWha•13m ago•0 comments

Nintendo Switch 2 sales stumble over Christmas

https://www.thegamebusiness.com/p/nintendo-switch-2-sales-stumble-over
1•comebhack•13m ago•0 comments

Phind Is Shutting Down

2•MekaiGS•14m ago•1 comments

Interview Coder Just Leaked Full Names and Companies of All SWEs Who Cheated [video]

https://www.youtube.com/watch?v=8T1vW85xFiQ
5•mickle00•22m ago•0 comments

Bill Ackman Funds ICE Agent GoFundMe Run by Nazi Imagery Poster

https://theintercept.com/2026/01/12/ice-gofundme-bill-ackman-jonathan-ross/
14•cdrnsf•23m ago•3 comments

Micro SD Card Extender – 68cm (26 inch) long flex cable

https://www.adafruit.com/product/3688
2•striking•25m ago•0 comments

XMPP Integration with N8n – ProcessOne

https://www.process-one.net/blog/xmpp-integration-with-n8n/
1•neustradamus•26m ago•0 comments

Clipboard Images in Claude Code CLI

https://www.woodcp.com/2026/01/clipboard-images-in-claude-code-cli/
2•tawman•28m ago•1 comments

Whatever happened to Trump Mobile's promise of a golden phone?

https://www.pbs.org/newshour/economy/whatever-happened-to-trump-mobiles-promise-of-a-golden-phone
11•type0•30m ago•0 comments

RVAA: Recursive Vision-Action Agent for Long Video Understanding

https://github.com/mohammed840/RLM-implementation
1•tmzt•32m ago•0 comments

AI's Memorization Crisis

https://www.theatlantic.com/technology/2026/01/ai-memorization-research/685552/
1•twalichiewicz•32m ago•2 comments

Show HN: I built a 220-lesson programming academy using only Claude Code

https://academy.thunderson.dev
1•eyrockscript•38m ago•0 comments

Show HN: Nudge – Enforcing guardrails for coding agents

https://github.com/attunehq/nudge
3•ilikebits•40m ago•0 comments

OpenAI has acquired the health-care technology startup Torch

https://www.cnbc.com/2026/01/12/open-ai-torch-health-care-technology.html
2•shelfchair•43m ago•0 comments

Google removes AI health summaries after investigation finds dangerous flaws

https://arstechnica.com/ai/2026/01/google-removes-some-ai-health-summaries-after-investigation-fi...
6•barishnamazov•44m ago•0 comments

Non-Essential French Embassy Staff Have Left Iran

https://www.barrons.com/news/non-essential-french-embassy-staff-have-left-iran-sources-d84d1f51
19•mhb•46m ago•4 comments

A deep dive on agent sandboxes

https://pierce.dev/notes/a-deep-dive-on-agent-sandboxes
1•icyfox•46m ago•0 comments

Republican introduces bill seeking to make Greenland 51st state

https://thehill.com/homenews/house/5685118-fine-introduces-greenland-bill/
8•zqna•52m ago•6 comments

The "Bermuda Triangle" and the Growing Risk in the Insurance Markets

https://natlawreview.com/article/bermuda-triangle-and-growing-risk-insurance-markets
1•petethomas•55m ago•0 comments