ReadyNAS6 restructured packages (Intel) UPDATED + WORKING

Right,
 
So after some fiddling with the ReadyNAS6 packaging I believe we have some results that should make it easier for users to upgrade now and in the future. But before we fully push it to production, it would be good to know if its working for others in the community.
 
Basically I redid the binaries package to also include the relevant parts from the meta package (non binaries package), and have it do the right steps to replace the meta package and take over fully as a main package. That means that once this is installed, its simply applying the next binary release on top of this and the next and the next… you get the picture.
 
The new package can be pulled from here: plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb
 
To install upload via gui and it will update your existing PMS install to the latest.
 
I tested this on two different ReadyNAS6 boxes where it worked as intended, so please report back to this thread if anything seems suspicious.
 
- Mark

EDIT: Updated package. I believe I have things fully under control as for the replacing the old broken packages and fixed errors on upgrades.

Hmm... Well, i have 0.9.8.18 on mine right now -- 0.9.9.0 troubles with transcoder crashing. When I applied package via web UI, it just vanished into ether... no messages, no log entries. I consider that a ROS6 shortcoming though.

When I applied this using dpkg, I get:

# dpkg -i plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.1

dpkg: considering removing plexmediaserver-ros6 in favour of plexmediaserver-ros6-binaries …
dpkg: no, cannot proceed with removal of plexmediaserver-ros6 (–auto-deconfigure will help):
plexmediaserver-ros6-binaries depends on plexmediaserver-ros6
plexmediaserver-ros6 is to be removed.

dpkg: regarding plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.1 containing plexmediaserver-ros6-binaries:
plexmediaserver-ros6-binaries conflicts with plexmediaserver-ros6
plexmediaserver-ros6 (version 0.9.8.18.290-11b7fdd) is present and installed.

dpkg: error processing plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.1 (–install):
conflicting packages - not installing plexmediaserver-ros6-binaries
Errors were encountered while processing:
plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.1

Wow... scary... I was able to do this, despite it's earlier protest about the dependency. LOL But there were still some complaints.

# dpkg -r plexmediaserver-ros6

(Reading database … 16651 files and directories currently installed.)
Removing plexmediaserver-ros6 …

dpkg -i plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.1

(Reading database … 16641 files and directories currently installed.)
Preparing to replace plexmediaserver-ros6-binaries 0.9.8.18.290-11b7fdd (using plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.1) …
Unpacking replacement plexmediaserver-ros6-binaries …
Setting up plexmediaserver-ros6-binaries (0.9.9.0.308-7e8496a) …
Adding ‘diversion of /apps/plexmediaserver/config.xml to /apps/plexmediaserver/config.xml.orig by plexmediaserver-ros6-binaries’
Adding ‘diversion of /apps/plexmediaserver/plexmediaserver_environment to /apps/plexmediaserver/plexmediaserver_environment.orig by plexmediaserver-ros6-binaries’
Adding ‘diversion of /apps/plexmediaserver/pre-start.sh to /apps/plexmediaserver/pre-start.sh.orig by plexmediaserver-ros6-binaries’
Adding ‘diversion of /apps/plexmediaserver/start.sh to /apps/plexmediaserver/start.sh.orig by plexmediaserver-ros6-binaries’
Adding ‘diversion of /apps/plexmediaserver/fvapp-plexmediaserver.service to /apps/plexmediaserver/fvapp-plexmediaserver.service.orig by plexmediaserver-ros6-binaries’
Adding ‘diversion of /apps/plexmediaserver/logo.png to /apps/plexmediaserver/logo.png.orig by plexmediaserver-ros6-binaries’
cp: /apps/plexmediaserver/Binaries/config.xml' and/apps/plexmediaserver/config.xml’ are the same file
dpkg: error processing plexmediaserver-ros6-binaries (–install):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
plexmediaserver-ros6-binaries

Makes me wonder whether perhaps doing a complete removal and install would have been "easier." But since the media library is actually in the app folder, this would have required some extra work to recovery. Has there been any consideration to follow the usual add-on safe approach of locating volatile data in the /data/ path in a share defined by the app, instead of requiring it to be in the /app/ binary path? Would make it much easier to crash'n'burn test with different releases without worrying about loss of library data.

I’ll take that blow. I set the package to remove anything lower than 0.9.8.18’ not including that. I’ll rebuild and re-upload an updated version. I’ll take a look and see if I can get it to push some information to the GUI when working. No promises.

- Mark

Right, package updated. If there despite the versioning issue (my brainfart), is still an issue with the /apps/plexmediaserver/config.xml copying, I’ll set it to do it in another manor. This method did work on all my previous tests so its good to get some real-life results back. Thank you very much for that.

- Mark

Will test again shortly. I ran into an issue with 0.9.9.0 I'd seen before (not a packaging issue I suspect) where it started failing to start. Tried rolling back but it's unhappy. So following my own suggestion and relocating MediaLibrary so I can yank and do a fresh install with your latest bundle.

Ouch... :( Now I can't get PLEX to start at all. I've tried 0.9.9.0 and 0.9.8.18. Either way I'm getting "app failed to initialize" and code 22002010000

A couple of oddities... even when removing the package, it seems to want to remove other packages.

Failed to issue method call: Unit fvapp-plexmediaserver.service not loaded.
Failed to issue method call: No such file or directory

If all I did was INSTALL and REMOVE the package, how is it leaving artifacts it can't clean up?

dpkg: warning: while removing plexmediaserver-ros6-binaries, directory '/apps/plexmediaserver' not empty so not removed

These appear to be the affected files:

lrwxrwxrwx 1 root root 41 Jan 22 14:14 config.xml -> /apps/plexmediaserver/Binaries/config.xml
lrwxrwxrwx 1 root root 60 Jan 22 14:14 fvapp-plexmediaserver.service -> /apps/plexmediaserver/Binaries/fvapp-plexmediaserver.service
lrwxrwxrwx 1 root root 39 Jan 22 14:14 logo.png -> /apps/plexmediaserver/Binaries/logo.png
lrwxrwxrwx 1 root root 58 Jan 22 14:14 plexmediaserver_environment -> /apps/plexmediaserver/Binaries/plexmediaserver_environment
lrwxrwxrwx 1 root root 43 Jan 22 14:14 pre-start.sh -> /apps/plexmediaserver/Binaries/pre-start.sh
lrwxrwxrwx 1 root root 39 Jan 22 14:14 start.sh -> /apps/plexmediaserver/Binaries/start.sh

Even after the package is completely removed (dpkg --purge ...) and I rm -rf the dangling app folder, installing gives this...

# rm -rf /apps/plexmediaserver/

dpkg -i plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.2

Selecting previously unselected package plexmediaserver-ros6-binaries.
(Reading database … 12931 files and directories currently installed.)
Unpacking plexmediaserver-ros6-binaries (from plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.2) …
Setting up plexmediaserver-ros6-binaries (0.9.9.0.308-7e8496a) …
Leaving ‘diversion of /apps/plexmediaserver/config.xml to /apps/plexmediaserver/config.xml.orig by plexmediaserver-ros6-binaries’
Leaving ‘diversion of /apps/plexmediaserver/plexmediaserver_environment to /apps/plexmediaserver/plexmediaserver_environment.orig by plexmediaserver-ros6-binaries’
Leaving ‘diversion of /apps/plexmediaserver/pre-start.sh to /apps/plexmediaserver/pre-start.sh.orig by plexmediaserver-ros6-binaries’
Leaving ‘diversion of /apps/plexmediaserver/start.sh to /apps/plexmediaserver/start.sh.orig by plexmediaserver-ros6-binaries’
Leaving ‘diversion of /apps/plexmediaserver/fvapp-plexmediaserver.service to /apps/plexmediaserver/fvapp-plexmediaserver.service.orig by plexmediaserver-ros6-binaries’
Leaving ‘diversion of /apps/plexmediaserver/logo.png to /apps/plexmediaserver/logo.png.orig by plexmediaserver-ros6-binaries’
cp: /apps/plexmediaserver/Binaries/config.xml' and/apps/plexmediaserver/config.xml’ are the same file
dpkg: error processing plexmediaserver-ros6-binaries (–install):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
plexmediaserver-ros6-binaries

So still trying to unravel why it won't start... but there are still some things that might need tweaking. ;)

UPDATE: This result is confirmed even after addressing the 0.9.8.18 fresh install behavior. Note especially that the fvapp-plexmediaserver.service symlink goes to Binaries, where no such file exists.

Oh, OK... well now at least I can figure out why it isn't launching... a service definition for the app isn't getting added:

# systemctl | grep fvapp
fvapp-automatic.service   loaded active running       Service for automatic
fvapp-dv...server.service loaded active running       DVBLink TV Server
fvapp-tr...sionr6.service loaded active running       Service for transmission

Um... oops?

lrwxrwxrwx 1 root  root    60 Jan 22 14:19 fvapp-plexmediaserver.service -> /apps/plexmediaserver/Binaries/fvapp-plexmediaserver.service
 

But there is no such file in Binaries folder. Not in the archive, and not in the actual directory once dpkg is finished. Either something is missing or something failed during install that resulted in no such file... :(

Hmm. So, the issue DEFINITELY was that the fvapp-plexmediaserver.service unit wasn't being added properly. Though it isn't directly targeted at testing this bundle, perhaps it will go to helping isolate what was causing the problem... either on install or remove side i'm not entirely sure.

I began by reinstalling 0.9.8.18 (both ros6 and ros6-binaries), and found that several .orig files had no link to the base filename, including the fvapp*service file. :( So first I addressed that. Whatever caused that may have interrupted the service setup. So I had to link the service file to /lib/systemd/system/ and /etc/systemd/system/multi-user.target.wants/. Finally, systemctl reload and systemctl start fvapp-plexmediaserver.service

Interestingly, if I stopped at the reload and tried to start from the Frontview UI, it still failed. I had to kick it using systemctl start to get it running. and then it fired right up.

UPDATE: The exact commands I used, from no PLEX install to working 0.9.8.18 (using pair of packages) was:

# dpkg -i /plex*0.9.8.18*deb

ln -s /MediaLibrary /apps/plexmediaserver/

#cd /apps/plexmediaserver

ln -s fvapp-plexmediaserver.service.orig fvapp-plexmediaserver.service

ln -s logo.png.orig logo.png

ln -s pre-start.sh.orig pre-start.sh

find /lib/systemd/ /etc/systemd/ -name ‘plexm’ -print

[[ none found! Wasn’t set up… ]]

ln -s /apps/plexmediaserver/fvapp-plexmediaserver.service /lib/systemd/system/

ln -s /apps/plexmediaserver/fvapp-plexmediaserver.service /etc/systemd/system/multi-user.target.wants/

systemctl daemon-reload

find /lib/systemd/ /etc/systemd/ -name ‘plexm’ -print

/lib/systemd/system/fvapp-plexmediaserver.service
/etc/systemd/system/multi-user.target.wants/fvapp-plexmediaserver.service

systemctl status fvapp-plexmediaserver

fvapp-plexmediaserver.service - Plex Media Server
Loaded: loaded (/apps/plexmediaserver/fvapp-plexmediaserver.service.orig)
Active: inactive (dead)
CGroup: name=systemd:/system/fvapp-plexmediaserver.service

systemctl start fvapp-plexmediaserver

OK. Once I had the 0.9.8.18 happy, applying this new 0.9.9.0 bundle on top of that seems to have gone OK. I wonder though... have you tried this bundle to do a completely fresh install? I may make another swipe at that myself, given that I know how to address the issue that cropped up now.

Scratch that. Wasn't paying attention. It didn't apply. 0.9.8.18 remained. Running dpkg via ssh explains why.

# dpkg -i plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.2

dpkg: considering removing plexmediaserver-ros6 in favour of plexmediaserver-ros6-binaries …
dpkg: no, cannot proceed with removal of plexmediaserver-ros6 (–auto-deconfigure will help):
plexmediaserver-ros6-binaries depends on plexmediaserver-ros6
plexmediaserver-ros6 is to be removed.

dpkg: regarding plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.2 containing plexmediaserver-ros6-binaries:
plexmediaserver-ros6-binaries conflicts with plexmediaserver-ros6
plexmediaserver-ros6 (version 0.9.8.18.290-11b7fdd) is present and installed.

dpkg: error processing plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.2 (–install):
conflicting packages - not installing plexmediaserver-ros6-binaries
Errors were encountered while processing:
plexmediaserver-ros6-binaries_0.9.9.0.308-7e8496a_amd64.deb.2

I have the same problem. Any fix for this ? 

I have the same problem. Any fix for this ?


Good reporting. Really appreciate that a lot.

I'll have a dig into the package again. And will do some 0.9.8.18 -> 0.9.9.0 testing. I have been doing it from earlier releases. I'm trying to get the packaging right, and I might need to add some commands to the postrm script.

What I have seen while doing some of the testing is that the fvapp-plexmediaserver.service didn't get added to /lib/systemd/system. But I think I have a fix for that.

Will update the package shortly. So to get back to normal do:

dpkg --purge plexmediaserver-ros6-binaries

Then:

rm -rf /apps/plexmediaserver ; dpkg -i

- Mark

So to get back to normal do:

dpkg --purge plexmediaserver-ros6-binaries

Then:

rm -rf /apps/plexmediaserver ; dpkg -i

- Mark

Well, sadly, that wasn't working for me... not with this new 0.9.9.0 package (see reply #9, where I tried it a few times) nor with 0.9.8.18 (see #12, which has notes on the manual steps I had to take to get it working). It occurred to me that I've basically been doing up/down-grades ever since installing the PLEX app included with ROS6 distribution. This is the first time on ROS6 where I've tried installing the package directly with no previous remnants available...

Well, sadly, that wasn't working for me... not with this new 0.9.9.0 package (see reply #9, where I tried it a few times) nor with 0.9.8.18 (see #12, which has notes on the manual steps I had to take to get it working). It occurred to me that I've basically been doing up/down-grades ever since installing the PLEX app included with ROS6 distribution. This is the first time on ROS6 where I've tried installing the package directly with no previous remnants available...


I have a very good idea of whats going on, and doing some more changes to the package. I have a working package that gets around you earlier error. I have one last hurdle to pass. And its getting the package to be removable without giving an error and leaving part of it behind. So have no fear, help is on the way.

I have a very good idea of whats going on, and doing some more changes to the package. I have a working package that gets around you earlier error. I have one last hurdle to pass. And its getting the package to be removable without giving an error and leaving part of it behind. So have no fear, help is on the way.


I'll have to get it up tomorrow. To late here now. Sit tight.

- Mark

Appreciate your efforts! :D Sleep well...

So. Fixed the package. It now overwrites the 0.9.8.18 build or earlier. And it works and can be uninstalled.

Please give it a go. This time I’m more confident. Same link as in top thread.

- Mark