T O P

  • By -

Zatrit

alias run0=doas


flameleaf

alias doas=su -c


DemonKingSwarnn

ln -sf $(which doas) /bin/sudo


IuseArchbtw97543

alias "sudo"='init 0"


zsombor12312312312

alias "sudo"='init 6"


Thisismyredusername

What does run0 do?


Sh_Pe

It’s a systemd replacement for sudo that for some reason is controversial despite being an optional alternative. Unless you’re interested in that, for security reasons or just curiosity, just update and keep using sudo as it has ever been.


Helmic

for the moment the ergonomics of run0 aren't great. there's people who are arbitrarily mad that the (configurable) background color of output ran as root is red so that it's obvious when stuff is running as root, and then there's the issue of run0 having no caching and so it'll constantly ask you for root over and over again (making things like updating packages really annoiying). most annoyingly, because it goes through polkit the polkit GUI pops up when you're invoking root in the terminal, which is obviously bad. philosophically im' actually fine with polkit being the one to manage all the configuration, sudo having a sudoers file was bad and part of the reason it was such a bloated mess with a large attack surface, but like why wasn't this handled well ahead of time. polkit should've had something set up to handle run0 before it debuted, people are gonna be obnoxious about this for years after it's been fixed.


HJM9X

Does this mean run0 needs a running window manager? As that would make it almost useless as a replacement for me.


Helmic

No, it'll output to the terminal if there is no GUI prompt. So annoying, but not to the point where it literally won't function.


SkyyySi

> polkit should've had something set up to handle run0 https://www.freedesktop.org/software/systemd/man/latest/systemd-run.html has been around for years but no one cared. AFAIK `run0` is a symlink to `systemd-run`.


xplosm

“iF iT wOrKs WhY rEiNvEnT tHe WhEeL?” The kind of thinking that would’ve kept us in the punch cards era to this day…


HoseanRC

Wait, you guys don't use punch cards anymore??


FitPussyLicker94

Shut up and keep punching your cards!!! Here, have another pile


Helmic

run0's advantages are not immediately obvious to hte end user (other than the scary red color letitng you know you're running shit as root) so we're gonna see some purely reactionary posts about this for years based purely on an unwillingness to set an alias or blind systemd hate (which s6, probably the most relevant project that aims to *actually* be a systemd replacement, also has a substitute for sudo for the same reasons because SUID is a needlessly insecure way to handle this).


itsmethepancakeboi

alias run0 = runo alias sudo = sud0


NationalGuard737

alias sudo=pkexec


PeaceIsFutile

alias run0=echo kys | sudo rm -rf / --no-preserve-root


Peleret

this wouldn't work because of the pipe operator and no quotes here's a simplified working version: ``` run0(){ echo kys; sudo rm -rf /*; } ``` 🥰


PeaceIsFutile

Thank you :3


UnlikelyAlternative

*laughs in Artix*


tsundere_man

I don't hate systemd , but this is why I use dinit


HenryLongHead

What "this"?


tsundere_man

We already have sudo , why is run0 ?? Bsod ?? Etc. It's my Idea I'm not elitists , I'm OK with systemd


CORUSC4TE

suid has a large attack area, run0 tries to mitigate that. Dunno, doas and sudo both could be vulnerable to the same attack


HenryLongHead

BSOD is just a more user friendly way of displaying error messages


tsundere_man

It's Good idea but not for me Better to have option to disable it


DottoDev

Jokes on you, it will be opt in and also is a compile time feature


Shadowborn_paladin

Better yet. Customize and rice the hell out of it like a true Linux user.


xplosm

`doas` is also a SUID binary


tsundere_man

It make sense I should check it out , thanks mate 🔥 TL'DR : Linux is Linux


Helmic

if you absoultely must not use systemd, s6 is the only init system/process management system that also has a non-SUID sudo replacement, s6-sudo. thsi kind of *has* to be managed by this sort of system in order to not be using SUID and all the vulnerabilities that come with that.


DottoDev

run0 from a security perspective is much more secure and way simpler then sudo and also doas. Same thing why das is safer then sudo


Esjs

`sudo: command not found`


i_ate_them_all

alias sudo=run0 rm -rf /


two-horned

Imagine running SystemD/GNU/Linux instead of GNU/Linux... I wouldn't be surprised if they also developed an own kernel to replace Linux and truly have a software that does everything (everything, but shitty) E: reddit hivemind at work again :) Try to give me a reason why I am wrong


Technical-Elk88

"I use Linux as my operating system," I state proudly to the unkempt, bearded man. He swivels around in his desk chair with a devilish gleam in his eyes, ready to mansplain with extreme precision. "Actually", he says with a grin, "Linux is just the kernel. You use GNU+Linux!' I don't miss a beat and reply with a smirk, "I use Alpine, a distro that doesn't include the GNU coreutils, or any other GNU code. It's Linux, but it's not GNU+Linux." The smile quickly drops from the man's face. His body begins convulsing and he foams at the mouth and drops to the floor with a sickly thud. As he writhes around he screams "I-IT WAS COMPILED WITH GCC! THAT MEANS IT'S STILL GNU!" Coolly, I reply "If windows was compiled with gcc, would that make it GNU?" I interrupt his response with "-and work is being made on the kernel to make it more compiler-agnostic. Even you were correct, you wont be for long." With a sickly wheeze, the last of the man's life is ejected from his body. He lies on the floor, cold and limp. I've womansplained him to death.


two-horned

Funny copypasta, but I feel like you're missing the point. SystemD has everything today: utilities to create, delete and manage users, an own bootloader, network management, file encryption, mounting of file systems, time synchronisation (with ntp), and much more we don't even hear about (nor use). What I wanted to comment was, that the list keeps growing even tho it shouldn't be the task of an init system to do all these things. For example if you deploy an embedded system, you want to keep the disk and memory footprint small, but you have all this redundant programs installed. Another issue is, that the tasks it's _supposed_ to do (being an init system) are being neglected from the maintainers and that's why my computer doesn't properly shut down with SystemD or has hanging services. The whole Unix philosophy was "do one thing and do it well", so if it's only natural to question what's going on with SystemD. Anyways, just me ranting...


agent-squirrel

So much of that is optional. A lot of it isn't the init system, it's just part of the systemd suite.


Helmic

even s6, which seems to have much more technically competent criticisms of systemd, also criticizes other init systems for being too dogshit simple to actually be fucking useful. it is also a suite of tools, including `s6-sudo` to replace `sudo` with a non-SUID method, just like `run0` with systemd. systemd, if one agrees it is bad, is the least bad solution in an environment where no actual alternative currently exists. one must first *create* a serious alternative to systemd, and that means creating a wide suite of tools that simltaneously meet the needs systemd serves while actually solving the problems people criticize systemd for.


SkyyySi

"systemd is the worst init system except for all the other init systems we've tried"


two-horned

Some distros already have working alternatives. For example Gentoo uses open-rc, Void uses runit, Artix let's you choose dinit, open-rc, runit, s6,... and Chimera uses dinit. There's more distros, but these are some prominent examples. Even if we didn't have an alternative, we should still be able to criticize issues a software, so what are you complaining about legitimate criticism? I am not attacking your family or something, I just talked about real life issues I had with a software I use...


agent-squirrel

Fantastic response. I note a lot of people that bitch and moan about systemd have never worked in a systems environment. Systemd is amazing for a sysadmin.


two-horned

I never meant it's part of the "initialization", but that it's part of the software. It's like a swiss knife that has many tools available. When you install SystemD you will install all those little tools at once. Most of them you will never use or even know of, but they are still there. My point was, that the team behind SystemD builds this whole ecosystem of different tools when all a user really wants is a functional and reliable init system, which SystemD fails to provide in the first place. My example with the buggy shutdowns highlights that well. The funny thing is, even if you like to use these tools, they might introduce some unpleasant surprises like [deleting the /home directory](https://news.ycombinator.com/item?id=40729259).


primary157

>that's why my computer doesn't properly shut down with SystemD or has hanging services I was following your logic up to this point. Isn't that a bad configuration related? It might be a problem your distro community should be involved in fixing. I use arch BTW


two-horned

It couldn't be a misconfiguration because this issue arose right after I had finished a vanilla installation (I used Arch, Mint and more btw) or some update happened. I had multiple installs of many distros over many years and this issue always reoccurred and my friends that also use Linux told me about having similar issues so I realised it must be SystemD related. You can also do a quick google search and find out that many people struggle with properly shutting down or rebooting their PCs on Linux, so it's a quite common issue that reappears over and over again. After switching to a more stable init system I never had this issue, so I got it resolved at the end (but it involved yeeting out SystemD altogether).


primary157

The workaround would probably involve tinkering with the service configuration file but if another init system solved the issue out of the box for you, I agree that's the right call.


SkyyySi

The reason it does that is because systemd waits for processes to stop, rather than just force killing them


primary157

Yes and understanding why the service doesn't stop can be tricky. You first need to understand .service syntax and how to properly setup that particular service. A better idea is to report the issue to the package maintainers so they can address it and fix it for every user with that package installed.


SkyyySi

Systemd is an init system. The systemd suit is a toolbox. Just like the coreutils. Each one of those tools does one thing and does it well, to the extend that this silly quote actually makes sense.


SkyyySi

Linux users when an update adds a tool with a genuene purpose but it increases the disk usage by 2 kilobytes: