Changed /etc/init.d/rivendell to systemctl

This commit is contained in:
Patrick Linstruth
2018-10-10 19:27:26 -07:00
parent 4c84e3d49f
commit 338f7fb013

View File

@@ -46,8 +46,8 @@ bool alsa_daemon_start_needed=false;
void StopDaemons() void StopDaemons()
{ {
if(alsa_manage_daemons) { if(alsa_manage_daemons) {
if(system("/etc/init.d/rivendell status")==0) { if(system("systemctl --quiet is-active rivendell")==0) {
system("/etc/init.d/rivendell stop"); system("systemctl --quiet stop rivendell");
alsa_daemon_start_needed=true; alsa_daemon_start_needed=true;
} }
} }
@@ -57,7 +57,7 @@ void StopDaemons()
void StartDaemons() void StartDaemons()
{ {
if(alsa_daemon_start_needed) { if(alsa_daemon_start_needed) {
system("/etc/init.d/rivendell start"); system("systemctl --quiet start rivendell");
} }
} }
@@ -148,7 +148,7 @@ MainWidget::MainWidget(QWidget *parent)
tr("The \"--manage-daemons\" switch requires root permissions.")); tr("The \"--manage-daemons\" switch requires root permissions."));
exit(256); exit(256);
} }
if(system("/etc/init.d/rivendell status")==0) { if(system("systemctl --quiet is-active rivendell")==0) {
int r=QMessageBox::warning(this,tr("RDAlsaConfig warning"), int r=QMessageBox::warning(this,tr("RDAlsaConfig warning"),
tr("Rivendell audio will be interrupted while running this program.\nContinue?"), tr("Rivendell audio will be interrupted while running this program.\nContinue?"),
QMessageBox::Yes,QMessageBox::No); QMessageBox::Yes,QMessageBox::No);