Skip to content

Show Failed Service On Login

I was curious if anyone has ever configured a way to show the results of systemctl --failed as like a motd of sorts? Just every login it can basically show me if any services are in a failed or un-healthy state?

Anyone have any suggestions on how I can achieve this?

9 points12 comments
Open on Reddit
About this post
Posted
Archived
Score
9 · 100% up
Kind
Text
ID
38rfba

Author

30
posts
91
comments
2
media
View profile

12 comments

To have systemd --failed display every time you open a virtual terminal (like motd) simply add the command to ~/.profile This file is sourced e every time you open a POSIX conform terminal emulator.

3 points

If you want something to run when you log in to your desktop, put it at the end of your .xinitrc or use the "run on startup" functionality in your desktop environment if you use one. I would just have it open a terminal window that runs systemctl --failed. It will need to run as root, right? Maybe setup sudoers to allow your user to run that specific command without a password.

2 points

On most DEs xinitrc isn't used. Also the goal of the xinitrc is to initialise X, not display nonsense.

0 points

On most DEs xinitrc isn't used.

If you're using a login manager maybe. I certainly use it with my DEs.

Also the goal of the xinitrc is to initialise X, not display nonsense.

What exactly is wrong with having it run extraneous commands after it starts X and your desktop stuff? Yeah, it's kinda meaningless (should probably just fix the broken service) but thinking about automation is interesting and that's the entire point of using Arch for a hobby is to learn stuff and have fun. Quit being a hater.

1 points

You can set up a startup script that sends you an email with the contents of systemctl --failed upon user login? Or you could just create a startup script that opens a terminal and shows you systemctl --failed?

1 points

cat ~/.zlogin

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && /usr/bin/systemctl --failed

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.