this post was submitted on 19 Oct 2025
33 points (100.0% liked)

Linux

59440 readers
900 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 6 years ago
MODERATORS
 

Is there a simple GUI application that will monitor running processes periodically and alert the user when a process is not running? The ones I have found are far too complex (eg Monit). I am sure this is trivial to achieve with a script, but I'd rather use a GUI.

A use case would look like this: every 60 minutes check if Syncthing is running and display a notification if it's not. In my experience, Syncthing is very reliable when it launches successfully but there may be an issue with conflicting versions that may prevent it from running at boot. Syncthing has no way to alert the GUI user when something goes wrong and you may find after you left home that your laptop hasn't synced. Checking manually is a headache, prone to errors and goes against the idea of fit and forget.

(Debian Trixie with KDE Plasma)

all 23 comments
sorted by: hot top controversial new old
[–] utopiah@lemmy.ml 14 points 2 weeks ago (2 children)

1-liner would be something like watch -n 10 "pgrep konsole || kdialog --msgbox 'konsole no running'"

namely :

  • watch to repeat a command at interval, e.g. every minute (could also be crontab)
  • pgrep to check if a process is running
  • kdialog on KDE to send a message to the current user (plenty more ways)
[–] Stopwatch1986@lemmy.ml 3 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

You learn something new every day here ;) The good thing about kdialog is you can't miss it. Thanks.

[–] utopiah@lemmy.ml 2 points 2 weeks ago

With pleasure. I discovered kdialog just recently too as until now I used notify-send but as you are using KDE this gives you a lot more options.

If you are into this kind of things check also dbus or KWin, there are a LOT of fun and powerful ways to interact with KDE.

[–] gi1242@lemmy.world 10 points 2 weeks ago (1 children)

i use syncthing, and start it via the systems service. i found it reliable. systems has a feature by which you can get notified on error (look up the onerror key), you might be able to do what u need with that.

alternately, you can run a systemd timer that runs periodically and notifies you when your condition is met. if u want a pop-up, use zenity etc.

[–] RedSnt@feddit.dk 8 points 2 weeks ago* (last edited 2 weeks ago) (2 children)
[–] gi1242@lemmy.world 4 points 2 weeks ago

Yeah, autocorrect isn't great with technical terms. I meant systemd. I followed Arch's instruction, and just enabled the services via systemctl --user enable syncthing.service

[–] Stopwatch1986@lemmy.ml 3 points 2 weeks ago (1 children)

I have tried Syncthingtray and Syncthingy. I found the former did too much that I never used, and the latter was an unnecessary process doing very little while always running and adding another icon to the tray. For me periodic checking with a script is enough and more efficient for the rare situation where Syncthing crashes of fails to start.

[–] RedSnt@feddit.dk 1 points 2 weeks ago* (last edited 2 weeks ago)

They do mention a plasmoid for KDE plasma, although according to their documentation that requires distro specific packaging. For Debian it looks like there's a community package (right side).
EDIT:

Doesn't look too busy imo.

[–] solrize@lemmy.ml 8 points 2 weeks ago (1 children)

Normally you would want automatic restart rather than a user alert. These days you'd do that with systemctl, see the docs.

[–] Stopwatch1986@lemmy.ml 1 points 2 weeks ago

True for most scenarios. Specifically with Syncthing, I find that it rarely fails and when it does there are good reasons and I need to do something about it (eg I used the wrong version config.xml recently trying to migrate between Syncthing setups).

[–] Vector@lemmy.world 5 points 2 weeks ago (2 children)

Hello! I don’t know of a desktop watchdog application that will do this for you, but you may be able to achieve this with a simple cron job. Probably just an hourly crontab entry that looks for a running process with the right name, and uses something like notify-send to send an alert if it’s not found. I’ll jump on the computer and have a quick play, though I run gnome not plasma so I don’t know how well it will translate.

[–] Vector@lemmy.world 7 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

I know you're looking for a desktop solution, but here's something that you can try in case you can't find one -- I'm betting that having a solution is better than having none!

So I just had a quick muck around:

  • You can use pgrep to detect if a process with a given name is running
  • You can write to /dev/pts/0 to trigger a desktop notification
  • You can drop it into a cron job to run it automatically on a schedule

As a test, the following command will look for a process called syncthing and send a desktop notification if it can't find it:

pgrep syncthing || echo "Syncthing is not running > /dev/pts/0"

To set up a cron job:

  1. open a terminal
  2. open the editor with crontab -e (if you need to pick an editor, nano will probably be your best bet, it's easiest to use)
  3. in the editor, add the following line to the end of the file: 0 * * * * pgrep syncthing || echo "Syncthing is not running" > /dev/pts/0
    • The 0 * * * * sets up the schedule (on the 0th minute of every hour, every day of the month, every month, on every day of the week)
    • Everything after that is the command to run
  4. save and quit

If you ever want to get rid of it, just open the cron file again (crontab -e) and remove the line.

I gave this a go on KDE under Wayland and it seems to do the trick. Good luck, I hope you find what you're looking for!

[edit-1] added step (2) to install libnotify-bin in case you don't have it already. [edit-2] added XDG_RUNTIME_DIR to step (4) [edit-3] removed references to libnotify, replace with /dev/pts/0 (Nice one, @sun_is_ra@sh.itjust.works !)

[–] Stopwatch1986@lemmy.ml 2 points 2 weeks ago

I went for this one and it works with both notify-send and /dev/pts/0. Not sure why it is better, but I opted for the latter. Simple, lightweight and versatile, suitable for any process.

Any KDE Plasma users reading this, to enable notifications history for these you can follow the instructions here. Many thanks everyone.

[–] sun_is_ra@sh.itjust.works 4 points 2 weeks ago (3 children)

It doesn't work for me (using plasma). Also it seems to be using DBUS which I am not sure if it will work within a cron job.

A simple solution that works for me is something like this:

echo hello > /dev/pts/0

[–] Vector@lemmy.world 1 points 2 weeks ago

Oh very neat, that works great! A much better solution.

[–] Vector@lemmy.world 1 points 2 weeks ago

Good call on DBUS. Setting XDG_RUNTIME_DIR seems to be enough to fix it up, I'll update my other response.

[–] utopiah@lemmy.ml 1 points 2 weeks ago

I imagine dbus-monitor should work with cron but probably if starting once DBUS is actually running (so not sure @reboot would be sufficient)

[–] LiveLM@lemmy.zip 5 points 2 weeks ago

Specifically for Syncthing, there's Syncthing Tray. It'll put a little icon on your icon tray (or since you're on KDE you can use the Plasmoid and put it wherever you want) and you can configure it to change colors depending on the status of Syncthing, send notifications when it finishes a sync or can't connect, see a detailed view of the sync status and the folders, etc.
It's very customizable, I've been using it for a while. Check it out!

[–] MonkderVierte@lemmy.zip 2 points 2 weeks ago* (last edited 2 weeks ago)

You could write a cronjob uitilizing notify-send?