Show HN: Interactive systemd – a better way to work with systemd units (isd-project.github.io)
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! :)
208 comments
[ 3.6 ms ] story [ 268 ms ] threadPlease open an issue on GitHub if you encounter any silly alpha issues.
Hey, that's me ! (And I love systemd !)
I haven't installed it yet so quick question: can it connect to remote host ? I often use systemctl --host <hostname> status foo.service (status, timers, logs etc. )
Either way, feel free to open an issue and I will have a look at it.
Sounds like you could easily support it by letting users pass in $REMOTE_HOST and when you use your `systemctl` wrapper, add `$CMD --host=$REMOTE_HOST`, after that everything should work as before.
https://github.com/isd-project/isd/issues/6
I have several user and system level services I manage, but debugging them is tedious. Your opening line that lists common commands and their pain points really resonated with me.
I’m on NixOS, so editing immutable unit files directly won’t work, but the service discovery, visibility, and management will be really helpful. Nice work!
I am planning on adding some "guides" in the documentation but in short: You should check out `systemctl edit --runtime` for debugging units on NixOS. It makes debugging sooo much easier.
My only problem is that I wish there were a way to install it on my machine and have it connect to a remote systemctl but that probably is a lot of work to reliably work (port may not be open etc etc).
Though I am by far no security specialist. Please let me know where I can improve the section!
One thing I found systemd really confusing was its treatment of ExecStop in a service script. ExecStart is the command to run when systemd starts the service at system boot up (or when a user tells systemd to start the service). However, ExecStop is run when the starting command has finished running. You have to set RemainAfterExit=yes to have the desired function of running the stop command on system shutdown or on user stopping the service. ExecStop is basically the "on-cleanup" event rather than "to-shutdown-the-service" event.
It is important to keep in mind that systemd is tailored towards daemons. So if your service just runs a command that eventually exits, you need to explicitly tell systemd to treat it differently than a daemon.
Edit: As others noted, you’re probably looking for oneshot + RemainAfterExit.
- on start: start the server
- on stop: do nothing, because you are already terminating the server
But suppose you need to perform an additional task when the server is terminated. That is where you would add a ExecStop command or script.
All I am trying to say is that the name of the option makes sense as-is: it literally runs the provided command(s) on service stop (“execute on stop”).
Similarly, ExecStart literally means command(s) to execute on start.
If the command runs a blocking daemon/server (usually the case), then the server will be implicitly stopped by definition - because if you’re stopping the systemd service, you’re interrupting any commands that are still running/blocking.
And relatedly, I honestly have no idea when I’d want to use ExecStartPre, or multiple ExecStarts, or ExecStartPost, and so on.
That’s what is assumed. But in reality it runs after the started process stops.
That makes sense to me personally. What would be the more intuitive design in your mind?
Maybe think about it this way: ExecStart is what the system will run to transition the service from the "starting" state to the "started" state. ExecStop is what the system will run to transition the service from the "stopping" state to the "stopped" state.
For a service with RemainAfterExit=no (the default), you enter the stopping state right away once the processes that got started in ExecStart exit. That's useful when you are starting some long lived process as a service, and in that case there is usually no need for an ExecStop. But semantically, ExecStop has the same meaning either way -- it's what needs to be run, if anything, to transition the service from the stopping state to the stopped state.
It definitely seems to be both "cause to stop" and "after (unexpected) stop" in one. You can look at $MAINPID to see which case you have. This design apparently makes sense to you, but to me and several others in this thread a service that has already stopped isn't in need of being stopped and shouldn't execute commands intended for that. (There is a separate ExecStopPost for "after stopping, for any reason".)
Is this really true? I understand why it does not work on NixOS (I tried just out of curiosity and it seems like it is unable to exec the host systemctl for some reason) but I don't think there's any reason it wouldn't work on other OSes that merely have Nix installed.
Interestingly though, on Nix v2.24.11, I can't use the provided Nix command either:
Even if that did work (you could adjust it into a Git URL to make it work) it would probably not be ideal since Nix has a native GitHub fetcher that is more efficient. I think this should be the actual Nix command: Anyway, this is cool. I actually wanted to make a similar thing using systemd's DBus API and Qt instead of a TUI and even started writing code for it, and if you wanted to I'm sure you'd find that the DBus API probably provides all of the functionality you would need (admittedly it is a lot easier to just call `systemd -H` than to implement your own SSH tunneling, though.) It kind of frustrates me that systemd and modern Linux in general is absolutely teeming with data and interfaces that could be exposed and make administering systems, especially desktop systems that were traditionally very inscrutable, much easier. e.g. in the past, how did you know what was going on when an xdg autostart app failed? Now with systemd running xdg autostart apps in some desktops, it would be really easy to provide a GUI that can show you the failed autostarts and even provide a GUI log viewer, and yet somehow, such a tool does not seem to exist, at least in the realm of things that are maintained and relatively feature-complete. Rather frustrating.I agree Linux could use better system APIs than "put file here" and "run these commands" which are much more error prone than making calls to properly documented interfaces.
Yeah, it get's complicated and I don't want to recommend it and explain the details. In short, I am creating the AppImage via nix. And the AppImage "mounts" (not overlays!) the AppImage's /nix/ directory. So calls from the TUI that would access /nix/ wouldn't go to the systems `/nix` directory, which leads to all kind of weird issues. For example, you could install your EDITOR via home-manager on Ubuntu. isd would start correctly because systemctl is "accessible" but if you open your EDITOR under `/nix` it wouldn't find it, which is super confusing as a user. -> So it is just easier to say to use the nix installation method if you are already using it :D
And sorry for the wrong docs, it is fixed now.
I also agree with your frustration. Personally, I would really enjoy working on such a tool but it wouldn't be an easy task, and who would support the work? This TUI had a manageable scope but it was still quite a bit of work. So I don't see myself investing too much into "higher-level interfaces".
PS: I have no idea why your post is ill-received :/
That makes a lot of sense. There's not really much trivial that I think you can do to deal with that.
> PS: I have no idea why your post is ill-received :/
It's not really a big deal, I was just surprised and wondered if anyone who was compelled to vote down might come back to explain why.
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.
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.
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.
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.
Was not aware that vixie cron was first released 1987(https://github.com/vixie/cron/blob/master/Documentation/Chan... 1.md), and still has fresh commits.
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.
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
The user-level units are most useful when running an actual multi-user system. If you trust your users to not abuse them, anyway.
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.
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".
And IIRC you can change the default behavior. In the worst case, just alias it if it is bothering you that much.
I would not call something so stylistic as `git branch -vv` as "sticking your head in the sand". Your fallback is not going to really confuse you or put you at risk of not knowing what's going on. I can totally understand if we were talking about aliasing something much more complicated, but at that point it's a script...
How about
systemctl status foo | tail
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.
You have the wrong mentality, and I hope this can help make your life easier. Programs are made so that the simplest option is the base option. This is because there is a high expectation that things will be scripted AND understanding that there is a wide breadth of user preference. There's an important rule
Customization is at the root of everything. We have aliases that solve most of the problems and small functions for everything else. You default to an non-noisy output, showing only __essentials__ and nothing more unless asked. Similarly, you do no filtering other than hidden files. This way, everyone can get what they want. Btw, this is why so many people are upset with default options on things like fdfind and ripgrep.For your problem with git, there are 2 solutions you have.
The design isn't fucked up, it is that you don't understand the model. This is okay. You aren't going to learn it unless you read docs or books on linux. If you learn the normal way, by usage, then it is really confusing at first. But there is a method to the madness. Things will start making more sense if you understand the reason for the design choices. (In a sibling comment I wrote the abstraction to command patterns that makes the gp's confusion odd. Because systemd follows the standard)Side note: if you try to design something that works for everyone or works for the average person, you end up designing something that is BAD for most people. This is because people's preference is not uniformly distributed, meaning the average person is not representative of any person in the distribution. This is because anything that is normally distributed has its density along the shell while a uniform distribution has a uniform density all throughout it.
Take a look at the manual
and bookmark "Bash Pitfalls" Live in the terminal as much as you can. It is harder at first, but you will get huge boosts in productivity quicker than you would know it (easily <2 weeks). It sucks doing things "the hard way" but sometimes that comes with extra lessons. The thing is, those extra lessons are the real value.[0] no matter how many years you've been using it there's no shame in being a noobie
I know it's hard to make things like this but let's do it anyway.
If every person has the same point of confusion than they are not the problem, it's the thing they're confused by.
There's better ways to do things and calling people naive for suggesting the obvious is the problem.
And about your side note: no. For example, when people checkout a branch, they want to track the remote branch 99.9% of the time. It should be the default.
The default journalctl should show where things have failed, that's why people are invoking it.
Also there's plenty of counterexamples that do these things. "ping host" genuinely pings the host. "ssh host" genuinely ssh's into the host.
You don't need to specify say, the encryption algorithm, that you want a shell, use say, "--resolve=dns" to specify the hostname resolution... It has sensible defaults that do what most people intend.
Under the model you advocate for "ssh host" would simply open up a random socket connection and then you'd have to manually attach a virtual terminal to it and request the invocation of shell separately, stacking each piece on top of the other, before you log in.
This design could be defended in the same way: Some people do port mapping, tunneling, SOCKS proxies, there's too many use cases! How can we assume the user wants a shell? Answer: because they do.
Most things are reasonable like certbot, apt, tune2fs, mkfs, awk, cut, paste, grep, sort, so many reasonable things. Even emacs is reasonable.
But systemd and git are not and the users are not the problems. Choices were made to be hostile to usability and they continue to be defended by being hostile to usability. Things like lex and yacc are inherently complicated and there's nothing to do there. Other things are intentionally complicated. Those can be fixed.
FWIW, I invoke it all the time for other reasons. I am legitimately checking the status. Is it online? Do I have it enabled? What's the PID? Where's the file (though I can run `sudo systemctl edit foo.service`)? What's the memory usage? When did it start? And so on. The tail of the log are useful but not the point of status.
If I'm looking to debug a service I look at the journal instead. I hope this helps
That's why __you're__ using it, but don't assume that your usecase is the general. Remember, linux has a large breadth in types of users. But their biggest market is still servers and embedded systems. There's far more of those than PC users. Idk, when systemd became the main thing I hated it too. But mostly because it was different and I didn't know how to use it. But then I learned and you know what? I agreed. This took awhile though and I had to see the problems they are solving. Otherwise it looks really bloaty and confusing. Like why have things like nspawn? Why use systemd jobs instead of using cron? Why use systemd-homed instead of useradd?Well a big part of it is security and flexibility.
I write systemd services now instead of cron jobs. With a cron job I can't make private tmps[0]. Cron won't run a job if the computer is off during the job time. Cron can't stagger services. Cron can't wait for other services first. Cron can't be given limited CPU, memory, or other resource limitations.
Nspawn exists to make things highly portable. Chroot on steroids is used for a reason. Being able to containerize things, placing specific capabilities and all that. This is all part of a systemd job anyways. It really makes it a lot easier to give a job the minimum privileges. So often nspawn is a better fit than things like docker.
Same goes for homed. You can do things like setting timezones unique to users. But there's so much more like how it can better handle encryption. And you can do really cool things like move your home directory from one machine to another. This might seem like a non-issue to most people but it isn't. That whole paradigm where your keyboard is just an interface to a machine (i.e. a terminal, and I don't mean the cli. There's a reason that's called a terminal "emulator"). This is a really useful thing when you work on servers.
Look, there's a reason the distros switched over. It's not collective madness.
[0] https://www.redhat.com/en/blog/new-red-hat-enterprise-linux-...
https://systemd.io/
You have yet again showed how you are one of the 0.1%.
Why should the defaults be to accommodate for you?
I've been using linux for over 30 years. I'm in that group photo on the Debian.org homepage, given Linux conference talks spanning decades...
I know I'm in a very small minority and don't expect everyone to be me.
I work a support shift at a cloud hosting company and constantly deal with our customers struggling with linux on the same pain points over and over and over again. We have a bunch of auto-replies to explain things because everyone trips over the same broken sidewalk and people insist it's not broken but instead, it's beautiful design. Alright, whatever. Keeps me employed. Cool.
This is the same problem that mathematics has. Elite mathematicians insist that they should give zero shits about trying to explain things and their convoluted impenetrable explanations are elegant - it's an ultra-exclusive nerd club and most people aren't invited regardless of their interest.
Making things more approachable is somehow, cognitively unavailable to them or against some deeply held constitution. Whatever it is, it's not happening.
Some people think iOS is successful and some people think Mobian should be. I try to understand the first group and not insist everyone be in the second.
I'm very much not trying to be like the Arch userforum and say that this problem was solved 3 years 7 months, 22 days, 9 hrs, and 13 minutes ago but will also not provide you a link or any more reference to this because I'm closing the topic. There 100% are elitists. But not everyone who agrees with their point is an elitist. That experience is always frustrating because a noob doesn't know what questions to ask or what terms to search. It's true that in any domain that a task is literally easier for the domain expert than the noob because the noob doesn't even know where to start looking.
As for users, I do agree that there's a lot of common stumbling blocks. But I also notice (the same problem exists in math) that a holistic view is not taught with or before specifics. These things have to be taught together, but if you try to just learn linux a command at a time (math an equation at a time or programming a function/algorithm at a time) you're going to be stunted for a very long time. The abstractions matter.
But why are aliases and functions disallowed? I've thought the TUI boom has been a great thing for users, although I wish TUI developers would spend just a bit more time doing design and understand that "has vim movements" means more than h,j,k,l arrow keys... There's lots of great alternatives to the most common coreutils. But I am still a firm believer that people should be making their own rc files. Especially today where it is trivial to carry them around with you. Hell, I even throw notes in my dotfiles. The whole thing is 84M and 81M of that is vim plugins, so not even part of the git repo.
Well I still don't know how to get my iPhone to stop correcting two words back. You'd think turning off General > Keyboard > Auto-Correction would do it. Nope. Maybe Predictive Text? Also no. But then again, you'd think that Auto-Capitalization would capitalize the letter I when it is used as a single character but again, no, and you can always recognize an iPhone user because their "i"'s are never capitalized.I'll tell you this. Linux is a pain. All of software is a pain. 90% of software is a pain and has no fucking reason to be. I can give you a hundred examples where trivial things make a huge difference. From fucking Meta's download for Llama not telling you how much disk space it uses and hard coding the destination (2 problems), how calendard won't merge holidays and instead you have 5 instances of MLK Jr's day, or how I can't disable Apple Music or remap my media keys so I can stop the god damn Music player app from opening or get it to stop playing some random youtube video in a lost tab rather than play the song on spotify that I literally just paused. But the reason I choose linux is because I can fucking fix those things. I hate it. So much of it. You're so right that so many things don't have to be this way. But at least with linux and it's design choices, I can fucking fix things. It isn't just the open source aspect that makes that possible and it isn't just documentation, it is the mentality that things should be small and simple. To really take to heart the concept of monads.
systemctl reboot -f should be the default for "reboot".
People generally already make sure there's nothing they care about running and then issue a reboot often because something is broken.
It's already mostly a manual override. The default makes it not a manual override but instead yet another operation of a system that is, under most reboot conditions, assumed to be tainted in some way.
If you want reboot to potentially require IPMI or some kind of manual intervention, it should be an option like
reboot --ask-everything --stall-on-crash-ok --wait-indefinitely-ok
or something that makes it very very clear what you're asking it to do.
Because how it currently is, reboot does not reboot, instead it inquires a potentially malfunctioning system what its opinion is on rebooting.
It effectively assumes every system is always in pristine condition and that users reboot out of boredom. If someone’s issuing a reboot, it's because something is wrong, and the system should treat that as the primary assumption.
On servers, yes, you're right, I reboot far less and am usually rebooting because a specific GPU server has a defective GPU that is often a pain to solve with rmmod and resetting manually, being just far easier to reboot the entire machine.
But I still think it's clear that what you think is "average" or "usual" is not. Literally the fact that you and I disagree on what our typical use cases is proof of this (note: I'm not saying _my average_ use case extrapolates, nor your average use case, nor anyone else I know or even don't know. I'm saying _average_ is not a meaningful thing. I mean this in the same way as taking the average of 2 samples from a normal distribution; doing so gives you a number that is not representative of the distribution).
Some behavior has to be chosen for some invocation.
I continue to express what countless people struggle with and potential usability fixes, and you continue to insist your personal preference is supreme and unilaterally invalidates everyone's frustration.
It's like insisting all cars should have tillers, manual chokes, and hand cranks because you personally like them and then handwaving some "average" argument when someone advocates for easier systems.
And that's the attitude what keeps Linux useful but not usable.
How many people script Git? More importantly, how often do you change that script? Rarely, and rarely. That means it's FAR FAR less work for the scripter to look up the weird incantations to remove the "human" parts (like a quiet flag).
Conversely, the human is far more likely to write git commands impromptu, and I dare say, this is the FAR FAR more common use case.
That means Git (and a lot of these kinds of commands) optimize for the RARE choice that happens infrequently over the common case that happens often. That's horrible design.
TL;DR: Just because there's a consistent design philosophy behind obtuse linux commands does not make a good, helpful, useful, modern, or simple philosophy. If a library author wrote code this way, we'd all realize how horrible that design is.
Here's two versions of the Unix Philosophy
Yes, scripting is a common use case (I use git in scripts! I use git in programs. You probably do too, even if you don't know it). Piping is a common use case. And I'm not sure what we're talking about that is "useless". I've yet to run into a command where the default is useless. Even though I have `alias grep='grep --color=always --no-messages --binary-files=without-match'` I still frequently run `\grep`.But we're also talking about programs that are DECADES old. git will turn 20 this year. You're going to be breaking a lot of stuff if you change it now.
And look, you don't have to agree, that's fine. But I'm trying to help you get into a mindset so that this doesn't look like a bunch of gobbledegook. You call these weird incantations. I get it. But if you get this model and get why things are the way they are, then those incantations become a lot less weird and a lot easier to remember. Because frankly, you'll have to remember far less. And either way, it's not like you're going to get linux changed. If you don't use it, great, move on. But if you do, then I'm trying to help, because if you can't change it you got to figure out the way.
https://en.wikipedia.org/wiki/Unix_philosophy
Man, we're talking about git. It has never subscribed to this philosophy (and most programs in *nix don't)
Git does about fifteen thousand different things with about fifteen million flags.
And it was never designed. It was thrown together as a kitchen sink of useful things with commands adding new and crazy incantations as new things were added.
"Just write this script to do the useful thing" is a weird hill to die on
The other part is - scripts can use longer options while the console commands should be optimised for typing.
This has nothing to do with understanding the model or model itself. Complex things can have good interfaces - those just require good interface design and git did not get much of that.
As stated before, there is no average user[0]. So the intent is that you have the command that can be built upon. Is everyone unhappy with the base command? Probably. But is is always easier to build up than to tear down.
[0] Again, linux servers and linux embedded devices significantly out number users. Each of them do. So even if there were an average user, guess what, it wouldn't be you.
Colour support is irrelevant to this case. They can check isatty() and give different output depending on that.
And verbose information is better in average case, if it's well formatted. Unless you're flooding the screen with useless data of course, but that's not what's being talked about here.
Again, it is really easy to add more output and this is actually an easier problem than the reverse. FATAL ERROR WARN INFO DEBUG TRACE log levels have been around for awhile and they've been working really well.
I'll let you in on something. If you're frequently having to reach for verbose outputs, there's probably a better tool. That is, unless if it is personal preference. Which in that case, alias is for you. I have to reiterate, the "average case" and "average user" does not exist. This argument will not get you anywhere because you're talking about a unicorn. No matter how much you think they exist, they don't. It is only average within a more specific subdomain. It might appear average to you because you work with those types of people and are part of those communities, but someone else from a different community will have very different viewpoints. So it is very intentional that things are not designed for "the average" because there is none.
This wouldn't be my problem with systemd. Not by a long shot.
I don't get this complaint. It's the same order as almost every other command-line utility that has subcommands: <command> <subcommand> <thing to operate on>. To me, that kind of consistency is very intuitive.
* /etc/init.d/my-service stop
and Ubuntu’s:
* service my-service stop
both lurk in my brain.
Ah well, it's all been said before.
And yet my fingers still want to type it the other way.
I'll add the abstraction for anyone confused
Anything in brackets is optional and might not appear or be available. By command I mean a category of commands. Such as 'pip install' vs 'pip uninstall', which are sub-programs inside the main program. But this can have layers such as 'uv pip install'. Often flags can be used in any order because you'll just loop over all the arguments but this is still the standard order.There's also the two actor pattern
systemctl status myapp mydb
Something like:
systemctl --stop myapp mydb
systemctl myapp mydb --stop
Hence the verb-last CLI rulez!
(Kidding aside, quick reminder that on Mac you have to enable Settings>Profiles>Keyboard>Use Option as Meta key, or else Alt doesn't work)
^art^op
Converts the "start" in "foo start bar" to "stop", ie runs "foo stop bar". Append :p to do the substitution but print the command instead of running it.
[1] https://www.gnu.org/software/bash/manual/html_node/Word-Desi...
[2] https://www.johndcook.com/blog/2022/10/21/shell-replace-word...
Also, it looks like you are one of today's lucky 10,000 ! https://xkcd.com/1053/
Because I have to share commands with other people who are troubleshooting their own systems, and copy/paste from history becomes useless if I have specific aliases.
Because someday I or someone will want to script these interactions, and aliases are not available in subprocesses.
It took me ages to unlearn that pattern for using systemctl, even though as you say: it's far more consistent
I'm used to `service` command, so I have muscle memory which `systemd` breaks. The way `systemd` commands are laid out is better, it just messes with `service` command muscle memory.
With initV, issuing many command in sequence to the same service (enable, then start… stop then start… etc) is much quicker and easier as it’s “up-arrow, control-W, type new command. With the systemd option I either need to navigate one word to the left (or more depending on how the shell is configured wrt word separation) before I replace the command, or I need to delete both the command and the service name, and retype more.
It’s not a huge difference but small downgrades in ergonomics add up over time.
A backward step in intuitive CLI usage.
We can be such a fuddy-duddy gray-beards.
Too bad it doesn't have a '--status 2' flag to show the status after two seconds too.
Normally when I'm doing things on the terminal, I do one thing at a time.
Many (most?) of us are all over the place, expected to “wear many hats” and aren’t in a single IDE or language all day every day. Certainly if I were a “Linux admin” I would have systemd pretty committed to memory. Anyone else probably wouldn’t.
sudo service my-service stop
It is a bit weird. On the one hand, I understand that it makes sense to have [command] [verb] [object] on a "logical" level and that viewing logs should be a separate command (`journalctl`), but it is definitely not ergonomic. Especially if you frequently have to switch between start/stop/restart.
> 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.
This was precisely the case for me. I "enjoy" playing around with systemd and am super interested in better understanding it, but the feedback loop just felt sooo slow. So hopefully this TUI can make it "fun" again :)
alias s=sudo systemctl status alias r=sudo systemctl restart
And if I'm only working with one service, I'll throw the service name in there too.
Give me files for my logs, give me a single place for my service definitions, be simple.
After years of systemd, I have never really "got it", while it took a weekend for runit.
It's not always our choice, corporate world is something else, I know...
Just a tip, if you remember the service name, status will show the directory the unit file is in. That will hopefully get you over your issues with directories. Complaining about Linux directories seems weird though. Have you looked at... anything else at all?
It should be installable locally, and run commands on remote machine via ssh! And via 'docker exec' commands.
https://github.com/rgwood/systemctl-tui
I've put quite a lot of work into it and wanted the project to give a good first impression. This was important to me since I believe these "niche" TUI libraries need to immediately show what problems they are solving or how they save time, as users need a reason to _use_ an additional abstraction layer.
Just one thing: I had to do
instead of and uvx wouldn't work at all, version: uv 0.5.21. That said, uv is way more quick than pip(x) so I just switched.Though I don't agree with all design decisions, and there are some bugs, having such well-maintained documentation and clean repo makes it easy to dive into the project and understand what is going on and how other components are built.
Thanks for the library!
foo restart vs restart foo
If you add a sane cli with tab completion support, it’ll come full circle.
Can it connect to remote hosts like you can with systemctl --host?
https://isd-project.github.io/isd/security/
Let me know if anything is missing!
Where I work we also use defectdojo to catalogue and manage CVRs in our projects, but it's more involved to setup the testing pipeline and deploy the required services.
Not gonna lie, I am not a big fan of Python anymore because of the dependency hell you can run into when working with CUDA libraries but uv is a breath of fresh air and textual is just sooo easy.
Don't get me wrong, I am not saying that I would never consider rewriting it in Rust or Go, but the documentation and guides from Textual were great resources and the creator, Will, also seems like a really nice guy :D
Edit: To be explicit, I believe that Python has currently the most advanced and accessible TUI ecosystem. At least, that was my impression after checking a few examples on an afternoon.
And sure, systemd it's more deterministic and includes the kitchen sink, unlike initd.
Thankfully these days I can automate most of such interactions out of existence, so I no longer feel the burning hatred that I once did. More like a smoldering ember.