-
Notifications
You must be signed in to change notification settings - Fork 978
Added support systemd for qt-service #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| QString QtServiceController::serviceDescription() const | ||
| { | ||
| QSettings settings(QSettings::SystemScope, "QtSoftware"); | ||
| auto &settings = getSettings(serviceName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not modify.
| } | ||
| } | ||
|
|
||
| static QSettings& getSettings(const QString& serviceName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function isn't need.
|
|
||
| if (isSystemD() && !isServiceInited) | ||
| { | ||
| QSettings::setPath(QSettings::NativeFormat, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not setPah. It is need caller set. Please see the help of QSettings::setPath.
Two solutions:
- The caller is call QSettings::setPath (The old way)
- Call QSettings::setPath in Constructor
| QtServiceController::StartupType QtServiceController::startupType() const | ||
| { | ||
| QSettings settings(QSettings::SystemScope, "QtSoftware"); | ||
| auto &settings = getSettings(serviceName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not modify.
| QString QtServiceController::serviceFilePath() const | ||
| { | ||
| QSettings settings(QSettings::SystemScope, "QtSoftware"); | ||
| auto &settings = getSettings(serviceName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not modify.
|
|
||
| bool QtServiceController::uninstallUpStart() | ||
| { | ||
| auto &settings = getSettings(serviceName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not modify. use QSettings settings(QSettings::SystemScope, "QtSoftware");
| return QFileInfo::exists(systemDPath() + serviceName() + ".service"); | ||
| } | ||
|
|
||
| auto &settings = getSettings(serviceName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not modify. use QSettings settings(QSettings::SystemScope, "QtSoftware");
|
|
||
| QtServiceSysPrivate::QtServiceSysPrivate() | ||
| : QtUnixServerSocket(), ident(0), serviceFlags(0) | ||
| : QtUnixServerSocket(), ident(nullptr), serviceFlags(nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not modify.
| Q_UNUSED(password) | ||
| QSettings settings(QSettings::SystemScope, "QtSoftware"); | ||
|
|
||
| auto &settings = getSettings(controller.serviceName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not modify.
|
This is not actual anymore |
Current qt-service do not working with systemd system, this is PR fix this problem.
I also added the ability to manually set the path to the executable file of the service, since sometimes a service needs a shell that configures its environment.