Better HN
topnewbestaskshowjobs
Log inSign up

gotar

1 karma · joined Apr 18, 2012 (14y ago) · 4 submissions

Submissions

comment 4y ago · link · parent

You've probably looked at wrong repo. Any example of ugly code?

comment 4y ago · link · parent

On the contrary - everything in systemd is much easier than before.

Consider a situation, where your sh-backed SysV init was missing some function you required. Something between start-stop-daemon() or ifup(). You could throw a bunch of shell commands (note: most shell "programmers" are not capable of doing it properly; they do some '==' comparisons in /bin/sh shebang, don't handle errors, ignore fact that variables might contain "funny" characters etc. - but in general most of the scripts I've seen during my 24 years in Linux was simply badly written, meaning at least using bashizms). And then ...you watch out for every single package update that would overwrite your changes. Or you could polish them and try to push upstream.

Now the situation seems to be worse - you can't just edit some random file to add missing function, you need to write it in source C files and recompile. Not a way for quick and dirty solution.

But instead, you can simply write the same (s)hell commands in a script and call it from appropriate unit. No messing with thousand-lines scripts, no risk of overwrites, no need for upstreaming.

comment 4y ago · link · parent

> How do I list what's running?

systemd-cgls

> How do I list units

systemctl list-units

Simply use tab completion (like in zsh). And do not dare to compare UX-nightmare from git with systemd...

comment 14y ago · link · parent

At last