Debian Oscam StartScript

There are 4 replies in this Thread which was already clicked 9,394 times. The last Post () by s3n0.

  • 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;

    Code
    sudo nano /etc/systemd/system/oscam.service

    …and add the following content…

    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;

    Code
    sudo systemctl daemon-reload

    …then you can simply start the OSCam daemon by issuing;

    Code
    sudo systemctl start oscam

    You can check OSCam is running by visiting the web interface or by running;

    Code
    sudo systemctl status oscam

    …where you should see something like this;

    Code
    ● 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;

    Code
    sudo systemctl enable oscam.service

    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.

    Code
      sudo nano /etc/systemd/system/oscam.service 

    … Und folgenden Inhalt hinzufügen…

    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.

    Code
    sudo systemctl daemon-reload 

    ... dann können Sie einfach den OSCam-Daemon durch Ausgabe von starten.

    Code
    sudo systemctl start oscam 

    Sie können überprüfen, ob OSCam ausgeführt wird, indem Sie die Weboberfläche besuchen oder ausführen.


    Code
    sudo systemctl status oscam



    ... wo Sie so etwas sehen sollten;

    Code
      ● 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.

    Code
    sudo systemctl enable oscam.service

    Und das ist es!

    Viel Spaß


    Gruß

  • Hi.


    Of course yes, why not ? You just have to modify all the necessary files so that instead of Oscam it is Cccam. And also modify the arguments of the softcam. For example, the "-b" argument is used to start a specific Oscam softcam in the background. Of course Cccam softcam uses different arguments and by default it starts automatically in the background (no argument is needed for any starting in the background).

  • The reason I asked about cccam, is that I can not start it.

    For oscam, and this script here..It's no problems.. But with cccam I got errors.


    But maybe I'm not doing it right...

    I make this using cccam 2.13:



    [Unit]

    Description=CCcam

    After=network.target

    Requires=network.target

    [Service]

    Type=forking

    PIDFile=/var/run/cccam.pid

    ExecStart=/usr/local/bin/CCcam.x86_64 -B /var/run/cccam.pid

    ExecStop=/usr/bin/rm /var/run/cccam.pid

    TimeoutStopSec=1

    Restart=always

    RestartSec=5

    StartLimitInterval=0

    [Install]

    WantedBy=multi-user.target




    sudo systemctl daemon-reload


    sudo systemctl start cccam

    Job for cccam.service failed because the service did not take the steps required by its unit configuration.

    See "systemctl status cccam.service" and "journalctl -xe" for details



    systemctl status cccam.service:


    ● cccam.service - CCcam


    Loaded: loaded (/etc/systemd/system/cccam.service; disabled; vendor preset: enabled)


    Active: activating (auto-restart) (Result: protocol) since Sun 2022-01-30 12:22:15 CET; 2s ago


    Process: 2150 ExecStart=/usr/local/bin/CCcam.x86_64 -B /var/run/cccam.pid (code=exited, status=0/SUCCESS)



    lmde4-vm systemd[1]: Failed to start CCcam.

  • I don't have Debian Linux and I don't use this kind of "service launcher", so, I guess I can't advise you. I use "/etc/init.d" to run OSCam / CCcam. See the script of mine as well as the instructions inside the script:

    https://github.com/s3n0/e2scripts/blob/master/softcam


    However, Linux systems are CASE SENSTIVE. Therefore, make sure that the binary file name or service name is correct. Use the same capital letters everywhere - use CCcam, not cccam. Maybe it will help. Your binary contains the first two capital letters.


    Or it will be easier if you change all your "CCcam" to "cccam". To lowercase letters. Also rename the binary file to "cccam" from the original "CCcam.x86_64". Of course, then also edit your config file and change this "CCcam.x86_64" to "cccam".


    I don't know for sure, but it seems to me that the PID file must have about the same name as the binary file name or the service name.


    I also think that the "-B" argument is not necessary. Linux creates the PID file itself. But I don't know for sure either. My CCcam binary file (in the Enigma2 / Linux set-top box) does not contain any "-B" argument. Although it depends on the build version of a particular CCcam. In my opinion, this "-B" argument is not necessary. I'm not sure, sorry.


    I recommend using this line as a trigger for cccam:

    ExecStart=/bin/bash -c '/usr/bin/CCcam -c /var/etc/CCcam.cfg'

    Or if you changed everything to "cccam" (lower case), then:

    ExecStart=/bin/bash -c '/usr/bin/cccam -c /var/etc/cccam.cfg'


    Or try the following start script (source: http://www.digital-eliteboard.com):

    Don't forget to match the size of the characters in the service name, script name and binary name.


    I hope your CCcam binary also has the execution attributes set:

    chmod a+x /path/binary_file

OSCam Support Forum

Configs, discussion, downloads and guides for OSCam Softcam.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!