linuxserver / docker-oscam

GNU General Public License v3.0
47 stars 32 forks source link

sh: pzapit: not found #28

Closed klara31 closed 1 year ago

klara31 commented 3 years ago

linuxserver.io


Expected Behavior

Current Behavior

When starting the container, after a few moments the message sh: pzapit: not found appears. The container is running, but oscam is not working

Steps to Reproduce

1. 2. 3. 4.

Environment

OS: CPU architecture: arm64 How docker service was installed: From the official docker repo.

Command used to create docker container (run/create/compose/screenshot)

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    0
User gid:    0
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing...
[cont-init.d] 30-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
sh: pzapit: not found
github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

tobbenb commented 3 years ago

Please fill in all info we ask for! Try running it as a normal user and not root.

klara31 commented 3 years ago

When running the container as non-root, oscam gives the following error:

2021/02/12 23:10:22 364424E5 r   (reader) smargo [smartreader] libusb_open error LIBUSB_ERROR_ACCESS : the user has insufficient permissions

My docker-compose.yml:

  oscam:
    image: ghcr.io/linuxserver/oscam:latest
    privileged: true
    container_name: oscam
    environment:
      - PUID=1000
      - PGID=100
      - TZ=${TZ}
    volumes:
      - ${USERDIR}/oscam:/config
      - /home/pi/picons/picons:/picons
    ports:
      - 8888:8888
      - 9000:9000
    network_mode: bridge
    devices:
      - /dev/bus/usb/001/004:/dev/bus/usb/001/004
    restart: unless-stopped

Removing the privileged: true has no effect. To get oscam running, I need PUID=0.

tobbenb commented 3 years ago

Change the permissions so that the pi user have permissions to the device. Or you can add the ABC user to the same group inside the container as the group on the host.

klara31 commented 3 years ago

The user with ID 1000 (pi) is part of the plugdev group and the permissions of the device are:

pi@meter:~ $ id
UID=1000(pi) GID=1000(pi) groepen=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),105(input),109(netdev),994(docker),997(gpio),998(i2c),999(spi)
pi@meter:~ $ groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev docker gpio i2c spi
pi@meter:~ $ ls -la /dev/bus/usb/001/004
crw-rw-r-- 1 root plugdev 189, 3 feb 12 10:05 /dev/bus/usb/001/004

So I think user 1000 should be able to access the device. However, with the docker-compose.yml as stated above, it doesn't...

tobbenb commented 3 years ago

I forgot it doesn't work like that. The plugdev group is not in the container, so it doesn't help that the user has permissions for it. You can either set the permission on host or try adding the ABC user to the same gid as the plugdev group on the host. If there is no group with the same gid, then add it.

klara31 commented 3 years ago

OK, I have changed the following:

    environment:
      - PUID=1000
      - PGID=46

Where PGID=46 is the number for the plugdev group. Oscam is working OK with these settings. However, docker logs still gives the pzapit error

tobbenb commented 3 years ago

Not like that. You have to add the abc user to the group inside the container that has the gid 46. If there is no group with gid 46, then create it.

You can also just change the owner of the usb to the pi user on host.

klara31 commented 3 years ago

I'm not quite sure if I can follow you on the first part. User abc in the container has ID 1000, which is the PUID I am using. User 1000 on the host has access to GID 46. Group plugdev on the host has GID 46. What am I doing wrong?

barzog commented 3 years ago

Regarding initial request - regarding pzapit. According to oscam source code (https://svn.streamboard.tv/oscam/trunk/module-dvbapi.c) we have following:

if defined WITH_COOLAPI || defined WITH_COOLAPI2 || defined WITH_NEUTRINO

system("pzapit -rz");

endif

So, if oscam compiled with coolapi/coolapi2 or neutrino - run pzapit -rz on start. In docker oscam we have: DVB API with COOLAPI support: no DVB API with COOLAPI2 support: no DVB API with NEUTRINO support: yes So - it is compiled with neutrino. But zapit (https://github.com/tuxbox-neutrino/gui-neutrino/tree/master/src/zapit) is really absent. I propose to drop neutriono support from docker image. For that we should in Dockerfile modify ./config.sh \ --enable all \ --disable \ CARDREADER_DB2COM \ CARDREADER_INTERNAL \ CARDREADER_STINGER \ CARDREADER_STAPI \ CARDREADER_STAPI5 \ IPV6SUPPORT \ LCDSUPPORT \ LEDSUPPORT \ READ_SDT_CHARSETS \ WITH_NEUTRINO && \

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

barzog commented 3 years ago

Any news on that?

tobbenb commented 3 years ago

Feel free to make a PR.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

joselzinga commented 2 years ago

I'm having the same error-message, but Oscam is working fine in the container:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 01-envfile: executing... [cont-init.d] 01-envfile: exited 0. [cont-init.d] 01-migrations: executing... [migrations] started [migrations] no migrations found [cont-init.d] 01-migrations: exited 0. [cont-init.d] 02-tamper-check: executing... [cont-init.d] 02-tamper-check: exited 0. [cont-init.d] 10-adduser: executing...

      _         ()
     | |  ___   _    __
     | | / __| | |  /  \
     | | \__ \ | | | () |
     |_| |___/ |_|  \__/

Brought to you by linuxserver.io

To support LSIO projects visit: https://www.linuxserver.io/donate/

GID/UID

User uid: 1000 User gid: 20

[cont-init.d] 10-adduser: exited 0. [cont-init.d] 30-config: executing... [cont-init.d] 30-config: exited 0. [cont-init.d] 90-custom-folders: executing... [cont-init.d] 90-custom-folders: exited 0. [cont-init.d] 99-custom-files: executing... [custom-init] no custom files found exiting... [cont-init.d] 99-custom-files: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. sh: pzapit: not found

Judging source-code it is enough to rebuild without NEUTRINO support. Then again, the error does not bother me, but it might confuse others when they're having troubles with the container.

tobbenb commented 2 years ago

I'll look at removing neutrino when I get time.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue is locked due to inactivity