I have a QT project that installs a service on a system when run make install . The relevant parts of the .pro file are as follows:
init.path = /etc/init.d/ init.files = myservicename updaterc.path = /etc/init.d/ updaterc.extra = chmod 755 $$init.files; \ update-rc.d $$init.files defaults 97 03; \ service $$init.files start INSTALLS += target ... init updaterc
This installs the service correctly and then starts it.
However, when I run make uninstall , although the installed files are correctly removed, the service remains installed and running. I want the service to be stopped and make uninstall when running make uninstall .
The commands to stop and remove the service are as follows:
sudo service myservicename stop sudo update-rc.d -f myservicename remove
But I cannot figure out how to integrate the above commands into a .pro file, so qmake can understand them and create the corresponding rules in the Makefile.
The only documentation I found on this issue is this: http://doc.qt.io/qt-5/qmake-advanced-usage.html , but it does not say anything about deleting.
source share