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?

  • BCsven@lemmy.ca
    link
    fedilink
    arrow-up
    7
    arrow-down
    6
    ·
    7 months ago

    Closing from the X icon on the app window lets the program write out any info it needs to before shutdown. Killing the process from the terminal just ends the process totally

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

      That is not true. If you use SIGKILL (9) it ends the process totally. Other signals don’t do that. And per default the cli commands don’t send SIGKILL, but SIGTERM. It nicely asks the program to terminate and the program is supposed to write down it’s data and do what it needs to do when signaled like that. You’d need to attach a ‘-9’ to kill it without warning. (Even if the command is called ‘kill’.)

      • BCsven@lemmy.ca
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        edit-2
        7 months ago

        then it sounds like what is being killed has another child or parallel process that isn’t getting killed by the command used. Or Sigterm 15 is needed for graceful shutdown of process

      • atzanteol@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        7 months ago

        It’s more than an “ask” - if it’s not handled then the application will still shutdown. SIGTERM is “trapable” by the application though and should be used to safely terminate.

        They’ll also want to try SIGINT as that’s what ctrl+c sends. The application may handle that one instead.