So, below is a systemd script which can control OSCam – you might need to change the binary and PID file paths but this works on my system. Simply create a new systemd script;
…and add the following content…
[Unit]
Description=OScam
After=network.target
Requires=network.target
[Service]
Type=forking
PIDFile=/var/run/oscam.pid
ExecStart=/usr/local/bin/oscam -b -B /var/run/oscam.pid
ExecStop=/usr/bin/rm /var/run/oscam.pid
TimeoutStopSec=1
Restart=always
RestartSec=5
StartLimitInterval=0
[Install]
WantedBy=multi-user.target
Display More
This will start OSCam in daemon mode (the -b flag) and then create a PID file for the deamon (-B) at /var/run/oscam.pid – as mentioned above, you might need to alter the paths but this is the basic systemd service required to control OSCam.
Once you’ve created the service, you need to reload the systemd daemons by issuing;
…then you can simply start the OSCam daemon by issuing;
You can check OSCam is running by visiting the web interface or by running;
…where you should see something like this;
● oscam.service - OScam Loaded: loaded (/etc/systemd/system/oscam.service; disabled; vendor preset: enabled) Active: active (running) since Fri 2016-09-30 11:40:30 BST; 10min ago Process: 21828 ExecStop=/usr/bin/rm /var/run/oscam.pid (code=exited, status=203/EXEC) Process: 24126 ExecStart=/usr/local/bin/oscam -b -B /var/run/oscam.pid (code=exited, status=0/SUCCESS) Main PID: 24131 (oscam) CGroup: /system.slice/oscam.service ├─24130 /usr/local/bin/oscam -b -B /var/run/oscam.pid └─24131 /usr/local/bin/oscam -b -B /var/run/oscam.pid
One final thing is to ensure OSCam starts on boot, to do that, issue the following command;
And that’s it!
Happy viewing!
Hier in Germany !
Im Folgenden sehen Sie ein systemd-Skript, das OSCam steuern kann. Möglicherweise müssen Sie die Pfade für Binär- und PID-Dateien ändern,
dies funktioniert jedoch auf meinem System. Erstellen Sie einfach ein neues systemd-Skript.
… Und folgenden Inhalt hinzufügen…
[Unit]
Description=OScam
After=network.target
Requires=network.target
[Service]
Type=forking
PIDFile=/var/run/oscam.pid
ExecStart=/usr/local/bin/oscam -b -B /var/run/oscam.pid
ExecStop=/usr/bin/rm /var/run/oscam.pid
TimeoutStopSec=1
Restart=always
RestartSec=5
StartLimitInterval=0
[Install]
WantedBy=multi-user.target
Display More
Dies startet OSCam im Dämonmodus (das -b-Flag) und erstellt dann eine PID-Datei für den Dämon (-B) unter /var/run/oscam.pid - wie oben erwähnt, müssen Sie möglicherweise die Pfade ändern, dies ist jedoch der Fall Der grundlegende Systemdienst, der zur Steuerung von OSCam erforderlich ist.
Nachdem Sie den Service erstellt haben, müssen Sie die systemd-Daemons durch Ausgabe neu laden.
... dann können Sie einfach den OSCam-Daemon durch Ausgabe von starten.
Sie können überprüfen, ob OSCam ausgeführt wird, indem Sie die Weboberfläche besuchen oder ausführen.
... wo Sie so etwas sehen sollten;
● oscam.service - OScam Loaded: loaded (/etc/systemd/system/oscam.service; disabled; Herstellervoreinstellung: enabled) Aktiv: aktiv (läuft) seit Fr 30.09.2016 11:40:30 GMT; Vor 10min Prozess: 21828 ExecStop = /usr/bin/rm/var/run/oscam.pid (Code = beendet, Status = 203 / EXEC) Prozess: 24126 ExecStart = / usr / local / bin / oscam -b -B /var/run/oscam.pid (Code = beendet, Status = 0 / SUCCESS) Haupt-PID: 24131 (oscam) CGruppe: /system.slice/oscam.service ├─24130 / usr / local / bin / oscam -b-B /var/run/oscam.pid └─24131 / usr / local / bin / oscam -b-B /var/run/oscam.pid
Als letztes müssen Sie sicherstellen, dass OSCam beim Booten gestartet wird. Geben Sie dazu den folgenden Befehl ein.
Und das ist es!
Viel Spaß
Gruß