Coder Social home page Coder Social logo

Comments (11)

hairmare avatar hairmare commented on July 24, 2024

All the tests I did had liquidsoap being called by another user (www-data as used by airtime) and I didn't run into any issues there.

I'll have to look into this and do plan on adding a default user at some time. I haven't done anything yet since we are still figuring out how we would like to manage service users at @radiorabe.

from centos-rpm-liquidsoap.

hairmare avatar hairmare commented on July 24, 2024

I added dynamic user allocation for the liquidsoap user so you can now assume that the user exists like suggested on the mailinglist. You might still need to mkdir /var/log/liquidsoap && chown liquidsoap /var/log/liquidsoap/ for it to work though.

from centos-rpm-liquidsoap.

hairmare avatar hairmare commented on July 24, 2024

Also, you won't need to chown the scripts or the binary. At runtime the user liquidsoap only needs to be able to access and/or execute the files and this is already given by the permissions from the package.

from centos-rpm-liquidsoap.

amavarick avatar amavarick commented on July 24, 2024

I wiped my VPS and restarted to clean the slate. I used your library to install and I now see the liquidsoap user. However, the liquidsoap files and folders still show as owned by root. I su liquidsoap and tried to run and received permissions issue.

I know the script is good because I:
chmod u+x /etc/liquidsoap/radio.liq

So I chown all liquidsoap directories that I am aware of...

chown -R liquidsoap:liquidsoap /etc/liquidsoap /usr/lib/liquidsoap /usr/bin/liquidsoap /var/lib/liquidsoap /etc/logrotate.d/liquidsoap /tmp/liquidsoap.log

Then I ran the script ./radio.liq and it actually started. I was able to see the stream in icecast and connect.

Problems:

Looking at the log files, the following stuck out...

2016/08/10 10:19:26 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2016/08/10 10:19:26 [dynamic.loader:3] Could not find dynamic module for aacplus encoder.
2016/08/10 10:19:26 [dynamic.loader:2] Could not load plugins in directory /usr/lib/liquidsoap/1.2.1/plugins.

Upon further analysis, there are no plugins folders under /usr/lib/liquidsoap/

Nor is there a plugins folder that I could find any other plugins folders relating to Liquidsoap on the server

[root@stream 1.2.1]# find / -name plugins
/usr/lib/python2.7/site-packages/tuned/plugins
/usr/lib64/krb5/plugins

I don't know about the dynamic module encoders, I'm using mp3 so I probably don't need them but others may. If this is a separate issue from the root, please feel free to fork the issues.

Regarding root... would you consider altering the necessary folders/files to be owned by liquidsoap:liquidsoap from the install and providing basic instruction for how to start liquidsoap as liquidsoap user in a manner that doesn't require the terminal to remain open?

from centos-rpm-liquidsoap.

hairmare avatar hairmare commented on July 24, 2024

I didn't compile aac stuff into the package yet, so I would not expect that to work. That would also explain why the plugins are missing.

I plan on providing a systemd service for starting liquidsoap.

Are you sure that you really need all the files to belong to the liquidsoap user? I don't think they should since the runtime user should not be able to make changes on the installed binary.

from centos-rpm-liquidsoap.

amavarick avatar amavarick commented on July 24, 2024

No I am not sure... I welcome your recommendation as to exactly what files/folders to chown.... or to have your installer automatically chown the proper files/folders. I think I made an atomic option, at least I didn't 777 like some boards advised!!! ;-)

from centos-rpm-liquidsoap.

hairmare avatar hairmare commented on July 24, 2024

Revision 39 contains a systemd service file. The service can be started with systemctl enable liquidsoap && systemctl start liquidsoap. You should then be able to tail it's log with journalctl -fn -u nginx.service.

I haven't been able to test it yet since my local CentOS is on docker and doesn't do systemd.

from centos-rpm-liquidsoap.

amavarick avatar amavarick commented on July 24, 2024

So if I wanted to run two liquidsoap streams to icecast, would the command you provided work for that? Does liquidsoap automatically look at /etc/liquidsoap for *.liq files or do I need to define them somehow?

from centos-rpm-liquidsoap.

hairmare avatar hairmare commented on July 24, 2024

I think my service file was unuseable. You can edit the service using systemctl edit liquidsoap.service. You probably need to replace the ExecStart line with ExecStart=/usr/bin/liquidsoap -v /etc/liquidsoap/radio.liq.

For the service to support multiple instances you will have to copy the file to /etc/systemd/system. You should be able to just cp /usr/lib/systemd/system/liquidsoap.service /etc/systemd/systemd/liquidsoap-stream0.service and then enable/start those.

from centos-rpm-liquidsoap.

amavarick avatar amavarick commented on July 24, 2024

After your changes, I was able to perform the install on a new server instance to test your new liquidsoap user changes to the package.

I created the liq file as radio.liq and included the following on the first line of the file. This entry allows for me to run the liq script directly by ./liqscriptname.liq
#!/usr/bin/liquidsoap

Then I set permissions and ownership of the liq file:

chmod u+x /etc/liquidsoap/radio.liq
chown liquidsoap:liquidsoap /etc/liquidsoap/radio.liq

I am able to execute two scripts at the same time using the following command. I replaced radio.liq with the name of the other script:

liquidsoap /etc/liquidsoap/radio.liq &
liquidsoap /etc/liquidsoap/test.liq &

Thank you so much for your time and very prompt responses with the issues.

from centos-rpm-liquidsoap.

hairmare avatar hairmare commented on July 24, 2024

I just added an instantiatable systemd service so starting multiple instances should be easy now. It won't automatically check the /etc/liquidsoap/ folder though.

To run your examples through systemd you would execute the following commands:

# enable services on boot (creates proper symlinks)
systemctl enable liquidsoap@radio
systemctl enable liquidsoap@test

# start them in the running system
systemctl start liquidsoap@radio
systemctl start liquidsoap@test

If you use the service you won't need to add a shebang to the scripts and I'm also pretty sure that the chown is not needed as well. Just make sure to chmod o+r the files (this should be the default but it depends on your umask).

I'm closing this since I feel that the root and systemd issues should be solved by now. Feel free to reopen this or create more issues if anything is still unclear.

from centos-rpm-liquidsoap.

Related Issues (20)

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.