Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Systemd shutdown, halt and reboot handling
Forum Updated to NodeBB v4.3 + New Features

Systemd shutdown, halt and reboot handling

Scheduled Pinned Locked Moved Solved General and Desktop
systemdpoweroffhaltreboot
19 Posts 3 Posters 2.6k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E egor.utsov

    @SGaist It can happen when user login through ssh and cissue systemctl poweroff for example

    kshegunovK Offline
    kshegunovK Offline
    kshegunov
    Moderators
    wrote on last edited by kshegunov
    #10

    In addition to what @SGaist wrote, there are limitations of what you can and can't do in signal handlers. Not everything is allowed.

    Read and abide by the Qt Code of Conduct

    E 1 Reply Last reply
    1
    • kshegunovK kshegunov

      In addition to what @SGaist wrote, there are limitations of what you can and can't do in signal handlers. Not everything is allowed.

      E Offline
      E Offline
      egor.utsov
      wrote on last edited by
      #11

      @kshegunov it is done not from signal handler, but from slot, connected to qsocketnotifier.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #12

        Depending on what you do, you will get a SIGTERM and a SIGKILL right after. The later you can't interrupt nor try to do some more stuff.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        E 1 Reply Last reply
        0
        • SGaistS SGaist

          Depending on what you do, you will get a SIGTERM and a SIGKILL right after. The later you can't interrupt nor try to do some more stuff.

          E Offline
          E Offline
          egor.utsov
          wrote on last edited by
          #13

          @SGaist but as i remember systemd documentation stated, that process have 60 seconds until sigkill

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #14

            60 second per running process ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            E 1 Reply Last reply
            0
            • SGaistS SGaist

              60 second per running process ?

              E Offline
              E Offline
              egor.utsov
              wrote on last edited by egor.utsov
              #15

              @SGaist i guessed so. Saw it somewhere in docs.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #16

                Can you find that information again ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                E 1 Reply Last reply
                0
                • SGaistS SGaist

                  Can you find that information again ?

                  E Offline
                  E Offline
                  egor.utsov
                  wrote on last edited by
                  #17

                  @SGaist No. Maybe i am mistaken. I found some info here: http://manpages.ubuntu.com/manpages/cosmic/en/man5/systemd.service.5.html

                  Check section about TimeoutStopSec=. On my system it is commented out, but here stated, that it is even 90 s. As i understand it is applied per-unit.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #18

                    Is your application started as a systemd service ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    E 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Is your application started as a systemd service ?

                      E Offline
                      E Offline
                      egor.utsov
                      wrote on last edited by
                      #19

                      @SGaist Yes, it is started as systemd service. Finally i found the reason, why it hangs. It is happened because I made blocking syscall from event loop. So this thread can be closed and marked as resolved. Appproach with QSocketNotifier and signalfd works.

                      1 Reply Last reply
                      2

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved