[QPKG] SortMyQPKGs

This is the best place for community developers to publish their genius work. Your Apps enrich the QNAP Turbo NAS.
Post Reply
User avatar
OneCD
Guru
Posts: 12010
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

[QPKG] SortMyQPKGs

Post by OneCD »

Image

Description

SortMyQPKGs is an automated sorter for installed QPKGs to ensure they launch in correct sequence when your NAS next powers-up.

There are a few known packages that need to launch sequentially (example: Qmono before QSonarr) but due to flaws in QNAP's package registration process, this may not occur.

This package will automatically ensure the launch-order of your other QPKGs is correct.

Every QPKG will fit into one of three possible groups:
  1. ALPHA - must be launched before other packages, and in a specific order (these are high-level apps like command interpreters, virtual environments and the like),
  2. UNSPECIFIED - the majority of QPKGs out there that are not explicitly named, but should be launched after ALPHA and before OMEGA packages,
  3. OMEGA - packages that should be launched after everything else, and in a specific order. These are generally dependent on some other package.
This package ships with default lists that should help most people resolve startup issues. But custom user lists are also supported. If you find a new package you think should be added to the default lists, please advise of the internal package name(s), why they should be placed where you say, and how you have tested them. Only packages that must be placed correctly should be requested.

This package was initially suggested by @father_mande & @zyxmon in this thread, and is thanks to the research efforts of @zyxmon, @father_mande, myself and many other QNAP community members. Thank you to all who have contributed with feedback and suggestions.


Installation
  • available in the MyQNAP repo, and can also be installed via the sherpa package manager.

Notes
  • When the sorter is installed, there's not much to see. Find the package icon and click the 'Open' button to display the current log file - any changes made to your package order will be shown here. Sorting is automatically performed during each NAS shutdown. No need to run it manually.
  • The log is viewable via your web browser but is not a real web document, so it can change without your browser noticing. Whenever viewing the log, ensure you force a page refresh: CTRL+F5.
  • The current internal order preference list can be viewed with:

    Code: Select all

    /etc/init.d/sortmyqpkgs.sh pref
  • The source for this project can be found on GitHub.
Last edited by OneCD on Wed Feb 10, 2021 5:50 am, edited 52 times in total.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
User avatar
peelos
Been there, done that
Posts: 580
Joined: Sun Jun 26, 2016 9:28 pm

Re: [SCRIPT] sort-my-qpkgs

Post by peelos »

Awesome, many thanks for that OneCD, going to try it out later.

Would be great if you could add these to the end:

Ombi
PlexPy
Jackett
QJDK 8
Openhab
Nginx
NAS: TVS-1282-i7-7700-40G / 4 x 500GB SSD 2.5" RAID 10 / 2 x 500GB M.2 SSD / 8 x 12TB WD Whites 3.5" RAID 6 / Noctua L9x65 / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU
Software: Plex Media Server / Transmission / Sonarr / Radarr / Bazarr / Jackett / Tautulli / Home Assistant / Resilio Sync / Python / NetData / SortMyQPKGs
pfSense Firewall / OpenVPN Server: QOTOM Fanless Mini PC / Core i5 / 8GB RAM / 128GB SSD / 4 Gigabit NICs / AES-NI
Wireless Routers: 2 x Netgear AC1900 R7000 Nighthawk / 1 x Netgear AC3200 R8000 Nighthawk / FreshTomato Firmware
User avatar
OneCD
Guru
Posts: 12010
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: [SCRIPT] sort-my-qpkgs

Post by OneCD »

Thanks @peelos. :D

Can you please confirm the dependency of PlexPy? Will this require Plex first?

And are you using QNginx or the QNAP App Center Nginx? I need the exact (internal) package name for sorting. ;)

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
User avatar
peelos
Been there, done that
Posts: 580
Joined: Sun Jun 26, 2016 9:28 pm

Re: RE: Re: [SCRIPT] sort-my-qpkgs

Post by peelos »

OneCD wrote:Thanks @peelos. :D

Can you please confirm the dependency of PlexPy? Will this require Plex first?

And are you using QNginx or the QNAP App Center Nginx? I need the exact (internal) package name for sorting. ;)
Ah of course, Plex should be before PlexPy I presume.

I am using QNginx from the qnapclub.eu appstore.

Thanks a lot..
NAS: TVS-1282-i7-7700-40G / 4 x 500GB SSD 2.5" RAID 10 / 2 x 500GB M.2 SSD / 8 x 12TB WD Whites 3.5" RAID 6 / Noctua L9x65 / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU
Software: Plex Media Server / Transmission / Sonarr / Radarr / Bazarr / Jackett / Tautulli / Home Assistant / Resilio Sync / Python / NetData / SortMyQPKGs
pfSense Firewall / OpenVPN Server: QOTOM Fanless Mini PC / Core i5 / 8GB RAM / 128GB SSD / 4 Gigabit NICs / AES-NI
Wireless Routers: 2 x Netgear AC1900 R7000 Nighthawk / 1 x Netgear AC3200 R8000 Nighthawk / FreshTomato Firmware
giopas
Been there, done that
Posts: 855
Joined: Thu Mar 26, 2015 12:36 am
Location: somewhere in EU

Re: [SCRIPT] sort-my-qpkgs

Post by giopas »

What is couchpotato2? I know Couchpotato, but do not know v2...

Sent from my A0001 using Tapatalk
Qnap TS-253Pro 16Gb RAM - Single Storage Pool: 2 WRed 4TB (RAID 1)
Qnap TS-453A 16Gb RAM - Single Storage Pool: 4 WRed 4TB (RAID 5)
User avatar
OneCD
Guru
Posts: 12010
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: RE: Re: [SCRIPT] sort-my-qpkgs

Post by OneCD »

peelos wrote:Ah of course, Plex should be before PlexPy I presume.

I am using QNginx from the qnapclub.eu appstore.
Done! :)
giopas wrote:What is couchpotato2? I know Couchpotato, but do not know v2...
It's also called CouchPotatoServer, whereas the original was called CouchPotato. It got a different name when the whole interface changed some time ago. It was called CouchPotato2 when the QPKG was released to separate it from the original (presumably by @sl1000 - I guess it helped to use a shorter package name), and it wasn't possible to upgrade an existing v1 installation. By giving the package a different name, both QPKGs could be installed at the same time to allow the movie lists to be manually re-entered into the new version.

But I think - technically - CP is somewhere in the region of v3.x by now. As it's unlikely anyone is still using the original CP, we can probably ditch the '2' on the name.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
User avatar
Trexx
Ask me anything
Posts: 5393
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: [SCRIPT] sort-my-qpkgs

Post by Trexx »

Thanks OneCD for your work on this. I will give it a try on a couple different boxes and give you any issues/feedback that I find. You may want to also add language packages (Python/Perl/etc.) to the front list (if they aren't already there) to go with Entware/Mono/etc.
Paul

Model: TS-877-1600 FW: 4.5.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x1TB SK Hynix Gold
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
UPS: CP AVR1350

Model:TVS-673 32GB & TS-228a Offline[/color]
-----------------------------------------------------------------------------------------------------------------------------------------
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq
User avatar
OneCD
Guru
Posts: 12010
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: [SCRIPT] sort-my-qpkgs

Post by OneCD »

Good idea Paul, I'll add those later today. :)

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
User avatar
dirkonline
Easy as a breeze
Posts: 305
Joined: Mon Oct 18, 2010 4:08 pm

Re: [SCRIPT] sort-my-qpkgs

Post by dirkonline »

Seems to work like a charm! Thank you. How about including a switch to show the current order without doing a resort? :)
User avatar
OneCD
Guru
Posts: 12010
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: [SCRIPT] sort-my-qpkgs

Post by OneCD »

and ... done! The default action now is to display the current QPKG list. To perform re-sorting, use '--fix'. ;)

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
User avatar
dirkonline
Easy as a breeze
Posts: 305
Joined: Mon Oct 18, 2010 4:08 pm

Re: [SCRIPT] sort-my-qpkgs

Post by dirkonline »

OneCD wrote:and ... done! The default action now is to display the current QPKG list. To perform re-sorting, use '--fix'. ;)
Excellent, thank you :)
User avatar
Trexx
Ask me anything
Posts: 5393
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: [SCRIPT] sort-my-qpkgs

Post by Trexx »

You may want to think about the following changes (all names are the Package names):

Alpha Adds: JRE QGIT QPerl
Omega Adds: SurveillanceStation (due to long startup time) QNZBGet QSonarr Radarr
Last edited by Trexx on Sat Jun 03, 2017 11:47 pm, edited 1 time in total.
Paul

Model: TS-877-1600 FW: 4.5.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x1TB SK Hynix Gold
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
UPS: CP AVR1350

Model:TVS-673 32GB & TS-228a Offline[/color]
-----------------------------------------------------------------------------------------------------------------------------------------
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq
User avatar
Trexx
Ask me anything
Posts: 5393
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: [SCRIPT] sort-my-qpkgs

Post by Trexx »

OneCD wrote:Thanks @peelos. :D

Can you please confirm the dependency of PlexPy? Will this require Plex first?
PlexPy has Python dependency for Language, and Plex dependency for data.
Paul

Model: TS-877-1600 FW: 4.5.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x1TB SK Hynix Gold
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
UPS: CP AVR1350

Model:TVS-673 32GB & TS-228a Offline[/color]
-----------------------------------------------------------------------------------------------------------------------------------------
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq
User avatar
OneCD
Guru
Posts: 12010
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: [SCRIPT] sort-my-qpkgs

Post by OneCD »

Trexx wrote:Alpha Adds: JRE QGIT QPerl
Omega Adds: SurveillanceStation (due to long startup time) QNZBGet QSonarr Radarr
Thanks Paul. I've added those now. Current list is:
* Preferred QPKG order *
(01) (A) update_qpkg_conf
(02) (A) DownloadStation
(03) (A) Python
(04) (A) QPython2
(05) (A) Python3
(06) (A) QPython3
(07) (A) Perl
(08) (A) QPerl
(09) (A) Optware
(10) (A) Entware-ng
(11) (A) Entware-3x
(12) (A) QGit
(13) (A) Mono
(14) (A) Qmono
(15) (A) nodejs
(16) (A) nodejsv4
(17) (A) JRE
(18) (A) QJDK7
(19) (A) QJDK8
(20) (A) Qapache
(21) (A) Tomcat
(22) (A) Tomcat8
(23) (A) ruby
(24) (A) Plex

(25) (Φ) existing unspecified QPKGs go here

(26) (Ω) Par2cmdline-MT
(27) (Ω) QNZBGet
(28) (Ω) QSonarr
(29) (Ω) Radarr
(30) (Ω) SABnzbdplus
(31) (Ω) SickBeard
(32) (Ω) SickBeard-TVRage
(33) (Ω) SickRage
(34) (Ω) SurveillanceStation
Does that look correct?
Trexx wrote:PlexPy has Python dependency for Language, and Plex dependency for data.
I moved Plex into the ALPHA list, so PlexPy shouldn't need to be specified. It will therefore be somewhere in the group of unspecified packages (at the 25th ordinal above). Unless this is wrong? Please advise (I don't use Plex).

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
User avatar
Trexx
Ask me anything
Posts: 5393
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: [SCRIPT] sort-my-qpkgs

Post by Trexx »

Looks good to me.
Paul

Model: TS-877-1600 FW: 4.5.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x1TB SK Hynix Gold
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
UPS: CP AVR1350

Model:TVS-673 32GB & TS-228a Offline[/color]
-----------------------------------------------------------------------------------------------------------------------------------------
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq
Post Reply

Return to “Community Apps”