INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How to install the JRiver license file in a QNAP Docker Station? [Solved]  (Read 5269 times)

Helibaby

  • Recent member
  • *
  • Posts: 30

Hi,

I installed JRiver Media Center 28 in a container in my QNAP TS-253A Container Station.
The configaration /config is in /container/MC and the music is in /data/music.

Nearly everthing is fine. The program works as expected!
Because every usage of the installation code counts on my restore counter of JRiver I like to install the .mjr file directly.

What is the correct syntax of the terminal command(s) in the MC container to install the .mjr file with /RestoreFromFile when the .mjr file is in /config?

Thanks a lot in advance!

Helibaby
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 363
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #1 on: February 09, 2022, 03:23:07 pm »

Because every usage of the installation code counts on my restore counter of JRiver I like to install the .mjr file directly.

You can find it here too https://gitlab.com/shiomax/jrivermc-docker#activate-jriver-using-mjr-file

But if you set it up right it should not ask you for re-activation more than once. If it does usually defining a mac address for the container fixes it.
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #2 on: February 10, 2022, 04:48:41 am »

Hi Max096,

You can find it here too https://gitlab.com/shiomax/jrivermc-docker#activate-jriver-using-mjr-file

I know this information.

1. Place the .mjr file into the config directory
   - The .mjr file is in the config directory.

2. Log into the container with bash docker exec -it <container_name> /bin/bash
   - I entered the given command directly in the terminal of the MC-Container
   - But it couldn't find the docker command. (see Terminal.png)

In case I enter /bin/bash in the Container-Terminal command window followed by 'exec env HOME=/config mediacenter28 /RestoreFromFile /config/JRMC29.mjr' command the command line doesn't return. (see Terminal2.png)

In case I enter /bin/bash in the Container-Terminal command window followed by switching to config directory and entering 'mediacenter28 /RestoreFromFile JRMC29.mjr' the command prompt returns but the command has no effect! (see terminal3.png)
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2663
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #3 on: February 10, 2022, 05:31:59 am »

Quote
I entered the given command directly in the terminal of the MC-Container

Docker commands must be run on the host, not in the container.
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #4 on: February 10, 2022, 06:10:52 am »

Hi BryanC,

Docker commands must be run on the host, not in the container.

Thanks for your advice. As you can see I'm no linux pro.  ;D

Both commands run without any obvious problem.
But the /RestoreFromFile command has still no effect!
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2663
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #5 on: February 10, 2022, 06:23:41 am »

Try removing the leading "exec" from the command.
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #6 on: February 10, 2022, 06:34:57 am »

Still unregistered!  :(
But it remains in the container.
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2663
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #7 on: February 10, 2022, 06:43:56 am »

That should work if everything is configured properly. Is mediacenter28 in the PATH? If not, you may need to use the full path in the container. You can also try removing the "env" as well to see if that's masking errors.
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 363
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #8 on: February 10, 2022, 06:48:54 am »

The home directory in the container is a temporary directory. It is set to /config only for some processes like MC. So that is why you need to set the config directory as home directory. I believe without the exec command you would need two commands like this and you would end up changing the home directory of your current bash session (does not really matter but that's why I put the exec command there because you can set environment variables only for the next command).

Maybe I'm wrong about this and exec is actually completely redundant. Either way this should definitely also work.

Code: [Select]
export HOME=/config
mediacenter28 /RestoreFromFile /config/JRMC29.mjr

It's a bit weird that you don't get any output and it exists the container. This used to work. Can try with the latest images when I get home. Might also be that you are using a MC29 license with MC28 if you don't have the latest image try to update it.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72443
  • Where did I put my teeth?
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #9 on: February 10, 2022, 07:47:30 am »

Might also be that you are using a MC29 license with MC28 if you don't have the latest image try to update it.
Try updating MC28.  The latest build may be required for the new license.
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2663
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #10 on: February 10, 2022, 07:51:07 am »

The home directory in the container is a temporary directory. It is set to /config only for some processes like MC. So that is why you need to set the config directory as home directory. I believe without the exec command you would need two commands like this and you would end up changing the home directory of your current bash session (does not really matter but that's why I put the exec command there because you can set environment variables only for the next command).

Maybe I'm wrong about this and exec is actually completely redundant. Either way this should definitely also work.

Code: [Select]
export HOME=/config
mediacenter28 /RestoreFromFile /config/JRMC29.mjr

It's a bit weird that you don't get any output and it exists the container. This used to work. Can try with the latest images when I get home. Might also be that you are using a MC29 license with MC28 if you don't have the latest image try to update it.

Eval just executes strings, in this context it's unnecessary since `env var=val cmd` is completely valid. I'm not sure where the command is being copy-pasta'd from so maybe in that context you need eval.
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #11 on: February 10, 2022, 09:49:21 am »

Try updating MC28.  The latest build may be required for the new license.

My container contains build 28.0.103 which is by now the latest Linux build.
The license is accepted when I enter it in the 'Restore License' window.
But I have to install the license with the .mjr file. This is not working!
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #12 on: February 10, 2022, 10:01:52 am »

Code: [Select]
export HOME=/config
mediacenter28 /RestoreFromFile /config/JRMC29.mjr

It's a bit weird that you don't get any output and it exists the container. This used to work. Can try with the latest images when I get home. Might also be that you are using a MC29 license with MC28 if you don't have the latest image try to update it.

This doesn't work either.

My container contains build 28.0.103 which is by now the latest Linux build. JRiver stated the new codes will work starting with this build.
The license is accepted when I enter it in the 'Restore License' window.
Of course I'm not sure whether the 29er .mjr file works at all with 28.0.103.

(The licence is accepted when I install this .mjr by double clicking on my Windows machine with MC 28.0.105.)
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2663
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #13 on: February 10, 2022, 11:04:00 am »

What happens when you run the command directly?

Code: [Select]
sudo docker exec container_name /usr/bin/mediacenter28 /RestoreFromFile license.mjr
Also make sure that the .mjr file is readable inside the container. You indicated that it activated successfully using the dialog, but I'm not sure if you meant inside the container or on your Windows machine.
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #14 on: February 10, 2022, 11:57:27 am »

What happens when you run the command directly?

Code: [Select]
sudo docker exec container_name /usr/bin/mediacenter28 /RestoreFromFile license.mjr
Also make sure that the .mjr file is readable inside the container. You indicated that it activated successfully using the dialog, but I'm not sure if you meant inside the container or on your Windows machine.

The screen of JRMC28 turns to black and returns immediately (Looks like a MC shutdown and restart), but same result - not activated.
Even with /config/license.mjr does not activate.
Code: [Select]
sudo docker exec container_name /usr/bin/mediacenter28 /RestoreFromFile /config/license.mjr
The .mjr file is readable and writeable but not executable.

QNAP NAS: The activation works in the container when I enter the Registration Code in the 'Restore License" window.
Windows PC: As I don't know how to remove the present MC 28 license from my Windows installation.
                    I just double clicked the .mjr file and got an Information window 'License for Media Center was successfully installed!
                    But it still indicates theMC28 license.
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2663
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #15 on: February 10, 2022, 12:01:37 pm »

Could you try changing the SELinux context on the mjr file?

On the host: sudo chcon -t container_file_t license.mjr

If that doesn't work, make sure you are setting the timezone during container creation so ssl certs work.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72443
  • Where did I put my teeth?
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #16 on: February 10, 2022, 12:22:24 pm »

The mjr file is the Install Key.  It only lasts for 14 days.  Afterward, you need to restore, using a Registration Code.  It's explained here:  https://wiki.jriver.com/index.php/Restoring_a_License
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #17 on: February 10, 2022, 12:25:24 pm »

The mjr file is the Install Key.  It only lasts for 14 days.  Afterward, you need to restore, using a Registration Code.  It's explained here:  https://wiki.jriver.com/index.php/Restoring_a_License

The mjr file is 8 days old today. I got it on Feb, 02.
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 363
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #18 on: February 10, 2022, 06:04:42 pm »

It does not work for me either. Happens with all MC28 versions I tried. Not sure whats wrong just yet. At least you now know you did not do anything wrong. It's probably a problem with the container image.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72443
  • Where did I put my teeth?
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #19 on: February 10, 2022, 06:14:28 pm »

It could also be a problem with our licensing.
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 363
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #20 on: February 10, 2022, 06:26:16 pm »

It could also be a problem with our licensing.

Does not seem like it I tried on on my Fedora install it activated just fine with a mjr file. It might just simply be that the packages in the image are too old. Have not updated it in a while. We'll see. Otherwise, need to dig a bit. It does not say anything useful inside the jriver or docker logs.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72443
  • Where did I put my teeth?
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #21 on: February 10, 2022, 06:33:03 pm »

You could ask bob at jriver if you need to.  Thanks for your work.
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 363
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #22 on: February 10, 2022, 07:05:36 pm »

I think the problem is that JRiver automatically autostarts again in the container and it not working if JRiver is running. When you put this into a .sh script and execute that the bash session will not close only the script will exit.

Code: [Select]
#!/bin/bash
export HOME=/config
mediacenter28 /RestoreFromFile /config/JRMC29.mjr

If you do it twice in very quick succession it sometimes works and activates. I think the first one kills the running JRiver process and the second one works if you are faster than the autostart. Canīt really test if the same would happen on my Fedora install, because it won't open jriver unless it's activated (trial period is long gone).
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #23 on: February 11, 2022, 04:27:19 am »

I think the problem is that JRiver automatically autostarts again in the container and it not working if JRiver is running. When you put this into a .sh script and execute that the bash session will not close only the script will exit.

Code: [Select]
#!/bin/bash
export HOME=/config
mediacenter28 /RestoreFromFile /config/JRMC29.mjr

If you do it twice in very quick succession it sometimes works and activates. I think the first one kills the running JRiver process and the second one works if you are faster than the autostart. Canīt really test if the same would happen on my Fedora install, because it won't open jriver unless it's activated (trial period is long gone).

Half the way is gone! After some attemps it worked. PuTTY announced: License restored successfully from file /config/JRMC29.mjr  :)
BUT: JRMC28 still reports to be unregistered!  :o
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 363
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #24 on: February 11, 2022, 01:22:54 pm »

Quote
BUT: JRMC28 still reports to be unregistered!  :o

Immediately after or did you restart the container? If it disappears again only after you restart the container then thatīs an issue with your mac address changing (usually).

I did also get a MC29 license just now. Also works.

I know you said you are worried about your restores running out. Would not worry too much about it. When you run out it does not mean you then have to go and buy a new license. They can reset that for you within reason.
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #25 on: February 11, 2022, 02:15:06 pm »

Immediately after or did you restart the container? If it disappears again only after you restart the container then thatīs an issue with your mac address changing (usually).

I got the license restorage message in PuTTY right after the second run of your script.
I never saw a successful registration in the Registration Info requester of JRiver28 in the container.
I checked the status directly after the success in PuTTY and after a restart of the container. Both negative.
The container is setup in Bridge mode with a fixed MAC address.
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #26 on: February 11, 2022, 02:23:59 pm »

I did also get a MC29 license just now. Also works.

Does it do the registration?
By entering the Registration Code in the Registration Info requester of the program or by using the Install Key (.mjr file)?
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 363
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #27 on: February 11, 2022, 04:15:50 pm »

Does it do the registration?
By entering the Registration Code in the Registration Info requester of the program or by using the Install Key (.mjr file)?

I did it with the MJR file to test what you did. It's possible you did forget to set the home directory first or mistyped it. If you have anything else other than /config set as the home directory when the command runs then it will install the license successfully, but into a directory JRiver will never look at.

Might be it but either way that workaround is currently a bit of a hack.
Logged

Helibaby

  • Recent member
  • *
  • Posts: 30
Re: How to install the JRiver license file in a QNAP Docker Station?
« Reply #28 on: February 12, 2022, 06:31:27 am »

Finally it worked!  :) :) :)

At least it was close to your instruction on the shiomax website.
With PuTTY I logged as administrator in my host.

In the host:         docker exec -it <container_name> /bin/bash
In the container: export HOME=/config
                         mediacenter28 /RestoreFromFile /config/license.mjr
     <- over and over again until I got the licensing message!

Max096 and BryanC, thanks a lot for your valuable assistance!!!
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13874
Re: How to install the JRiver license file in a QNAP Docker Station? [Solved]
« Reply #29 on: February 14, 2022, 01:05:05 pm »

I really am not following all of this but when MC is running and you try to run it again to install a license you'll likely have an issue.

So just FYI for anyone that needs to stop MC GRACEFULLY, you can simply send it a HUP signal. It will disconnect from DLNA devices and close down as if you'd run exit from the menu.

Here's a simple function to do this you could execute in a bash script

Code: [Select]
function stop_mc {
        PID=`pgrep mediacenter28`
        if [ -z "$PID" ]
        then
                return
        fi

        kill -HUP $PID
        i=0;
        echo "Please wait for Mediacenter to stop gracefully (up to 1 minute)"
        while ps -p $PID > /dev/null
        do
                i=`expr $i + 1`
                sleep 3
                echo -n "."
                if [ $i -eq 20 ]
                then
                        PID=`pgrep mediacenter28`
                        echo ""
                        echo "Mediacenter failed to stop gracefully! Hard killing..."
                        kill -9 $PID
                        return
                fi
        done
        echo ""
}

Of course if you have something that's automatically restarting it you'll need to disable it during the process and re-enable it after it's finished licensing.
(if it's a cron script, just disable cron temporarily).
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 363
Re: How to install the JRiver license file in a QNAP Docker Station? [Solved]
« Reply #30 on: February 26, 2022, 03:08:43 pm »

Thanks bob. I have built in a way to block mc startup now. You can either create the following file while the container is running

Code: [Select]
touch /tmp/BLOCK_MC_STARTUP

Then close MC in VNC or the WebGUI.

Or when creating the container add an env variable BLOCK_MC_STARTUP=1 which will effectively do the same thing.

Then do the activation and either remove the file or stop the container and remove the variable, whichever route you went with.

The graceful shutdown script could be useful if I make a more automated script that does this. Not there yet, but at least now there is a clean way to disable MC from autostarting in the container image to be able to activate reliably with mjr files.

Im pretty sure there was a MC version where this did work while jriver was running, but it was way back when I have no idea. I have not used an .mjr file for a long long time.

Another question. Is there also a way to detect wether or not MC is already activated?

FYI there is no cron or systemd for that matter in the container image. The container uses s6-overlay in place of systemd. The way s6-overlay sees things your container should do 1 job that may consist of multiple processes. However, if one of those services exits entierly it will bring down the container. So the service that runs jriver now loops around sleep 5s endlessly as long as this file exists. The only reason it restarts jriver at all and does not stop the container is because the creator of the baseimage im using has made a service that runs /startapp.sh and re-runs startapp.sh if it exits. It is more lightweight than systemd, but things are also a lot more rudimentary and limited.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13874
Re: How to install the JRiver license file in a QNAP Docker Station? [Solved]
« Reply #31 on: February 28, 2022, 10:50:41 am »

Thanks bob. I have built in a way to block mc startup now. You can either create the following file while the container is running
...
Another question. Is there also a way to detect whether or not MC is already activated?
...
No but we will add that to MC29.
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 363
Re: How to install the JRiver license file in a QNAP Docker Station? [Solved]
« Reply #32 on: February 28, 2022, 04:33:46 pm »

No but we will add that to MC29.

Great! Not sure I'll be needing it just yet. So, no stress. Was just curious if it exists already.
Logged
Pages: [1]   Go Up