Page 1 of 17

[QPKG] SortMyQPKGs

Posted: Thu Jun 01, 2017 9:11 am
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.

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 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 - not when you view the log.
  • 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

Re: [SCRIPT] sort-my-qpkgs

Posted: Thu Jun 01, 2017 12:49 pm
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

Re: [SCRIPT] sort-my-qpkgs

Posted: Thu Jun 01, 2017 1:21 pm
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. ;)

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

Posted: Thu Jun 01, 2017 2:07 pm
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..

Re: [SCRIPT] sort-my-qpkgs

Posted: Thu Jun 01, 2017 2:08 pm
by giopas
What is couchpotato2? I know Couchpotato, but do not know v2...

Sent from my A0001 using Tapatalk

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

Posted: Thu Jun 01, 2017 2:32 pm
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.

Re: [SCRIPT] sort-my-qpkgs

Posted: Fri Jun 02, 2017 3:21 am
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.

Re: [SCRIPT] sort-my-qpkgs

Posted: Fri Jun 02, 2017 3:36 am
by OneCD
Good idea Paul, I'll add those later today. :)

Re: [SCRIPT] sort-my-qpkgs

Posted: Sat Jun 03, 2017 3:19 pm
by dirkonline
Seems to work like a charm! Thank you. How about including a switch to show the current order without doing a resort? :)

Re: [SCRIPT] sort-my-qpkgs

Posted: Sat Jun 03, 2017 4:23 pm
by OneCD
and ... done! The default action now is to display the current QPKG list. To perform re-sorting, use '--fix'. ;)

Re: [SCRIPT] sort-my-qpkgs

Posted: Sat Jun 03, 2017 7:35 pm
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 :)

Re: [SCRIPT] sort-my-qpkgs

Posted: Sat Jun 03, 2017 11:27 pm
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

Re: [SCRIPT] sort-my-qpkgs

Posted: Sat Jun 03, 2017 11:44 pm
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.

Re: [SCRIPT] sort-my-qpkgs

Posted: Sun Jun 04, 2017 1:38 am
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).

Re: [SCRIPT] sort-my-qpkgs

Posted: Sun Jun 04, 2017 3:52 am
by Trexx
Looks good to me.