5 ms·
I Have Deleted Systemd
- ksherlock 3y agoI accidentally deleted su once. Not directly; I was cleaning up a botched upgrade and uninstalled linux-utils. Sudo was still there but couldn't do anything useful. This was on a qnap NAS device so eventually I used an arduino as a USB-to-serial-to-JTAG to manipulate the boot parameters, boot into single user mode, and edit the sudoers file.
- dekhn 3y agoIn college, many aeons ago, I bought a used Sun workstation (mainly for the copy of FrameMaker on the machine). At some point I was trying to clean up the root filesystem and deleted the root shell (I can't remember the details but I think there were two shells, one used to boot the system, and one for the user shell). That's how I learned that SunOS machines at the time had an extensive set of features for booting the machine (like, a built in EFI shell) and providing kernel params, so I was able to finally boot into the machine by telling the kernel to launch the user shell, which was enough to boot the machine to user space. The SunOS machines also could do pretty much everything over serial- including installing an entire OS.
- vbezhenar 3y agossh root@localhost suid bit is considered harmful
- pxeger1 3y agoWhy considered harmful? Connecting to a daemon running as root still relies on the security of the daemon.
- vbezhenar 3y agoBecause it's security escape hatch. It's not needed. Suid programs caused many vulnerabilities. There must not be a way to get more privileges, only less.
- kazinator 3y agoYou can do that if you had the forethought to edit your /etc/securetty file before nuking su, to allow root logins on the ptys used by sshd. If not, logging in on a physical console would work or rebooting to single either mode or whatever.
- sebazzz 3y agoI updated my arch installation once, but an incompatible version of glibc was installed. Unfortunately, pacman, which you use for all packages, links itself to glibc and refused to run. Directly attempting to replace the glibc binaries caused a kernel panic. I had to reboot and chroot from a recovery disk to my installation and upgrade/repair glibc and pacman there.
- JojoFatsani 3y agoCattle not pets. Carve a new partition with gparted, install new OS, mount the old partition and copy over any valuable data. (Hopefully you have this backed up anyway)
- Lt_Riza_Hawkeye 3y agoWhy not chroot in and use your now-connected internet to reinstall systemd?
- NBJack 3y agoThis works when you have automated setup of the services, configuration, etc. I can't speak for you, but my home machines don't have the same love and care for that step as parts of my kubernetes cluster.
- 28304283409234 3y agoLive USB stick, boot, copy everything from the 'broken' install to a second USB stick, reinstall, restore. Or, if you really want to get into the weeds, try to re-install systemd. As a learning exercise. This is a great question on a job interview though. "What happens on a Debian machine if you 'apt remove systemd'?"
- worg 3y agofrom a LiveUSB one can probably chroot into the borked system and re/install the deleted files without manually copying
- 28304283409234 3y agoThat's literally what I said. :)
- Brian_K_White 3y agoI hope the answer the interviewer expects is "Did your current guy do that? Is that why you're interviewing? Was it you?" I've been a unix and linux jackofall since '96 or so, and I could not answer that question better than "probably a big mess" Though it would certainly not be points against if they did happen to say "I tried that once just to see". That is good curiosity and tinkering, but I never happened to try it once just to see myself. I guess it could be a valid question just to see if the response shows some flavor of shock and alarm. IE everyone is expected to say "I don't know" but if the response is blank as though the question were not remarkable, that's not encouraging. I guess my answer would be "Holy sh... we don't have time for this, take me to the machine right now." haha Or just "I dunno but I'll clean it up."
- theamk 3y agoGood old "I've deleted c:\windows\system32" problem, but now in Linux.
- rzzzt 3y agoI moved IO.SYS, MSDOS.SYS and COMMAND.COM into the DOS folder to tidy things up a bit. Then I had to wait until someone could lend me a bootable floppy.
- yjftsjthsd-h 3y agoThis is modestly different in that the package manager actually accepted the task and went to install what should have been a replacement automatically. A person could even reasonably argue that this is evidence there's a missing dependency somewhere; nominally, I'm pretty sure debian still supports sysv enough that you're supposed to be able to use it, and apt is supposed to handle dependencies enough that switching should work, it's just a really low-priority / undermaintained path.
- amelius 3y agoShows how brittle package managers are. In this day and age, a simple "apt rollback" should be enough.
- Hendrikto 3y agoAs /u/theamk said, this is analogous to deleting windows32… at some point, if you do stuff like that, without knowing what you are doing, you have to take responsibility for borking your system.
- chuckadams 3y agoSince the NT days, Windows uses the system attribute on most things in that directory, which prevents delete from working unless forced. You'd think apt would scream bloody murder about dependencies, but apparently not.
- throw10920 3y agoThis is not analogous to deleting windows32. The original poster didn't go around deleting random files on their hard drive - they used a known interface, apt/dpkg, in the manner it was meant to be used, further evidenced by the fact that the fix basically boiled down to running more apt commands (and getting wired internet, which you'd have to do if you used apt to remove wireless configuration tools). It's entirely reasonable to ask for a "rollback" feature in this case.
- thiht 3y agoHard disagree. The op went out of their way to remove an essential package without any knowledge about it, or about Linux as a whole for that matter, of course something ends up breaking! Not everything can be optimized for stupidity (with no offense intended, we all do stupid stuff and learn the hard way to not do stupid stuff, that doesn’t necessarily mean we are stupid) What would this magical "apt rollback" do anyway? Rollback to what state? Should it rollback the auto remove and the remove? Or just the auto remove since it’s the last command?
- lakomen 3y agoHow is that one the HN frontpage
- d3m0t3p 3y agoCause it’s funny ? Enjoy the little things in life
- jraph 3y agoI'm impressed by the involvement of the person who went to the great lengths of recreating the issue in LXC containers to answer.
- Teknomancer 3y agoCame out of the cave expecting a critical jest and call to action "Delete systemd" the sprawling Linux overseer that flouts the Unix philosophy, with a host of arguments supporting why it's ripe for replacement in the name of simplicity. Was sorely disappointed.
- simonblack 3y agoAh, yes. "Let's delete systemd." What's that? I should replace it with something else? .....OH! I didn't. So that's why nothing works.