this post was submitted on 09 Apr 2024
139 points (94.8% liked)

Linux

48153 readers
629 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
top 23 comments
sorted by: hot top controversial new old
[–] [email protected] 56 points 7 months ago (4 children)

Two additional commands I regularly use as a Sysadmin are

systemctl status without any unit to list show the general system status (lists units that are running, units that are starting and failed units right at the top) And then systemctl list-units --failed To show me just the failed units and did deeper what the problem is.

On a properly set up system I should quickly be able to ascertain if everything is "up and running" just by systemds status

[–] [email protected] 22 points 7 months ago (3 children)

You can also use systemctl status $pid to find out what service a process is from.

[–] [email protected] 12 points 7 months ago

This and systemctl cat $unit are my favorites.

[–] [email protected] 10 points 7 months ago

You can .... WHAT!?

Wow I did not know that. Incredibly helpful

[–] [email protected] 6 points 7 months ago

Oooh. Thank you, I didn't know that.

[–] [email protected] 10 points 7 months ago

You can skip list-units and just do systemctl --failed

[–] [email protected] 10 points 7 months ago

You can even drop the list-units and just use systemctl --failed

[–] [email protected] 4 points 7 months ago

Didn't know that. Thanks!

[–] [email protected] 30 points 7 months ago (1 children)

This is somewhat related to the article but also a little off topic.

I started using Linux about 6 months ago now and I feel like it’s been a continual learning experience (in a positive way). I was comfortable enough with Windows that I was on autopilot with most things.

I’ve used systemctl previously but I love seeing articles like this, so freely available, where I have the chance to learn a lot more about my system.

Tangent over, just had this on my mind for a while and needed to share.

[–] [email protected] 3 points 7 months ago

I agree - it can be overwhelming to constantly be reminded of areas in which one is lacking in knowledge (like when having to learn how to solve a relatively simple error), but the availability of learning resources really helps avoid demoralisation.

[–] [email protected] 8 points 7 months ago (5 children)

Side note: does anyone enable or use the magic sysreq key anymore?

[–] [email protected] 9 points 7 months ago

If you have a system with long-running leaky browser instances, Alt-SysRq-F is a lifesaver. It calls oom_kill, sacrificing one process to save the rest.

[–] [email protected] 6 points 7 months ago

Honestly no. Haven't found the need.

[–] [email protected] 2 points 7 months ago* (last edited 7 months ago)

I do, and used it today as well. My AMD gpu sometimes when booting fails to set the correct resolution on the 3rd display, and that causes the graphical session to freeze for some reason and I have to force a restart with sysreq and start the graphical session with a weird script that sets a custom res lol.

[–] [email protected] 1 points 7 months ago* (last edited 7 months ago) (1 children)

I use it for fun

And sometimes for testing system survivability

[–] [email protected] 1 points 7 months ago

Gotta keep that kernel on its toes.

[–] [email protected] 1 points 7 months ago (2 children)

It may actually be a security hazard since there is a small chance of e.g. OOM killing your lock screen or other such process.

[–] [email protected] 1 points 7 months ago

Please tell me that needs physical access to work. Now that I think about it - how does sysrq even work with laptop keyboards?

[–] [email protected] 1 points 7 months ago

Not on Wayland

[–] [email protected] 7 points 7 months ago

Here's some more examples:

Systemctl edit: create an extension for the unit file and add some changes
S edit --full: edit the full unit file (and timer too iirc)
S enable --now: enable + start
S disable --now: disable + stop

[–] [email protected] 0 points 7 months ago (2 children)

Is there an equivalent in SysVInit?

[–] [email protected] 2 points 7 months ago

No. But you can run some of the init scripts with 'status' and they might print something. And telinit can do a few basic things.