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. QtService(qtsolutions) and new linux systems like debian 8 with systemd

QtService(qtsolutions) and new linux systems like debian 8 with systemd

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 4 Posters 3.5k Views
  • 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.
  • S Offline
    S Offline
    stephane78
    wrote on 27 Sept 2016, 08:57 last edited by
    #1

    Hi,
    we have an app under windows and linux and a service that runs under windows but I wanted to use the service under linux too.the service is made with qtservice (qtsolutions).I have built it under linux with Qt5.6.0 like the app. I have a debian 8 with systemd.so I have made a <myservice>.service in /usr/lib/systemd/system and I have tried to start the service with systemctl start service but systemctl shows that it failed to start.is it possible to start the qtservice under debian 8 with an old method ? (with init.d and rcn.d ?) and is qtservice compatible with systemd services ?

    J 1 Reply Last reply 27 Sept 2016, 10:47
    0
    • S stephane78
      27 Sept 2016, 08:57

      Hi,
      we have an app under windows and linux and a service that runs under windows but I wanted to use the service under linux too.the service is made with qtservice (qtsolutions).I have built it under linux with Qt5.6.0 like the app. I have a debian 8 with systemd.so I have made a <myservice>.service in /usr/lib/systemd/system and I have tried to start the service with systemctl start service but systemctl shows that it failed to start.is it possible to start the qtservice under debian 8 with an old method ? (with init.d and rcn.d ?) and is qtservice compatible with systemd services ?

      J Online
      J Online
      jsulm
      Lifetime Qt Champion
      wrote on 27 Sept 2016, 10:47 last edited by
      #2

      @stephane78 said in QtService(qtsolutions) and new linux systems like debian 8 with systemd:

      /usr/lib/systemd/system

      /usr/lib/systemd/system ?
      Isn't the correct location /etc/systemd/system ?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stephane78
        wrote on 27 Sept 2016, 12:16 last edited by
        #3

        Hi, I have tried too with the location you wrote(etc/systemd/system) and the service doesn't start too...

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Tschikkn
          wrote on 27 Sept 2016, 20:46 last edited by
          #4

          Hello!

          Basically systemd uses locations as follows:
          /usr/lib/systemd/system/: services, timer, other units... provided by installed packages
          /etc/systemd/system/: services,timer, other units... installed by system administrator (e.g. user editable area)

          This means, you should install your service in /usr/lib/systemd.

          After creating a service, you have to enable it with e.g.

          systemctl enable myNewService.service
          systemctl start myNewService.service
          

          Enabling it means it will load after reboot without starting it manually. If there are any errors using your service-unit you should have a look at

          systemctl status myNewService.service
          journalctl -p err
          

          wich will give you more hints.

          S 1 Reply Last reply 28 Sept 2016, 07:27
          4
          • T Tschikkn
            27 Sept 2016, 20:46

            Hello!

            Basically systemd uses locations as follows:
            /usr/lib/systemd/system/: services, timer, other units... provided by installed packages
            /etc/systemd/system/: services,timer, other units... installed by system administrator (e.g. user editable area)

            This means, you should install your service in /usr/lib/systemd.

            After creating a service, you have to enable it with e.g.

            systemctl enable myNewService.service
            systemctl start myNewService.service
            

            Enabling it means it will load after reboot without starting it manually. If there are any errors using your service-unit you should have a look at

            systemctl status myNewService.service
            journalctl -p err
            

            wich will give you more hints.

            S Offline
            S Offline
            stephane78
            wrote on 28 Sept 2016, 07:27 last edited by
            #5

            @Tschikkn I want to start manually the service now (don't want to start it at the startup) so I didn't do "enable".is it not possible to start manually a service ?

            K T 2 Replies Last reply 28 Sept 2016, 09:50
            0
            • S stephane78
              28 Sept 2016, 07:27

              @Tschikkn I want to start manually the service now (don't want to start it at the startup) so I didn't do "enable".is it not possible to start manually a service ?

              K Offline
              K Offline
              kshegunov
              Moderators
              wrote on 28 Sept 2016, 09:50 last edited by kshegunov
              #6

              I've had problems with QtService in the past, but on Windows (i.e. the auto-start feature). My advice is to check the system logs for what the problem with starting the service is.

              Also, you may want to check out this module if you decide to "replace" QtService.

              Read and abide by the Qt Code of Conduct

              S 1 Reply Last reply 28 Sept 2016, 10:13
              2
              • K kshegunov
                28 Sept 2016, 09:50

                I've had problems with QtService in the past, but on Windows (i.e. the auto-start feature). My advice is to check the system logs for what the problem with starting the service is.

                Also, you may want to check out this module if you decide to "replace" QtService.

                S Offline
                S Offline
                stephane78
                wrote on 28 Sept 2016, 10:13 last edited by
                #7

                @kshegunov thanks I will look at your class.
                Qtservice is OK under windows.But under linux, I am not sure that QtService is ok...

                1 Reply Last reply
                0
                • S stephane78
                  28 Sept 2016, 07:27

                  @Tschikkn I want to start manually the service now (don't want to start it at the startup) so I didn't do "enable".is it not possible to start manually a service ?

                  T Offline
                  T Offline
                  Tschikkn
                  wrote on 28 Sept 2016, 14:37 last edited by
                  #8

                  @stephane78 Hi!

                  You may start the service using the "systemctl start" command. If you do not enable it, it will not startup at boot time.

                  A good summary of systemd is written for archwiki at https://wiki.archlinux.org/index.php/Systemd which is also usable for newer debian and easier to read and understand than the manpage or freedesktop.org.

                  S 1 Reply Last reply 28 Sept 2016, 15:43
                  0
                  • T Tschikkn
                    28 Sept 2016, 14:37

                    @stephane78 Hi!

                    You may start the service using the "systemctl start" command. If you do not enable it, it will not startup at boot time.

                    A good summary of systemd is written for archwiki at https://wiki.archlinux.org/index.php/Systemd which is also usable for newer debian and easier to read and understand than the manpage or freedesktop.org.

                    S Offline
                    S Offline
                    stephane78
                    wrote on 28 Sept 2016, 15:43 last edited by stephane78
                    #9

                    @Tschikkn Hi,the problem is that the service fails if I do :systemctl start myservice

                    S 1 Reply Last reply 28 Sept 2016, 15:51
                    0
                    • S stephane78
                      28 Sept 2016, 15:43

                      @Tschikkn Hi,the problem is that the service fails if I do :systemctl start myservice

                      S Offline
                      S Offline
                      stephane78
                      wrote on 28 Sept 2016, 15:51 last edited by
                      #10

                      @stephane78 and I have a trace and nothing in the trace in this case, so it doesn't even go in the start method of my service class...

                      S 1 Reply Last reply 28 Sept 2016, 16:02
                      0
                      • S stephane78
                        28 Sept 2016, 15:51

                        @stephane78 and I have a trace and nothing in the trace in this case, so it doesn't even go in the start method of my service class...

                        S Offline
                        S Offline
                        stephane78
                        wrote on 28 Sept 2016, 16:02 last edited by
                        #11

                        Hi, I have tried to run myservice start directly and I have a segmentation fault.....

                        K 1 Reply Last reply 28 Sept 2016, 17:34
                        0
                        • S stephane78
                          28 Sept 2016, 16:02

                          Hi, I have tried to run myservice start directly and I have a segmentation fault.....

                          K Offline
                          K Offline
                          kshegunov
                          Moderators
                          wrote on 28 Sept 2016, 17:34 last edited by
                          #12

                          @stephane78 said in QtService(qtsolutions) and new linux systems like debian 8 with systemd:

                          I have a segmentation fault.

                          You must fix this.

                          Read and abide by the Qt Code of Conduct

                          1 Reply Last reply
                          0

                          10/12

                          28 Sept 2016, 15:51

                          • Login

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