Menu

how to configure recording on a headless private Linux server

scofra
2020-12-02
2020-12-05
  • scofra

    scofra - 2020-12-02

    Hello,

    What's the best way to configure recording on a headless private Linux server running in the cloud? I followed the instructions (https://jamulus.io/wiki/Server-Linux), but recording isn't working. (Everything else appears to work very well!)

    My jamulus service exec string sets the -R flag and passes a directory for new recordings:

    ExecStart=/usr/local/bin/llcon-jamulus/Jamulus --server --nogui \
    --log /var/log/jamulus/jamulus.log \
    --serverinfo "<my_server_name>;<my_city>;<my_code>" \
    --welcomemessage "<h2>Welcome to <my_server>!</h2>" \
    --recording /home/ubuntu/recordings/ \
    --numchannels 10
    

    I've confirmed that the /home/ubuntu/recordings/ directory exists and is writable (chomd 777).

    However, systemctl status output claims that "/home/ubuntu/recordings does not exist but could not be created," and "Recording state disabled."

    Following the server-linux instructions, I created two additional services to propagate signals to start and toggle recording. Status updates show those two services apparently working, but calling those services still doesn't enable recordings. From systemctl status jamulus:
    OnHandledSignal: 10
    OnHandledSignal: 12

    I've tried silly things like enclosing the absolute path in quotes, adding and removing the trailing '/', &c. What am I missing?

    TIA for suggestions!
    Scott

     
  • Vincenzo

    Vincenzo - 2020-12-03

    mmm.... maybe ubuntu should be traversable, try chmod a+x /home/ubuntu/

     
  • scofra

    scofra - 2020-12-03

    Hi Vicenzo,

    Great suggestion! I tried your chmod cmd, but the problem persists.

    Taking a closer look at permissions, I note that my home/ and ubuntu/ directories have the same permissions as var/ -- and jamulus is happily writing its logfiles. I've set my recordings/ permissions even more open.

    drwxr-xr-x  13 root root  4096 Jul 16 10:14 var/
    drwxr-xr-x   3 root root  4096 Nov  9 13:48 home/
    drwxr-xr-x  5 ubuntu ubuntu 4096 Dec  3 14:02 ubuntu/
    drwxrwxrwx 2 ubuntu ubuntu  4096 Dec  1 13:33 recordings/
    

    Service status output prints the execution string with the --recording directory set to an absolute path; and I've verified that the path is correct.

    /usr/local/bin/llcon-jamulus/Jamulus --server --nogui --recording /home/ubuntu/recordings/ --log /var/log/jamulus/jamulus.log [ ... ]

    ll /home/ubuntu/recordings/
    total 8
    drwxrwxrwx 2 ubuntu ubuntu 4096 Dec  1 13:33 ./
    drwxr-xr-x 5 ubuntu ubuntu 4096 Dec  3 14:02 ../
    

    Interestingly, if I set the -R argument to a relative path, the exec string reflects my relative path as I've entered it, but the output msgs prepend a root dir slash to the path.

    /usr/local/bin/llcon-jamulus/Jamulus --server --nogui --recording ~/recordings/
    jamulus[99431]: - recording directory name: ~/recordings/
    jamulus[99431]: "/~/recordings does not exist but could not be created"
    

    Dunno if this means much, but it's weird.

    Anyway, I'm still stuck with "Recording state disabled." Anyone else having this problem? I'm running this on a vanilla AWS:Lightsail server instance.

    Thanks again!
    Scott

     

    Last edit: scofra 2020-12-03
  • Vincenzo

    Vincenzo - 2020-12-04

    Did you try by directly running Jamulus instead of using the service?

     
  • BartM

    BartM - 2020-12-04

    Hi Scofra,

    If you followed the instructions in (https://jamulus.io/wiki/Server-Linux and are using the supplied unit file the server will be running as user=jamulus and set group=ubuntu. So check that the recording directory is writable bij de user jamulus.
    Check the option "ProtectHome=True" and change it to "ProtectHome=False" Otherwise all directorys under /home will be write protected by the systemd service even when the filesystem rights tell you otherwise. The executable is denied wite actions in the homedir by the systemd service.

    I just tested it on my test AWS server and got the same issue, now it is working fine. Created a recordings directory in /home/ubuntu and changed owner to jamulus:ubuntu. Also SIGUSR2 wil start and stop the recording.

    See the working unit file below


    [Unit]
    Description=Jamulus-Server
    After=network.target
    
    [Service]
    Type=simple
    User=jamulus
    Group=ubuntu
    NoNewPrivileges=true
    ProtectSystem=true
    ProtectHome=False
    Nice=-20
    IOSchedulingClass=realtime
    IOSchedulingPriority=0
    
    ExecStart=/usr/local/bin/Jamulus --server \
            --nogui \
            --numchannels 16 \
            --norecord \
            --recording /home/ubuntu/recordings
    
    Restart=on-failure
    RestartSec=30
    StandardOutput=journal
    StandardError=inherit
    SyslogIdentifier=jamulus
    
    [Install]
    WantedBy=multi-user.target
    

     

    Last edit: BartM 2020-12-04
  • scofra

    scofra - 2020-12-05

    Issue resolved!

    @Bart, thanks for the updated unit. I modified it slightly, adding logging and my personalized welcome message. Seems setting "ProtectHome=False" did the trick.

    @Vincenzo, I tried running the exec string as a simple command and yes, it seems like it would work. Shell output claims "Recording state enabled."

    Ultimately I'm using the service unit approach and toggling recording on/off with propagated signals, as per the docs.

    Thanks for the suggestions!
    Scott

     
  • BartM

    BartM - 2020-12-05

    Scott,

    Nice to hear that the problem is fixed, also note the jamulus option --norecord, this disables the recording after starting jamulus server, so it won't start recording when the first user connects. You firsthave have to send a SIGUSR2 to the server to enable recording. This way everyone can first connect and setup and you can start recording when everybody is ready, The next SIGUSR2 signal will stop the recording. It's a toggle action.

     
  • scofra

    scofra - 2020-12-05

    Hi Bart,

    Thanks again! I saw the --norecord option in your example unit and found it on the cmd-line options page. Makes sense; and the signals that toggle recording on/off work perfectly, as per the docs.

    I really appreciate all the info!

    Best,
    Scott