I’m trying to write a simple bash script that opens up GQRX, sends it some TCP commands, then closes it down.

Unfortunately, I’ve found that when I close the program like this, the next time it opens, it will pop up a window saying “crash detected” and ask me to review the configuration file. This prevents the app from loading unless someone is present to click the dialog box.

This error only seems to happen when I try to close the program using the bash script. Closing it by just clicking the X doesn’t cause this problem next time it’s launched.

I think I’m closing the app too aggressively which terminates it before it can wrap up its affairs, and it interprets this as a crash. What’s the best way to close the app to keep this from happening?

I’ve tried:

  • pkill -3 gqrx
  • pkill -13 gqrx

But the problem persists. Is there an even softer way to close an application?

  • Max-P@lemmy.max-p.me
    link
    fedilink
    arrow-up
    4
    ·
    11 months ago

    A lot of GUI apps unfortunately don’t catch SIGTERM, so it doesn’t make much of a difference. A lot of them put their “exited normally” into the “the window was closed” handler.

    For GQRX that might even be intentional, it’s very unstable at times, and you do kill it pretty often. So they probably assume if it got SIGTERM, it was frozen and the WM offered the user to kill it and clicked yes.

    • rufus@discuss.tchncs.de
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      10 months ago

      Sure, if GUI apps don’t handle it they just keep running. It’s just asking them to terminate. [Edit: I’ll try that]

      (We could just have a look at the code of GQRX in specific or just try it.)

      • Max-P@lemmy.max-p.me
        link
        fedilink
        arrow-up
        2
        ·
        10 months ago

        The default behaviour for SIGTERM (and most other signals) when unhandled is to terminate the process, so you might as well be sending SIGKILL. It won’t keep running unless specifically coded to catch the signal and do nothing with it.