Lurker News
I created a TUI for systemd/systemctl called isd (interactive systemd).

It provides a fuzzy search for units, auto-refreshing previews, smart sudo handling, and a fully customizable, keyboard-focused interface for power users and newcomers alike.
It is a more powerful (but heavier) version of sysz, which was the inspiration for the project.
This should be a huge timesaver for anybody who frequently interacts with or edits systemd units/services. And if not, please let me know why! :)

Comments (204) 37 threads

Show all comments

Showing thread 36 of 37

owyn12 replies#
This looks neat. I have to look up the very fiddly and unintuitive systemd commands all the time. service start? service.foo start? start foo.service? Oh right, sudo systemctl start service.foo

And the feedback is so bad. It should know everything in its own config dir and tell me how to do what I want to do. Was it enabled? I forget. How do I look at logs? Oh right journalctl. Also the layout of things with lots of symlinks and weird directories in places that annoy my 90's linux sysadmin brain. Why am I looking at /lib/systemd/system
I am annoyed by the redundant "systemd/system" directory name every time I have to go there. At this point, just promote it to /etc/systemd and build a better CLI.
As a very occasional linux sysadmin just trying to make things work, the "typing at a console" systemd interfaces are not fun to work with. Maybe nobody should be doing that. In an enterprise, sure that's different. I think interfaces should be human, and linux should still be fun.

mixmastamyk1 reply#
I haven’t had much trouble with the cli, but it is kinda wordy. I made this alias:

    alias sc='sudo systemctl'
Now it matches the sc utility introduced in Windows many years back. Then remember the verb goes first.
johnisgood1 reply#
Yeah, and you can omit the ".service" suffix, and you could use ".timer" suffix, too, if you have a timer for that service.

As much as I do not like systemd, I do not think its commands are an issue, and I use "systemctl status" and "journalctl" as well with some flags at times.

robinsonb51 reply#
"systemctl" would be less of an issue if "sysctl" didn't already exist and do something completely different.

Continue this thread — 1 reply

kjkjadksj3 replies#
It is a bit crazy to me how everyone says “dont use cron systemd is in now” but cron just does what it says on the tin with no problems. I have lines that work fine ran in script or on my crontab but when wrapped in a launchd command no longer work (log says things work until the db is to be updated which tells me launchd ran processes lack sufficient permissions perhaps to update my db but its not clear why this is the case or how I can elevate launchd sufficiently.
viraptor1 reply#
Launchd is not used in systemd - why would anything be wrapped in it? The config is simple - User for the user and Group for the group. You can print it the result of "id" if you're not sure what the result is.
kjkjadksj#
Sorry I conflate the two since they share a lot of similarity. Launchd is what I use as its a macos system.
MrDrMcCoy#
> cron just does what it says on the tin with no problems.

I can name a rather large problem with cron that systemd timers solve handily: long-running job duplication. When jobs take longer to run than the space between their triggering times, duplicates start piling up. I've had to rescue numerous systems from such states, which are difficult to detect until things have gotten quite bad. Sure, you can write a bunch of boilerplate to handle this yourself with cron, but with systemd timers it's all handled for you along with other niceties like capturing all output in journald and ensuring that the next run starts at soon as possible.

simoncion2 replies#
> ...cron just does what it says on the tin with no problems.

Yeah, tell me about it.
We had a production-down support ticket filed for one of the things that I work on at $DAYJOB. The customer's VM's disk was full. Why? Because the 'timer unit' that was supposed to run logrotate every day had never been run and was never scheduled to run. (The VM had been up for a month at this point.) No other customers had ever reported this issue, and we'd not changed anything about that timer unit or what it is supposed to run in ages.
No amount of gyration or agitation with 'systemctl' and friends OR rebooting of the VM kicked the cron replacement into proper functioning. 'logrotate' was simply never being scheduled to run. This fucker was WEDGED, and the tools weren't helping us understand why.
We read through all the docs on all the various kinds of units and don't see what we're doing wrong. We do a BUNCH of digging, and find an -IIRC- open Github issue from years back where someone was running into this problem. More or less the last word on the issue was Poettering saying something like "Well... actually, now that we've said that that particular cascade of options isn't actually supposed to work, now I'm not so sure that they're NOT supposed to work.". And that was -apparently- that.
IMO, when your cron replacement can be easily configured in such a way as to never even try to run the thing that you scheduled it to run, you really need to go back and rethink how you've built your cron replacement.

glandium3 replies#
At least systemctl status tells you when next the timer will trigger. Cron doesn't.

Continue this thread — 3 replies

teddyh#
Considering how many things of questionable veracity are said about systemd in general, and Lennart in particular, I would like a link to that issue before I take your characterization at face value.
Denvercoder92 replies#
> I am annoyed by the redundant "systemd/system" directory name

It's not redundant, you also have /etc/systemd/user (and /lib/systemd/user) where units that run in the user context (as opposed to system-wide context) are stored.

godelski#
It's also worth noting that this is a fairly standard pattern in /etc

  /
  | etc
  | | fail2ban
  | | | action.d
  | | | fail2band.d
  | | | filter.d
  | | | jail.d
  | | ssh
  | | | ssh_config
  | | | sshd_config
  | | systemd
  | | | network   # network wide context
  | | | nspawn    # containers
  | | | system    # system wide context
  | | | user      # user wide context
Personally I like it more than

  /
  | etc
  | | cron.d
  | | cron.daily
  | | cron.hourly
  | | cron.monthly
  | | cron.weekly
  | | ...
  | | firewall
  | | firewalld
Keeps things less cluttered. Hierarchical categorization is >> than lateral
cyberax#
It could have been named 'global' instead of 'system'.
rcxdude#
I find that at least systemd means that it's consistent across distros. I spent way more time looking up this kind of thing when every distro rolled their own init system.
greenavocado2 replies#
This is why I have instated a policy of using systemd --user services whenever possible.

If you don't need elevated permissions this is ideal.
All you have to do is enable linger using loginctl if you want your service to auto start as the user on boot unattended.
Your user services live in ~/.config/systemd/user

bityard#
I used to do this but frankly it's easier to run a system-level unit as whatever user you want and keep all the files in /etc instead of scattered around /home.

The user-level units are most useful when running an actual multi-user system. If you trust your users to not abuse them, anyway.

j16sdiz1 reply#
I tried, but found it very confusing around the user session. Apparently an environment variable need to point to a started dbus. I can't get consistent results over local session vs ssh vs su vs sudo
greenavocado#
What are you trying to do with dbus?
zamadatix4 replies#
My biggest annoyance is "systemctl status" gives you just enough of the service's log to make the output take up most of the terminal each time you run it but never enough of the service's log to get a useful picture of what's actually happened with the service lately.

Not to mention unless the problem with the service completely prevented it from running (it advises some commands to run in that case) you're supposed to just always remember "journalctl -xeu $SERVICE" was the incantation, less you want to go look up the flags again or manually parse the entire "journalctl" output.
Overall I generally like systemd though. The syntax can just be a burden sometimes.

Denvercoder92 replies#
In case you don't know, you can use the `-n` argument to `systemctl status` to tweak the log output, e.g. `-n0` to disable the log output and `-n40` to get more than the default 10 lines.
zamadatix3 replies#
That's a great option to tweak the behavior and I hadn't known about it (or if I ever had, I'd well forgotten). Thanks!

From the man page it ?looks like? if you want reverse or full then it's still off to the journalctl command and arguments but at least "-n9999" is better than "always 10 lines".

Continue this thread — 3 replies

kai-tub#
Nice! I didn't know that was an option. Definitely something I should make configurable in `isd` :+1:
SJC_Hacker#
> My biggest annoyance is "systemctl status" gives you just enough of the service's log to make the output take up most of the terminal each time you run it but never enough of the service's log to get a useful picture of what's actually happened with the service lately.

How about
systemctl status foo | tail

kristopolous20 replies#
it's the same mentality that brought us the git design - the easiest, least typing options are rarely, if ever the thing you want to do.

Instead, these invocations give cryptic messages, throw errors, or sometimes, even break things.
The most common and helpful things are hidden deep behind multiple flags and command line arguments in manuals that read like dictionaries more than guides.
I'm always at a complete loss as to how such decisions are made. For instance, "git branch -vv" is the useful output you would like to see, every time, that should be "git branch". Why not make the current output, "git branch -qq"? Is a humane interface too much to ask for? Apparently...
I know people defend this stuff, but as a senior engineer in programming pits for 30 years, they're wrong. Needless mistakes and confusions are the norm. We can do better.
We need to stop conflating elitism with fucked up design.

Continue this thread — 20 replies

Continue this thread — 1 more reply

Continue this thread — 6 more replies