Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

rc.local does not run program with parameters correctly

Featured Replies

please, I am really helpless. I am on Armbian.

I am trying to run hyperion-v4l2 in /etc/rc.local (please it is not important why for now) with these parameters: Code:

/home/user/hyperion/build/bin/hyperion-v4l2 --device /dev/video0 --video-standard PAL --width 720 --height 576 --crop-top 10 --crop-bottom 10 --crop-left 24 --crop-right 24 --frame-decimator 1 --size-decimator 4 --red-threshold 0.2 --green-threshold 0.4 --blue-threshold 1.0

(before v4l2 I am executing sudo /home/user/hyperion/build/bin/hyperiond /home/user/hyperion.config.json) But it does not take crop parameters in effect (important for blackborder detection) of hyperion-v4l2. I tried to put the whole command in sh and python script (subprocess) but it is the same, in rc.local crop parameters are omitted, no idea why. BUT when I execute the same SH or Python script when I log in via my user, it works correctly.

What can be wrong? In rc.local and all executed scripts via rc.local it does not take crop parameters in effect. Maybe the line with parameters is very long, but I don't understand it because manually the same scripts work correctly.

 

UPDATE: After several trial and errors I found out, probably, it is related to  THIS   sudo /home/user/hyperion/build/bin/hyperiond /home/user/hyperion.config.json. Because when I run this script via rc.local and then manually hyperion-v4l2, then behaviour is the same.

Why are you using sudo when running from rc.local? Most likely sudo eats your double dash arguments instead of passing them to the program. While you can add a double dash before those arguments to avoid this issue, you may as well drop sudo invocation at all if you want to run this process as root.

Does it use any kind of configuration files stored in /home?

Looks like it does based on your first posts.

Processes started from /etc/rc.local will be started as root, so their home directory will be /root, so your program may be searching for its configuration files in wrong directory

  • Author
4 minutes ago, zador.blood.stained said:

Does it use any kind of configuration files stored in /home?

Looks like it does based on your first posts.

Processes started from /etc/rc.local will be started as root, so their home directory will be /root, so your program may be searching for its configuration files in wrong directory

 

I don't think so. Program is not trying to search for config files. According to my opinion program just not receive the right parameters, but no idea why. When I try to execute the same program with/without sudo via terminal, it works ok (It gets parameters ok).

12 minutes ago, peter12 said:

According to my opinion program just not receive the right parameters, but no idea why.

Please run "ps ax" to get the PID of hyperion-v4l2 (running from rc.local) and then run "ps -o args -p <pid> | tail", i.e.

ps -o args -p 1234 | tail

There you'll see command line passed to hyperion-v4l2 so you can check if it is correct or not

Edited by zador.blood.stained
Added | tail to wrap long lines

  • Author

UPDATE: After several trial and errors I found out, probably, it is related to  THIS   sudo /home/user/hyperion/build/bin/hyperiond /home/user/hyperion.config.json. Because when I run this script via rc.local and then manually hyperion-v4l2, then behaviour is the same.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.