Everything is systemd now

The last time I was running linux on my desktop was back in 2011 or so. That time having things like:

  • ntpd, crond 
  • runlevels and all the init.d scripts 
  • conf.d scripts

 ... was a normal and straightforward thing to use. Just google for "systemV" or "System5"

But things had changed since then. In favor for fewer seconds less of the wait time for a system boot up (which was probably one and only downside of having things starting sequentially), Linux distros have moved to systemd with its cumbersome configs with units, targets, timers and all that stuff.

And yeah, ntpd is also gone, it's now chrony.service.

"Fuck, I hate changes" - I thought at first. But then, after a while, I realized the new scheme of things brings much more flexibility, if you use it in a right way.

So instead of runlevels we now have some.targets. Targets can include (aka require) other targets. Like for your graphical.target where you have X.Org started you might want to have network.target to be reached as well. It makes a lot of sense as it gives you more clear nesting of service groups

Here's the quick cheat sheet.

What is the default target Linux
will try to boot into
systemctl get-default
Change default target
systemctl set-default <target_name>
List all units (services, targets, timers) including disabled
systemctl list-unit-files
What is current target(s)with systemd it  can be more than one:

systemctl list-units --type target --state active
Change current targetsystemctl isolate <target_name>
Show dependency tree of what default target requires / specific target requires
systemctl list-dependencies [<target_name>]
See status and other details about specific unit (service, target, ...)
systemctl status <unit>
See the whole system journal logs in "tail" modejournalctl -f
See specific unit journal logs in "tail" modejournalctl -f -u sshd.service

 

No comments:

Post a Comment

Start here

Disable Firefox from updating itself and flash those annoying "Restart to Keep Using Firefox" messages on you

I recently switched from Brave to Firefox. Just because Brave appeared to be some proprietary shit, even though they're masking themselv...