[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
Ask me anything
Posts: 6066
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

[QPKG] SortMyQPKGs

Post by OneCD » Thu Jun 01, 2017 9:11 am

Image

Description

SortMyQPKGs is a sorter for your installed QPKGs to ensure they launch in a preset order when your NAS next boots-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 ensure the launch-order of these QPKGs is corrected automatically.

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 is shipped with default lists that are meant to help most people resolve package startup issues. But custom user lists are also supported. If you find new packages 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.

How to install
  • It’s available in the Qnapclub Store!
  • Click here to find out how to add the Qnapclub Store as an App Center repository in QTS.
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/sort-my-qpkgs.sh pref
  • The source for this project can be found on GitHub.
  • Changelog
Last edited by OneCD on Thu Nov 15, 2018 10:59 am, edited 50 times in total.

production NAS: TS-569 Pro with Debian 9.9 'Stretch' (power on/off times are < 1 minute)
backup NAS: TS-559 Pro+ with QTS 4.2.6 #20190629

one.cd.only@gmail.com

Image Image Image Image

User avatar
peelos
Easy as a breeze
Posts: 415
Joined: Sun Jun 26, 2016 9:28 pm

Re: [SCRIPT] sort-my-qpkgs

Post by peelos » Thu Jun 01, 2017 12:49 pm

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
TVS-1282-i7K-40G / 4 x 500Gb SSD 2.5" / 2 x 500Gb M.2 SSD / 8 x 4Tb WD Red / Corsiar H5-SF Watercooling / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU

User avatar
OneCD
Ask me anything
Posts: 6066
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: [SCRIPT] sort-my-qpkgs

Post by OneCD » Thu Jun 01, 2017 1:21 pm

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. ;)

production NAS: TS-569 Pro with Debian 9.9 'Stretch' (power on/off times are < 1 minute)
backup NAS: TS-559 Pro+ with QTS 4.2.6 #20190629

one.cd.only@gmail.com

Image Image Image Image

User avatar
peelos
Easy as a breeze
Posts: 415
Joined: Sun Jun 26, 2016 9:28 pm

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

Post by peelos » Thu Jun 01, 2017 2:07 pm

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..
TVS-1282-i7K-40G / 4 x 500Gb SSD 2.5" / 2 x 500Gb M.2 SSD / 8 x 4Tb WD Red / Corsiar H5-SF Watercooling / 3 x 80mm PWM Noctua fans / Corsair 600W PSU / Asus Turbo GTX 1060 6GB GPU

giopas
Been there, done that
Posts: 840
Joined: Thu Mar 26, 2015 12:36 am
Location: somewhere in EU

Re: [SCRIPT] sort-my-qpkgs

Post by giopas » Thu Jun 01, 2017 2:08 pm

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
Ask me anything
Posts: 6066
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

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

Post by OneCD » Thu Jun 01, 2017 2:32 pm

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.

production NAS: TS-569 Pro with Debian 9.9 'Stretch' (power on/off times are < 1 minute)
backup NAS: TS-559 Pro+ with QTS 4.2.6 #20190629

one.cd.only@gmail.com

Image Image Image Image

User avatar
Trexx
Experience counts
Posts: 4787
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota
Contact:

Re: [SCRIPT] sort-my-qpkgs

Post by Trexx » Fri Jun 02, 2017 3:21 am

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.3.6.x
QTier (HDD): [RAID-5] 6 x 3TB HGST DeskStar NAS QTier (SSD): [RAID-1] 2 x 525GB Crucial MX300 m.2's
(SSD): [RAID-1] 2 x 500GB Evo 860
RAM: Kingston HyperX Fury 32GB Kit DDR4-2666
GPU: EVGA GTX 1060, ACX 2.0(1 Fan), 6GB
UPS: CyberPower AVR1350 Ext. Backup: USB 3.0 Seagate 5TB
Media Boxes: Nvidia ShieldTV Pro, AppleTV 4, Roku Stick

Model: TVS-673 32GB FW: 4.3.6.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

User avatar
OneCD
Ask me anything
Posts: 6066
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: [SCRIPT] sort-my-qpkgs

Post by OneCD » Fri Jun 02, 2017 3:36 am

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

production NAS: TS-569 Pro with Debian 9.9 'Stretch' (power on/off times are < 1 minute)
backup NAS: TS-559 Pro+ with QTS 4.2.6 #20190629

one.cd.only@gmail.com

Image Image Image Image

User avatar
dirkonline
Know my way around
Posts: 217
Joined: Mon Oct 18, 2010 4:08 pm

Re: [SCRIPT] sort-my-qpkgs

Post by dirkonline » Sat Jun 03, 2017 3:19 pm

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
Ask me anything
Posts: 6066
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: [SCRIPT] sort-my-qpkgs

Post by OneCD » Sat Jun 03, 2017 4:23 pm

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

production NAS: TS-569 Pro with Debian 9.9 'Stretch' (power on/off times are < 1 minute)
backup NAS: TS-559 Pro+ with QTS 4.2.6 #20190629

one.cd.only@gmail.com

Image Image Image Image

User avatar
dirkonline
Know my way around
Posts: 217
Joined: Mon Oct 18, 2010 4:08 pm

Re: [SCRIPT] sort-my-qpkgs

Post by dirkonline » Sat Jun 03, 2017 7:35 pm

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
Experience counts
Posts: 4787
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota
Contact:

Re: [SCRIPT] sort-my-qpkgs

Post by Trexx » Sat Jun 03, 2017 11:27 pm

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.3.6.x
QTier (HDD): [RAID-5] 6 x 3TB HGST DeskStar NAS QTier (SSD): [RAID-1] 2 x 525GB Crucial MX300 m.2's
(SSD): [RAID-1] 2 x 500GB Evo 860
RAM: Kingston HyperX Fury 32GB Kit DDR4-2666
GPU: EVGA GTX 1060, ACX 2.0(1 Fan), 6GB
UPS: CyberPower AVR1350 Ext. Backup: USB 3.0 Seagate 5TB
Media Boxes: Nvidia ShieldTV Pro, AppleTV 4, Roku Stick

Model: TVS-673 32GB FW: 4.3.6.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

User avatar
Trexx
Experience counts
Posts: 4787
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota
Contact:

Re: [SCRIPT] sort-my-qpkgs

Post by Trexx » Sat Jun 03, 2017 11:44 pm

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.3.6.x
QTier (HDD): [RAID-5] 6 x 3TB HGST DeskStar NAS QTier (SSD): [RAID-1] 2 x 525GB Crucial MX300 m.2's
(SSD): [RAID-1] 2 x 500GB Evo 860
RAM: Kingston HyperX Fury 32GB Kit DDR4-2666
GPU: EVGA GTX 1060, ACX 2.0(1 Fan), 6GB
UPS: CyberPower AVR1350 Ext. Backup: USB 3.0 Seagate 5TB
Media Boxes: Nvidia ShieldTV Pro, AppleTV 4, Roku Stick

Model: TVS-673 32GB FW: 4.3.6.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

User avatar
OneCD
Ask me anything
Posts: 6066
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: [SCRIPT] sort-my-qpkgs

Post by OneCD » Sun Jun 04, 2017 1:38 am

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).

production NAS: TS-569 Pro with Debian 9.9 'Stretch' (power on/off times are < 1 minute)
backup NAS: TS-559 Pro+ with QTS 4.2.6 #20190629

one.cd.only@gmail.com

Image Image Image Image

User avatar
Trexx
Experience counts
Posts: 4787
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota
Contact:

Re: [SCRIPT] sort-my-qpkgs

Post by Trexx » Sun Jun 04, 2017 3:52 am

Looks good to me.
Paul

Model: TS-877-1600 FW: 4.3.6.x
QTier (HDD): [RAID-5] 6 x 3TB HGST DeskStar NAS QTier (SSD): [RAID-1] 2 x 525GB Crucial MX300 m.2's
(SSD): [RAID-1] 2 x 500GB Evo 860
RAM: Kingston HyperX Fury 32GB Kit DDR4-2666
GPU: EVGA GTX 1060, ACX 2.0(1 Fan), 6GB
UPS: CyberPower AVR1350 Ext. Backup: USB 3.0 Seagate 5TB
Media Boxes: Nvidia ShieldTV Pro, AppleTV 4, Roku Stick

Model: TVS-673 32GB FW: 4.3.6.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

Post Reply

Return to “Community Apps”