Skip to content

Conversation

@EndrII
Copy link

@EndrII EndrII commented Apr 16, 2020

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.

  • setServiceExecutable

QString QtServiceController::serviceDescription() const
{
QSettings settings(QSettings::SystemScope, "QtSoftware");
auto &settings = getSettings(serviceName());
Copy link

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)
Copy link

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,
Copy link

@KangLin KangLin Jul 9, 2021

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:

  1. The caller is call QSettings::setPath (The old way)
  2. Call QSettings::setPath in Constructor

QtServiceController::StartupType QtServiceController::startupType() const
{
QSettings settings(QSettings::SystemScope, "QtSoftware");
auto &settings = getSettings(serviceName());
Copy link

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());
Copy link

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());
Copy link

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());
Copy link

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)
Copy link

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());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are not modify.

@EndrII
Copy link
Author

EndrII commented Jun 2, 2023

This is not actual anymore

@EndrII EndrII closed this Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants