{
const QString DAEMON_NAME = "jenirokd";
const QString INIT_DIR = "/etc/init.d";
- const QString AUTOSTART_ENABLE = "update-rc.d jenirokd defaults 99";
- const QString AUTOSTART_DISABLE = "update-rc.d -f jenirokd remove";
}
bool Daemon::start()
{
QProcess proc;
- proc.start(INIT_DIR + "/" + DAEMON_NAME, QStringList() << "start");
+ proc.start(INIT_DIR + "/" + DAEMON_NAME, QStringList() << "start" << "manual");
proc.waitForStarted();
proc.waitForFinished();
return !result.isEmpty();
}
-bool Daemon::setAutostart(bool enabled)
-{
- QProcess proc;
-
- if(enabled)
- {
- proc.start(AUTOSTART_ENABLE);
- }
- else
- {
- proc.start(AUTOSTART_DISABLE);
- }
-
- proc.waitForStarted();
- proc.waitForFinished();
-
- if(proc.exitCode() != 0)
- {
- return false;
- }
-
- return true;
-
-}
-
Daemon::Daemon()
{
}