Oscam telnet command for stopping

There are 30 replies in this Thread which was already clicked 4,753 times. The last Post () by ddinc.

  • Hi.


    First you need to find out which launcher for Oscam is used in your system (sysctl / systemd or maybe "init.d" scripts). Accordingly, it is appropriate to drop or restart the service accordingly.


    If you are using an "init.d" script, then there should be functional parameters for that script, such as start | stop | restart, for example:

    /etc/init.d/softcam restart

    -or:

    /etc/init.d/softcam.oscam restart

    If you want to list files that contain the word "cam" in the file name (inside the "/etc/init.d" folder), use this command:

    ls -al /etc/init.d/*cam*


    Of course, you can also "kill" the process, but first find out its name, for example like this:

    ps -aux | grep -i "cam"

    -or:

    ps | grep -i "cam"

    And here in the list you will probably see your Oscam and its name. Then it should be enough to use a hard kill:

    killall -9 <process_name>


    When using the "ps" command, you may notice the entire command-line of your Oscam, i.e. including the arguments placed behind the Oscam binary file. To start Oscam again, use exactly the same command-line including the same arguments. For example:

    /usr/bin/oscam -b -r 2


    Good Luck :)


    /// EDIT:


    Are you using OE2.5 ?


    Oh sorry... so then you probably use "sysctl" and not "init.d", for purpose of the start | stop | restart services. This tool is used a little differently. Of course, you can use the sysctl command to control processes (including the oscam process).


    Example: systemctl restart <service_name>


    Here is more info: https://crunchify.com/systemd-…respawn-process-linux-os/

  • Tried several commands without luck (:

    opendreambox 2.5.0 dm920



    dm920 login: root

    root@dm920:~# ps -aux | grep -i "cam"

    root 383 0.0 0.0 6172 388 ? Ss Feb28 0:00 /usr/bin/oscam_11704 -b -r 2 -c /var/tuxbox/config

    root 15678 15.5 1.7 36432 18300 ? S<l 09:19 6:31 /usr/bin/oscam_11704 -b -r 2 -c /var/tuxbox/config

    root 18262 0.0 0.0 2844 544 pts/0 S+ 10:01 0:00 grep -i cam

    root@dm920:~# killall -9 oscam_11704

    root@dm920:~# killall -9 oscam_11704

    root@dm920:~# killall/usr/bin/oscam_11704 -b -r 2 -c

    -bash: killall/usr/bin/oscam_11704: No such file or directory

    root@dm920:~# /usr/bin/oscam_11704 -b -r 2

    root@dm920:~# systemctl killall -9 oscam_11704

    systemctl: invalid option -- '9'

    root@dm920:~# systemctl stop oscam_11704

    root@dm920:~# systemctl stop oscam_11704

    root@dm920:~# killall/usr/bin/oscam_11704 -b

    -bash: killall/usr/bin/oscam_11704: No such file or directory

  • Hi.


    You could paste a copy from the Linux console into the CODE TAG. It's then clearer.

    Also, the "killall" command is unfortunately not quite universal and may behave a little differently, in different versions of it (BusyBox complex versions as well as in full-fledged Linux versions). In some versions, the signal number is not used, but the signal name, such as:

    killall -SIGKILL oscam_11704

    And somewhere I think the hyphen in front of the signal must not be used. I don't remember exactly. Sorry. But I know it's a mess with the new versions.


    You can also use the "kill" command to kill processes, not just "killall". However, then you need to find out all PID numbers (values representing the process number). For example, as follows:

    kill -n 9 $(pidof oscam_11704)

    - or :

    kill -9 $(pidof oscam_11704)

    - or :

    kill $(pidof oscam_11704)

    (It really depends on the version of your "kill" command (or rather "kill" tool) that how it will behave.)


    However, using killall and kill is very difficult on new Linux systems (Dreambox firmware) or even compared to old versions, many things always change! Therefore, it is better to use the standard path. If you show me an IPK package for your Oscam, I'll unpack it and tell you exactly how Oscam restarts in your case :) - based on the unpacked IPK package (using a 7-zip archiver you can unpack).


    So... again... you must first know what startup principle is used on your Linux system. Maybe sysctl is not used for Oscam but systemd. You have to find out first.


    Depending on what you copied from your console, you still haven't tried the "init.d" scripts !


    I dont know all Enigma2 distributions in the world and I dont know in which Enigma2 there are exactly what options (installed components and tools of the Linux system).


    OpenDreambox 2.5 should use sysctl, if I'm not mistaken. But the systemd / init.d service launcher can also be used there.


    Or maybe "start-stop-daemon" is also used in your case. I really do not know. Linux systems are very extensive in this regard - in terms of processes and their management by the system administrator.

  • Thanks for your expert advice but I gave up :head banger:


    init d does not work

    root@dm920:/bin# systemctl restart oscam_11704

    root@dm920:/bin# systemctl kill oscam_11704

    these seem to work on telnet but oscam did not stop or restart

  • i havent seen your systemd script



    but most have a restart after 5 seconds if it stops


    typical systemd script


    parabéns cr7 & moliveira88

    Μπρέντφορντ Φ.Σ

    RIP Vangelis Papathanassiou

  • I have created /etc/systemd/system/oscam.service


    [Unit]

    Description=OScam

    After=network.target

    Requires=network.target


    [Service]

    Type=forking

    PIDFile=/var/run/oscam.pid

    ExecStart=/usr/bin/oscam_11704 -b -B /var/run/oscam.pid

    ExecStop=/bin/rm /var/run/oscam.pid

    TimeoutStopSec=1

    StartLimitInterval=0


    [Install]

    WantedBy=multi-user.target



    + systemctl enable oscam.service"

    "systemctl start oscam.service"


    seems to be ok....but I will see tomorrow morning if it works as the problem occurs during the night :sleeping face:

    Edited once, last by ddinc ().

  • Try adding this as well (under the "Service" configuration section):


    Code
    [Service]
    Restart=always
    RestartSec=5
    StartLimitInterval=0


    Although I'm not sure if this will be recognized by your Lilnux, used in your set-top box. I hope so.


    You should not have created this new file there. It probably already exists there. Or have you already looked for him and not found him? You should have used one that already exists there (of course only if you find it there).

  • Oscam was alive in the morning...BUT messed my webinterface...many clients dropped offline.......had to delete the oscam.service file and stop the serviceto restore the functional config (:

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!