Code Monkey home page Code Monkey logo

Comments (1)

Gadgetoid avatar Gadgetoid commented on June 15, 2024

Looking over the init script, it's presumably because vlc runs unprivileged as the "pi" user which does not have access to use port 80.

Stretching back into distant memory, I recall vlc didn't like running as root and it would probably be a terrible idea anyway.

Best answer I can find is to use setcap to allow the vlc binary access to port 80:

sudo apt-get install libcap2-bin 
sudo setcap 'cap_net_bind_service=+ep' /usr/bin/vlc

That could be coupled with this changeset to make changing port/pass easier:

diff --git a/projects/vlc-radio/vlcd/usr/bin/vlcd b/projects/vlc-radio/vlcd/usr/bin/vlcd
index 374233b..f7515b3 100755
--- a/projects/vlc-radio/vlcd/usr/bin/vlcd
+++ b/projects/vlc-radio/vlcd/usr/bin/vlcd
@@ -1,5 +1,8 @@
 #!/usr/bin/env bash
 
+HTTP_PORT=8080
+HTTP_PASS=raspberry
+
 sudo mkdir -p /var/run/vlcd
 
 if [ -n $(cat /etc/passwd | grep -w "pi:") ]; then
@@ -18,6 +21,10 @@ else
     playlist="/etc/vlcd/default.m3u"
 fi
 
+if [ -f /etc/vlcd/config ]; then
+    source /etc/vlcd/config
+fi
+
 volpref=$(grep "^alsa-gain" ~/.config/vlc/vlcrc)
 
 if [ -z $volpref ]; then
@@ -43,7 +50,7 @@ fi
 --intf dummy \
 --extraintf rc:http \
 --rc-host 0.0.0.0:9294 --rc-fake-tty \
---http-host 0.0.0.0 --http-port 8080 --http-password raspberry \
+--http-host 0.0.0.0 --http-port $HTTP_PORT --http-password $HTTP_PASS \
 --no-quiet \
 --daemon \
 --pidfile /var/run/vlcd/vlcd.pid \

And the config file would look something like this:

cat projects/vlc-radio/vlcd/etc/vlcd/config 
HTTP_PORT=80
HTTP_PASS=raspberry

from phat-beat.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.