question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Service initialization failed with `Unable to open a file descriptor for /dev/video2`

See original GitHub issue

This guide worked perfectly, so thank you!

I have one issue left, though: on boot, the service fails to start with the message Unable to open a file descriptor for /dev/video2. I guess this is due to enable-ir-emitter.service starting before the webcam is properly detected by the system. I am unsure how to keep the service from starting, until the webcam is detected, as my technical knowledge of systemd is fairly limited. I tried adding after=systemd-udev-settle.service, but this did not solve the issue. Interestingly, the IR-Blaster sometimes still works fine after a reboot when logging in in sddm, but not reliably.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
m4rtinscommented, Oct 29, 2020

One additional Note: the IR-Blaster also did not work upon resume from hibernate, as the service was applied during hibernation, but not on resume. Adding the corresponding services to After fixed this.

1reaction
m4rtinscommented, Oct 27, 2020

I am using Manjaro and according to this, the usage of udev-settle is not recommended anyway. I have tried to use udev-rules in the meantime following the first answer in this question. It did not work as well, but adding Requires=... seems to have done the trick.

So in total, I have a file webcam.rules in /etc/udev/rules.d:

KERNEL=="video2", SYMLINK="video2", TAG+="systemd"

And enable-ir-emitter.service reads:

[Unit]
Description=enable ir emitter
Requires=dev-video2.device
After=dev-video2.device

[Service]
ExecStart=/usr/local/bin/enable-ir-emitter

[Install]
WantedBy=multi-user.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target`
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to open file descriptor associated with device
There are no compile errors, but when I run the program, I get an error when trying to open the file descriptor associated...
Read more >
apache kafka - Docker - unable to allocate file descriptor table
I fixed this problem by override commands arguments ExecStart in docker.service sudo systemctl edit docker. and then enter
Read more >
Failed to open /dev/video0: No such file or directory
Unable to open V4L2 device '/dev/video0'. or. Failed to open /dev/video0: No such file or directory. Two potential problems:.
Read more >
memcached: Failed To Set rlimit For Open Files Error and ...
However, whey I try to start the server using service memcached start command, ... Set Per-process File Descriptor Limits For Memcached.
Read more >
Changes to File Descriptor Limits in Solaris 11.4.27.82.1 (and ...
Setting the file descriptor limit to 65536 in user initialization files (.profile, .kshrc, .login, etc) also fails.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found