QtService(qtsolutions) and new linux systems like debian 8 with systemd
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 ?
Isn't the correct location /etc/systemd/system ?
Hi, I have tried too with the location you wrote(etc/systemd/system) and the service doesn't start too...
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.
@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 ?
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.
@kshegunov thanks I will look at your class.
Qtservice is OK under windows.But under linux, I am not sure that QtService is ok...
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.
@Tschikkn Hi,the problem is that the service fails if I do :systemctl start myservice
@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...
Hi, I have tried to run myservice start directly and I have a segmentation fault.....
I have a segmentation fault.
You must fix this.