Use VLC from node app started by linux service

*nix specific usage questions
Laurent17044
New Cone
New Cone
Posts: 3
Joined: 02 Dec 2023 10:51

Use VLC from node app started by linux service

Postby Laurent17044 » 02 Dec 2023 10:53

Hello,

I have a raspberry with a node server which, via endpoint, should start vlc with RC interface. It works in dev on Windows. It works when, on Raspberry Linux I start Node server with console. As I want the node server to start on Linux startup, I had a service which starts node script. Then, VLC cannot be started anymore, I get error:

{"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":4212}

This is the service used on linux

[Unit]
Description=Description

[Service]
User=root (I tried different user without any success)
WorkingDirectory=/var/www/html/screenwise/backend
ExecStart=npm run live-prod (I also tried with absolute path to npm)
StandardOutput=file:/var/www/html/screenwise/backend/node-logs.log
StandardError=file:/var/www/html/screenwise/backend/node-logs.log
Restart=always

[Install]
WantedBy=multi-user.target

Thanks for your help

Rémi Denis-Courmont
Developer
Developer
Posts: 15272
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Use VLC from node app started by linux service

Postby Rémi Denis-Courmont » 02 Dec 2023 14:25

Whatever is throwing that error (not VLC) is ostensibly failing to connect to TCP port 4212 on loopback. Not much to be said. Only you know your setup.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Laurent17044
New Cone
New Cone
Posts: 3
Joined: 02 Dec 2023 10:51

Re: Use VLC from node app started by linux service

Postby Laurent17044 » 02 Dec 2023 14:49

No specific setup so far, what I don't understand is why I don't have this error when node is started manually from console and I got the error only when node is started from service.

Any reason why a process started from service couldn't access local port 4212 whereas manually it could ?

Have you any idea about what I could check to go ahead ?

Thanks,
Laurent.

Rémi Denis-Courmont
Developer
Developer
Posts: 15272
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Use VLC from node app started by linux service

Postby Rémi Denis-Courmont » 02 Dec 2023 16:27

Again, only you know your system. Anyone else can only give you the basic answer: either nothing is listening on that port, or you have some local security rules that block connections.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Laurent17044
New Cone
New Cone
Posts: 3
Joined: 02 Dec 2023 10:51

Re: Use VLC from node app started by linux service

Postby Laurent17044 » 02 Dec 2023 16:30

hi hi thanks ;-) That's why I came ;-)

'nothing is listening on that port' only when node app is started by service, if started manually from terminal it works

I have the default debiand install on rasperry, i didn't change anything

Rémi Denis-Courmont
Developer
Developer
Posts: 15272
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Use VLC from node app started by linux service

Postby Rémi Denis-Courmont » 02 Dec 2023 20:16

This is not a Node nor RaspBerry Pi support forum (and even there, I doubt you'll get help with such a vague problem description).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 36 guests