11 ms·
A Trip into FreeBSD
- johnisgood 6y ago> Something interesting is that when I set the user account to nologin I actually was unable to log in as the user. Usually in Linux you can hack around this with su flags but FreeBSD doesn't have this escape hatch. Neat. For anyone who is wondering, it is: "su -s /bin/bash user". Typically when you want to su to it and it has nologin, it will say "This account is currently not available." or "su: user /bin/bash does not exist or the user entry does not contain all the required field". The former mostly. You can bypass this with the aforementioned flag to su.
- davidcuddeback 6y ago`sudo -u user /usr/local/bin/bash` works on FreeBSD.
- toast0 6y ago(only if bash and sudo are installed) /bin/sh is part of base and can be relied upon (outside of esoteric setups), as well as /usr/bin/su
- johnisgood 6y agoHey, I did not say that it does not, because I have no idea. :)
- davidcuddeback 6y agoNo worries. I was just pointing out that there's still a way to hack around it.
- johnisgood 6y agoOf course, thank you for it.
- mst 6y agoAnd it's been a fairly common thing for 20 years now to have a 'toor' user that's 'root but with a sh/bash shell'.
- xena 6y agoI tried that but it just said `su: Sorry.` and exited with 1.
- johnisgood 6y agoInteresting, which OS? Can you tell some details? I am on Arch Linux, and my su version is: su from util-linux 2.36.1. With root and that command I can become http, git, what have you. :D
- xena 6y agoFreeBSD 12.2 on a raspberry pi
- johnisgood 6y agoHmm, I see. On Linux, at least on Arch Linux using that version of su it does work. Someone said "sudo -u user /usr/local/bin/bash" works on FreeBSD. Does that work at least? Of course change the user and potentially the path to bash if you have it installed elsewhere.
- slacka 6y agoBeginning with FreeBSD on exotic devices like these is going to ensure a poor first impression. Had she started on a standard x86_64 PC desktop or supported laptop like the thinkpads, she would have had much better results.
- drewg123 6y agoYes and no.. She was using qemu/KVM on amd64 and had sendmail hang doing a DNS looking, blocking boot. I wish sendmail was not enabled by default. She could have just ^C'ed it, but coming from Linux, how was she supposed to know that?
- toast0 6y ago^C on Linux used to work; that it doesn't under systemd (or at least Debian's default configuration of systemd) is on my list of grudges.
- flatiron 6y agomy guess is because of the parallel startup that systemd does, what would the ctrl-c be stopping if there are multiple services coming up?
- toast0 6y agoWhatever has been running without daemonizing for longest? Or just all the things currently running interactively. Or maybe just everything that hasn't started yet. Any option is better than having to chose between waiting indefinitely or hitting ctrl-alt-del and starting in single user mode and hoping to be able to disable it there.
- naikrovek 6y agoSYSTEMD ITSELF is on my list of grudges.
- Lammy 6y ago> I wish sendmail was not enabled by default. Agreed that it's a poor default these days, but for what it's worth the option is available in the post-install setup interface alongside some other security tuning knobs.
- naikrovek 6y agoI used FreeBSD at Yahoo (even on my desktop) and purposely avoided Linux at all times, and I was very happy because of it. Linux got a lot of usage where FreeBSD would have been a better choice simply because Linux was the "hot new thing" that people wanted to use. They didn't want to use the best thing, or look at alternate things, they wanted to use the thing they had heard others were using. It's a shame, because FreeBSD is a great operating system that almost no one has used seriously.
- UnlockedSecrets 6y agoWhat about freebsd makes it a better choice as compared to Linux based systems?
- naikrovek 6y agoHonestly, I don't know how the landscape looks today. At the time, FreeBSD could run Linux binaries faster than Linux could on the same exact hardware, for one. At Yahoo, we used FreeBSD on all of our servers and Linux on zero of our servers, and that probably changed over time. I don't know. It was just very stable. You could reboot without worry that a kernel update would break anything or prevent boot-up. It was almost a realtime OS considering how light it was. I don't think it actually qualifies as an RTOS but we knew exactly what performance we could get out of a particular server configuration, and if the performance ever deviated, we knew there was a problem. It was very deterministic in that way. Linux may be as good or better than FreeBSD now. I don't know. But 20 years ago, Linux getting all the attention saddened me a lot. At the time, if you wanted an open operating system, without any cruft clogging things up, FreeBSD was it.
- bluepoint 6y agoI confirm the fact that linux binaries were noticeably faster at least in 2000, when I was using it exclusively. Also I had a laptop with a broken memory module. Linux would panic unless I put it in the fridge (don’t ask me how this came about, but it helped), but freebsd was stable, apart from some crashing applications. And the kernel configuration was easy to read and understand.
- sigjuice 6y agoDoes anyone know how one might do “automagic FQDNS“? At home, at any given time I might have around 10 or so Linux or BSD VMs across my laptop, Synology or Raspberry Pi’s. I’d like them to know each other’s names (even if they are not all directly reachable via IP). I really really hate typing or copy/pasting IP addresses.
- Sean-Der 6y agoIf they are in the same subnet you could use mDNS! I use it for my NASes and Linux desktops and it works great. `ssh seanlaptop.local` is much better then having to ping broadcast or log into the router :)
- sigjuice 6y agoAs mentioned, they can't reach each other over IP so they are not on the same subnet (e.g. I prefer NAT for my VMWare Fusion VMs). mDNS has not been reliable in my experience, even between a collection of macOS and Linux systems. Also, the OpenBSD and musl libc resolvers don't even speak mDNS.
- tedunangst 6y agoMost devices send their hostname in the dhcp request. Which gets recorded in the dhcpd.leases file or wherever. Take that info, add it to DNS zone file or wherever.
- paxswill 6y agoA sibling comment mentions mDNS, which can work but sometimes requires an extra package. The simpler solution is to connect your DHCP and DNS servers. Dnsmasq has this built in, and is frankly a fantastic piece of software. If you’re sticking with ISC servers, BIND can be configure to allow dynamic DNS updates, and dhcpd can in turn be configured to manage those updates.
- takeda 6y agoI set up something like that long time ago with bind + isc-dhcp. You configure the domain and enable nsupdate on it with a key. Then configure DHCPd to use that key to populate the domain with hosts. Edit: This is roughly how it is configured: https://unix.stackexchange.com/questions/265142/isc-dhcpd-to-register-or-update-bind-dns-with-client-hostname https://unix.stackexchange.com/questions/265142/isc-dhcpd-to... If you use different dns/dhcp tools it might be done differently.
- haskal 6y agoFreeBSD Jails: https://docs.freebsd.org/en/books/handbook/jails/ https://docs.freebsd.org/en/books/handbook/jails/ Underrated feature.
- yjftsjthsd-h 6y agoI hear good things, but how are they superior to docker? UX seems worse, although that could be my unfamiliarity at fault.
- eredengrin 6y agoI'm far from an expert in either one, but jails being built in definitely makes them feel more integrated. Also certain things about docker always felt a little weird - seems like it litters random places in filesystem, the whole docker daemon architecture feels strange too. Definitely easier (at least for me) to get up and running with docker, even if it feels more janky (to be fair, I haven't used iocage or some of the other jail management tools so perhaps that would make it a bit easier). Haven't used it yet but what I've read about podman looks like it may fix some of my docker complaints. Again, I've only dabbled in both of them so would be happy to hear other experiences as well.
- nix23 6y agofor jails i use iocage, you can't compare it to docker but a bit to kvm (but it's not hardware-virtualization but os-virtualisation), BastilleBSD is what docker is for Linux.
- mst 6y agoThere's a bunch of scripting around them, but the point is more around the isolation - jails are properly isolated in a way that containers are (explicitly) not designed to be. bastille among others try to provide a nice UX atop them, but the important thing is that jails are strictly more powerful (on FreeBSD a jail can have its own network stack, while still running on the same kernel, for example) I dunno about 'superior' but jails are very definitely different and provide a bunch of features containers don't.
- 6y ago
- tutfbhuf 6y agoHmm, I submitted this 2 days ago, and it still shows 2 days in my submission list, but here it says it has been submitted 9 hours ago, why?
- sq_ 6y agoIIRC, the mods will periodically boost interesting links that didn’t get very far when originally submitted back up. I’d guess that’s it?
- tutfbhuf 6y agoAh okay so the popularity list of interesting links in HN is not only user driven, as I initially thought (except for rule violations), but also mod driven.
- sq_ 6y agoI’ve seen dang explain it before, although I don’t remember exact details. I think they’ll just give interesting links a bump every now and then if they didn’t get a fair shot for whatever reason.
- detaro 6y agoHere is some links from dang with details: https://news.ycombinator.com/item?id=19774614 https://news.ycombinator.com/item?id=19774614 https://news.ycombinator.com/item?id=11662380 https://news.ycombinator.com/item?id=11662380
- tutfbhuf 6y ago> We started doing this because it turned out that if you lob a story onto the front page with an old (say "2 days ago") timestamp, the thread will turn into "how is this story on the front page when it was posted 2 days ago". I'm not sure if it's the right approach to edit timestamps, sounds like a hack to me.
- rud 6y agoCtrl+c skips the whole cannot resolve hostname thing iirc. Linux users: don’t try to run freebsd as you would run linux... Than you’ll see why it is so different...
- 787868023DE0 6y ago>> After waiting for about 5 minutes I gave up and decided to try out the Raspberry Pi 4 There seem to be quite a lot of posts where people 'try' out FreeBSD in a very superficial or largely inappropriate way. I'm a long-time FreeBSD user (20+ years) and it excels for stable operational *server* use-cases - trying it out as a user workstation for a few hours/days and complaining that the installer is text-based, the desktop environment is less polished, or performance is a few %-age points less than Linux on an artificial benchmark completely misses the point and isn't really helpful - if you want a simple rock-solid server operating system running it is great but you get the benefit in the long-term not immediately.
- teekert 6y agoAhh, the feel of this website, so... warm and nice. I want to stay there.
- nix23 6y agoYes! The color palette is great.
- xena 6y agoAuthor of this article here. If you have any questions feel free to ask them!
- kevans91 6y agoFWIW, RPi 4 is fraught with peril on FreeBSD < 13.0 -- and even if you could have gotten it to boot, you'd find neither ethernet nor USB. FreeBSD >= 13.0 has an aarch64 RPI image that should boot OOTB for both RPi3/RPi4 -- the medium article referenced predates the introduction of this image, and it should generally make all the firmware steps obsolete. The dts replacement might still be necessary with it, I hadn't really looked at the differences between the one placed in review vs. upstream.
- xena 6y agoI actually tried a FreeBSD 13 image on the rpi4 and got the same not showing up on the network or replying to pings issue. I think that FreeBSD 13 on rpi4 might just not be ready yet. I wish I had a micro-HDMI cable to diagnose things further.
- kevans91 6y agoI think someone reported the latest firmware or something pulling some shenanigans if there's no display connected, whether we use it or not. I don't recall the specifics at the moment, though.
- soapdog 6y agoI enjoyed this article a lot (much like other articles by the OP). One aspect that made me smile is that they're impressed by how few processes are running when they run `ps x | wc -l` on their machine and see about 45 processes. I just checked my little NetBSD x230 here and it is running 19 processes out of the box, that is less than half. I think that alone shows a good difference between FreeBSD and NetBSD in terms of the out-of-the-box experience. I'm not saying NetBSD is better, I like both systems, I'm just saying that they do have very different assumptions about what should be enabled and running by default.
- deadmetheny 6y agoIt is official; Netcraft now confirms: BSD is dying One more crippling bombshell hit the already beleaguered BSD community when IDC confirmed that BSD market share has dropped yet again, now down to less than a fraction of 1 percent of all servers. Coming close on the heels of a recent Netcraft survey which plainly states that BSD has lost more market share, this news serves to reinforce what we've known all along. BSD is collapsing in complete disarray, as fittingly exemplified by failing dead last in the recent Sys Admin comprehensive networking test. You don't need to be a Kreskin to predict BSD's future. The hand writing is on the wall: BSD faces a bleak future. In fact there won't be any future at all for BSD because BSD is dying. Things are looking very bad for BSD. As many of us are already aware, BSD continues to lose market share. Red ink flows like a river of blood. FreeBSD is the most endangered of them all, having lost 93% of its core developers. The sudden and unpleasant departures of long time FreeBSD developers Jordan Hubbard and Mike Smith only serve to underscore the point more clearly. There can no longer be any doubt: FreeBSD is dying. Let's keep to the facts and look at the numbers. OpenBSD leader Theo states that there are 7000 users of OpenBSD. How many users of NetBSD are there? Let's see. The number of OpenBSD versus NetBSD posts on Usenet is roughly in ratio of 5 to 1. Therefore there are about 7000/5 = 1400 NetBSD users. BSD/OS posts on Usenet are about half of the volume of NetBSD posts. Therefore there are about 700 users of BSD/OS. A recent article put FreeBSD at about 80 percent of the BSD market. Therefore there are (7000+1400+700)4 = 36400 FreeBSD users. This is consistent with the number of FreeBSD Usenet posts. Due to the troubles of Walnut Creek, abysmal sales and so on, FreeBSD went out of business and was taken over by BSDI who sell another troubled OS. Now BSDI is also dead, its corpse turned over to yet another charnel house. All major surveys show that BSD has steadily declined in market share. BSD is very sick and its long term survival prospects are very dim. If BSD is to survive at all it will be among OS dilettante dabblers. BSD continues to decay. Nothing short of a cockeyed miracle could save BSD from its fate at this point in time. For all practical purposes, BSD is dead. Fact: BSD is dying
- jjav 6y agoFreeBSD (and OpenBSD) are very refreshing systems. It is what Linux was once upon a time, what SunOS was way back when, if you were around and feel what that means. Cohesively put together but beautifully simple. Wherever security or reliability or maintainability matters, nothing beats simple & elegant. I've been a Linux full time user since nearly the beginning (started in '92) and been slowly migrating to BSDs for server use. Unfortunately the baroque complexity of systemd is making Linux distros more into OSX-like opaqueness. And nothing wrong with OSX, I have a Mac too and like it for what it is. But I'd never run servers on OSX, and Linux is starting to become something I'd rather not run servers on. FreeBSD is a breath of fresh air.
- 1MachineElf 6y agoI just wish it was as easy to manage a FreeBSD system as it is to manage a NixOS system. +1 yes, this.