Auto start a Qt service on Linux
-
I'm trying to figure out how QtService is supposed to work on Linux.
As much as I see, installing a service just registers it in /etc/xdg/QtSoftware.conf and all queries like 'myservice -v' etc. go to this file for the information.However this fact does not cause the service to start up automatically on system reboot. Am I right?
The closest thing I can think about is having a myservice.desktop file in /etc/xdg/autostart directory, but this should be done separately. And what if I want to start the computer on run level 3, without desktop ?Do I still need to add /etc/init.d script?
If I do, what benefit do I get from QtSoftware.conf ? Just the ability to query status ?
If I would design this system, I would have one universal "QtSoftware" service installed in /etc/init.d which goes over QtSoftware.conf and starts all services listed there.
Is there something like this available ?
Too many questions...
-
I'm not familiar with QtService in general, but if you are just trying to start a daemon (service) in linux, most modern linux distributions use systemd. (Ubuntu and its derivatives, Debian, OpenSUSE, Arch LInux, etc etc)
I would suggest to immerse yourself with writing systemd unit files. You can run it at any run level as long as it's specified of course. You can also run it on all user profiles, this requires a bit more research although as far as I know you just create another unit file for them in
/usr/lib/systemd/user/
.http://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples
If it's a graphical interface you could familiarize yourself with XDG Autostart desktop files. All depends on the use case. Systemd provides a plethora of options, but it's slightly complex and requires plenty reading (depending on your use case). XDG autostart desktop file are incredibly simple to write.