Lurker News
Hi HN,

I built a small Linux CLI tool called witr (Why Is This Running?).
The idea came from a situation most of us have hit: you log into a machine, see a process or port running, and immediately wonder why it exists, who started it, and what is keeping it alive right now.
witr traces a process, service, or port back to its origin and responsibility chain and explains it in a way that’s quick to read, especially when you’re debugging under pressure.
This is v0.1.0. It’s intentionally small and focused. Feedback, criticism, and edge cases are very welcome.
Repo: https://github.com/pranshuparmar/witr

Comments (105) 32 threads

pranshuparmar2 replies#
A quick note on scope: this is not meant to replace existing monitoring or observability tools. It’s designed for those moments when you SSH into a box and need to quickly understand “why is this running” without digging through configs, cron jobs, or service trees manually.

Happy to answer questions or adjust direction based on feedback.

dcminter3 replies#
This is very clever. I've often needed to figure out what some running process was actually for (e.g. because it just started consuming a lot of some limited resource) but it never occurred to me that one could have a tool to answer that question. Well done.

---
Edit: Ah, ok, I slightly misunderstood - skimmed the README too quickly. I thought it was also explaining what the process did :D Still a clever tool, but thought it went a step further.
Perhaps you should add that though - combine Man page output with a database of known processes that run on various Linux systems and a mechanism for contributing PRs to extend that database...? Unlesss it's just me that often wants to know "what the fsck does /tmp/hax0r/deeploysketchyd actually do?" :P

filterfish1 reply#
Looking up the binary in the package management system would also provide another source of useful information. Of course this would dramatically increase the complexity but would, I think, be useful.

If you could look it up using APT/dpkg first, that would be lovely :-)

ajb#
If you have its path, dpkg already has an option to do that: "dpkg -S". Although some extra logic is needed for symlinks.
pranshuparmar#
Thanks, glad you liked it! As @darrenf mentioned, `whatis` can help with that use case. For now, I’m keeping `witr` focused on explaining PIDs.
scrame1 reply#
I left a different comment, but I think this is good. You're example is 3306 and has a useful breakdown. Not everyone has that port memorized by trauma, and not every mysql instance uses that port.

New tools are always welcome, and having a purpose to explain a purpose seems like a good pitch.

pranshuparmar#
Totally. Just to clarify, witr isn’t limited to ports. You can run it directly on a process too, like `witr mysql`. I used the 3306 example to emphasize this use case.
mh-6 replies#
This is great. Small, trivial suggestion: the gif that loops in the README should pause on the screen w/ the output for a few seconds longer - it disappears (restarts) too quickly to take in all of the output.
stavros1 reply#
Hm, very interesting! This only converts asciinema recordings, though, right? It doesn't automatically record anything?

Continue this thread — 1 reply

Neywiny#
I would also argue it shouldn't be a gif. It's nice that it shows the command is fast I guess but it's one command that's still visible in the final frame. Not as bandwidth efficient and agreed I can't read it all in time
rzzzt#
Also the pause button seems to take the GIF back to its first frame, then resume from where I paused... either that or I need a good sleep.
godelski#

  > the gif that loops in the README should pause on the screen
Honestly, I think a screenshot is better than a gif. That last frame says everything you need.
thaumasiotes#
You can make that problem irrelevant with the much, much simpler solution of not animating it at all. Stay paused on the output 100% of the time!

The gif is adding no value. I already know what typing text into a terminal looks like.

pranshuparmar#
Thanks everyone for the feedback on the GIF! I though it looked good but when I went back to see it from a user's POV, it was really miserable, haha. I've already switched it to a static image, appreaciate everyone's input and suggestions.
vzaliva4 replies#
Sounds like something I could use, but installing a binary via `curl` doesn't sit right with me. Next problem you have is "explain how this thing was installed on my system" followed "is it up to date (including security patches).

I hope they have deb package or snap some day.

fouc1 reply#
new utility command coming soon! wdtci - "what does this curl install?"
fph1 reply#
Depends on dtps - "does this program stop".
Msurrow#
Depends on environment variable P=NP
klooney#
`systemctl status $pid` will get you a lot
pranshuparmar1 reply#
I understand that installing via `curl` isn’t for everyone, but since this is the first release, I intentionally kept it simple. Now that the tool is gaining some traction, I can definitely plan proper packages for future releases. Thanks for your inputs.
jamescun1 reply#
Have a look at https://goreleaser.com/ , I've used it a bunch to automate releases of Go-based projects, locally and with GitHub Actions.
pranshuparmar#
Thanks a lot for the input, I ended up using it.
pranshuparmar#
Just to update, witr is currently available on brew and AUR. deb, rpm and apk packages are also available in the release, and can be run directly via nix without installation.
xk3#
Note that you can do a lot of this by just querying systemctl with the PID

    systemctl status 1
And there might be more than one process using a port

    sudo lsof +c 0 -i:22

Load more comments