Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Sonarr: fixes for services and package modernisation #5515

Merged
merged 2 commits into from
Dec 16, 2022

Conversation

mreid-tt
Copy link
Contributor

@mreid-tt mreid-tt commented Dec 9, 2022

Description

This replaces #5511 which built on the work from #5485 to address a number of issues in Sonarr as discussed in #5471 (comment) and summarised below:

  1. Update package name to 'Sonarr v3'
  2. Upgrade to Sonarr 3.0.9.1549
  3. Avoid Sonarr downgrade on package update
  4. Fix usage of TMPDIR and remove obsolete folders
  5. Remove support for legacy (v2) versions

Fixes #5450, Closes #5471

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Bug fix
  • Package update
  • includes a small framework change: include the STATUS (i.e. INSTALL, UPGRADE, UNINSTALL) in the installer log line created for each step

@mreid-tt
Copy link
Contributor Author

mreid-tt commented Dec 9, 2022

Hey @hgy59, continuing the conversation here:

Your can create a branch at the latest commit that is in sync with the upstream master.
Then cherry pick all your commits on your master branch related to this PR
and finally reset your master to the latests commit of upstream master.

All done!

@mreid-tt please can you test the Lidarr approach with sonarr? unfortunately the update_required file is not deleted in Lidarr when updating with the current version of #5514 😖

I've implemented the concept in this new PR and the upgrade did in fact retain the existing config.xml post-upgrade. The detailed log from /var/log/packages/nzbdrone.log is captured here: https://pastebin.com/kgGH5C9L

One thing I noted however when searching for 'config.xml' files following a complete uninstall of Sonarr is that there were still some present here:

~$ sudo find / -name config.xml
/tmp/sonarr_backup/config.xml
/tmp/sonarr_update/sonarr_appdata_backup/config.xml

The backup folder does seem to be in the wrong place for a DSM7 deployment, what do you think may be causing this? Here's the detailed uninstall log in case it will help: https://pastebin.com/XrPiU8X7

define a validate_preinst function in service-setup.sh in this function evaluate the installed version for version 2.x output and error text with echo and finally call exit 1 otherwise do nothing.

I've included this in the PR, do let me know if the implementation is okay.

@hgy59
Copy link
Contributor

hgy59 commented Dec 13, 2022

One thing I noted however when searching for 'config.xml' files following a complete uninstall of Sonarr is that there were still some present here:

~$ sudo find / -name config.xml
/tmp/sonarr_backup/config.xml
/tmp/sonarr_update/sonarr_appdata_backup/config.xml

@mreid-tt

This might be fixed with USE_ALTERNATE_TMPDIR = 1
If the package regards the TMPDIR variable of the environment, then it will not use /tmp folder.
On DSM 7, it will use /volume{n}/@apptemp/{packagename} instead
On DSM <7, it will use /var/packages/{packagename}/tmp that our generic installer will create on installation and remove on uninstall.

So we have to validate, whether sonarr is using the TMPDIR variable or we must use another variable...

@hgy59
Copy link
Contributor

hgy59 commented Dec 13, 2022

@mreid-tt TODO update spk/sonarr3/Makefile to depend on cross/sonarr3 (not cross/sonarr)

@mreid-tt
Copy link
Contributor Author

mreid-tt commented Dec 13, 2022

@mreid-tt This might be fixed with USE_ALTERNATE_TMPDIR = 1 If the package regards the TMPDIR variable of the environment, then it will not use /tmp folder. On DSM 7, it will use /volume{n}/@apptemp/{packagename} instead On DSM <7, it will use /var/packages/{packagename}/tmp that our generic installer will create on installation and remove on uninstall.

I believe the code is already there:

USE_ALTERNATE_TMPDIR = 1

So we have to validate, whether sonarr is using the TMPDIR variable or we must use another variable...

I've checked all the files in cross/sonarr3 and spk/sonarr3 and I can't seem to find a declaration for TMPDIR. What am I missing?

@mreid-tt TODO update spk/sonarr3/Makefile to depend on cross/sonarr3 (not cross/sonarr)

Thanks, saw the build error and fixed this too.

@hgy59
Copy link
Contributor

hgy59 commented Dec 13, 2022

I've checked all the files in cross/sonarr3 and spk/sonarr3 and I can't seem to find a declaration for TMPDIR. What am I missing?

It is missing (should be defined in installed script/service-setup)
You must define USE_ALTERNATE_TMPDIR = 1 in Makefile above the line include ../../mk/spksrc.spk.mk

@hgy59
Copy link
Contributor

hgy59 commented Dec 13, 2022

@mreid-tt Sonarr Status of v3.0.9.1549 shows an error:
Currently installed Mono version 5.8.0.108 is no longer supported. Please upgrade Mono to version 5.20.

If the mono certificate issues are solved, we should update the SPK_DEPENDS at least to mono>=5.20.

@hgy59
Copy link
Contributor

hgy59 commented Dec 13, 2022

@mreid-tt I can confirm, that on DSM 6 with ALTERNATE_TMPDIR fixed, sonarr creates the backup in the folder

/var/packages/nzbdrone/target/tmp/sonarr_backup

EDIT:
This folder is used while creating the backup. The created backups are store in .config/Sonarr/Backups as zip files. For manual backups a subfolder named manual is used. I suppose that for scheduled backups a different sub-folder is used.
The backup folder Backups is defined by default. Any other (relative) folder under .config/Sonarr or an absolute path can be configured.

@hgy59 hgy59 mentioned this pull request Dec 13, 2022
10 tasks
@hgy59

This comment was marked as off-topic.

@mreid-tt mreid-tt changed the title Sonarr: fixes for service start, package downgrade & new installs Sonarr: fixes for services and package modernisation Dec 13, 2022
@hgy59
Copy link
Contributor

hgy59 commented Dec 13, 2022

@mreid-tt I updated the display name to "Sonarr v3". Hopefully this clarifies that it is independent of the folders named sonarr3.

BTW we could use the display name "Sonarr v4" in #5520.

spk/sonarr3/Makefile Outdated Show resolved Hide resolved
@mreid-tt
Copy link
Contributor Author

BTW we could use the display name "Sonarr v4" in #5520.

Will do.

@mreid-tt
Copy link
Contributor Author

@hgy59, any further changes before this is merged and published?

spk/sonarr3/src/config.xml Outdated Show resolved Hide resolved
@hgy59
Copy link
Contributor

hgy59 commented Dec 16, 2022

@hgy59, any further changes before this is merged and published?

added two minor proposals (none of them touches the functionality of this package)

1. Update package name to 'Sonarr v3'
2. Upgrade to Sonarr 3.0.9.1549
3. Avoid Sonarr downgrade on package update
4. Fix usage of TMPDIR and remove obsolete folders
5. Remove support for legacy (v2) versions

Co-Authored-By: hgy59 <12009964+hgy59@users.noreply.github.com>
@mreid-tt
Copy link
Contributor Author

added two minor proposals (none of them touches the functionality of this package)

Nice! I've squashed all the Sonarr changes together as one and I've left the explicit framework change separate for visibility. Let me know if you need anything else.

@hgy59 hgy59 merged commit 0db037c into SynoCommunity:master Dec 16, 2022
@mreid-tt mreid-tt deleted the sonarr-pkg-update branch December 16, 2022 17:03
@hgy59 hgy59 added the status/published Published and activated (may take up to 48h until visible in DSM package manager) label Dec 16, 2022
@mreid-tt mreid-tt mentioned this pull request Feb 18, 2023
6 tasks
@mreid-tt mreid-tt self-assigned this Apr 24, 2023
AlexPresso pushed a commit to AlexPresso/spksrc that referenced this pull request Jan 30, 2025
)

* framework: add STATUS to log_step for package installer logs

* Sonarr: fixes for services and package modernisation

1. Update package name to 'Sonarr v3'
2. Upgrade to Sonarr 3.0.9.1549
3. Avoid Sonarr downgrade on package update
4. Fix usage of TMPDIR and remove obsolete folders
5. Remove support for legacy (v2) versions

Co-Authored-By: hgy59 <12009964+hgy59@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
status/published Published and activated (may take up to 48h until visible in DSM package manager)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sonarr uninstall not removing 'appdata' when erasing all data files
2 participants