Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update Jackett to v0.8.490 and to use generic DSM 5+6 services #3070

Merged
merged 1 commit into from
Jan 8, 2018

Conversation

m4tt075
Copy link
Contributor

@m4tt075 m4tt075 commented Jan 1, 2018

Motivation

Contains @kaso17 's Jackett updates and fixes of #3032 and adapts the package to use generic DSM 5+6 services

Linked issues

#3015, #2986, #2881, #1995, Jackett/Jackett#1985, Jackett/Jackett#2217

Notes

Checklist

  • Build rule all-supported completed successfully on XPE 5.2 and XPE 6.1 systems.
  • Package upgrade completed successfully
  • New installation of package completed successfully

@m4tt075 m4tt075 mentioned this pull request Jan 1, 2018
3 tasks
@m4tt075
Copy link
Contributor Author

m4tt075 commented Jan 1, 2018

@kaso17 As to your hints / notes in #3032:

  • I have tested the package on an XPE 5.2 and XPE 6.1 system. It installs and runs as far as I can judge. At least I can access the web interface in both cases.
  • User premissions for the share folder seem correct, because I could succesfully upgrade the package using the internal upgrade process on both systems.
  • I could not test a migration from a legacy installation as I don't have one, but would rely on the generic service scripts to reset user permissions correctly as this applies to all packages.
  • I could verify that all environment variables are set and used correctly.
  • The only piece I could not implement from your approach was the logging functionality as this is driven through the generic service scripts. As such, standard logging to var/jackett.log is used for now. It works to the extend that both DSM and jackett log into that file correctly. It can be accessed through the DSM web-UI. However, your (very nice) log rotation functionality is lost unfortunately. I don't know how much information is usually written to the logs, but if you foresee an issue here, please let me know.

Edit: I have cherry-picked your commits from PR #3032 . As soon as #3032 is merged, I will drop them from my PR here...

@kianrafiee
Copy link

kianrafiee commented Jan 1, 2018

newly installed jackett package for rtd1296 from @Safihre repo will not start. it was starting fine yesterday and updated. but now it wont start. not sure if there was a jackett update yesterday that broke it

@m4tt075
Copy link
Contributor Author

m4tt075 commented Jan 1, 2018

Not related to this PR or spksrc development. Therefore, please report this in the Issues section instead, either in one of the old threads or open a new one.

Copy link
Contributor

@ymartin59 ymartin59 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m4tt075 May you please review related issues I have listed and apply minor changes I proposed

MAINTAINER = SynoCommunity
DESCRIPTION = "Jackett works as a proxy server: it translates queries from apps into tracker-site-specific http queries, parses the html response, then sends results back to the requesting software. Jackett is a single repository of maintained indexer scraping & translation logic - removing the burden from other apps."
ADMIN_PORT = 9117
MAINTAINER = 'kaso17 (Jackett), m4tt075 (spksrc integration)'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if spkrepo will accept packages with such maintainer. As far as I understood/remember, it has to match a user account registered in registry


INSTALL_PREFIX = /usr/local/$(SPK_NAME)
# Admin link
ADMIN_PORT = $(SERVICE_PORT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it relevant to consider SERVICE_PORT as ADMIN_PORT ? Probably not, but I prefer to keep it for "backward compatibility"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, not sure I understand. Do you want me to remove the comment and the ADMIN_PORT definition or do you want me to keep it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends if link generated in package view is really usable (often http://ip:ADMIN_PORT/) whereas SERVICE_PORT is used to provide application link in app/config which allows finer settings like https and context path in url.
So if "admin link" in package view is not usable as-is, please remove it. If it works, let it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is usable and works correctly, so I kept it.

COMMAND="env HOME=${HOME_DIR} PATH=${PATH} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} --debug ${JACKETT} --PIDFile ${PID_FILE}"

if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 6 ]; then
su ${EFF_USER} -s /bin/sh -c "cd ${SYNOPKG_PKGDEST}; ${COMMAND}" >> ${LOG_FILE} 2>&1 &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really needed to change process working directory to SYNOPKG_PKGDEST ? (I did it on demoservice to browse files...)
I think HOME_DIR may be more relevant, and it is already done by su

HOME_DIR="${SYNOPKG_PKGDEST}/var"

echo "Starting Jackett as user ${EFF_USER}" >> ${LOG_FILE}
COMMAND="env HOME=${HOME_DIR} PATH=${PATH} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} --debug ${JACKETT} --PIDFile ${PID_FILE}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is --debug flag really relevant ?

fi
}

service_preinst ()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please discard all other hook functions with only logging... I only wrote them for demo, I consider them not relevant for a package

@m4tt075
Copy link
Contributor Author

m4tt075 commented Jan 1, 2018

@ymartin59 Thanks for your review. I have addressed your comments, except the ADMIN_PORT one (see my question above). Will drop and squash once #3032 and #3064 are merged.

@kaso17
Copy link

kaso17 commented Jan 2, 2018

@m4tt075 thank you for taking care of this.

EDIT: sorry, didn't see that you tested the update mechanism.

I don't see any obvious issues.

@m4tt075
Copy link
Contributor Author

m4tt075 commented Jan 2, 2018

@kaso17 All fine. Thanks for reviewing...

Copy link
Contributor

@ymartin59 ymartin59 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still some details but soon ready to go

if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 6 ]; then
su ${EFF_USER} -s /bin/sh -c "${COMMAND}" >> ${LOG_FILE} 2>&1 &
else
cd ${SYNOPKG_PKGDEST}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You removed "cd" in COMMAND for DSM 5 and so it should be removed here for DSM 6 too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.


INSTALL_PREFIX = /usr/local/$(SPK_NAME)
# Admin link
ADMIN_PORT = $(SERVICE_PORT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends if link generated in package view is really usable (often http://ip:ADMIN_PORT/) whereas SERVICE_PORT is used to provide application link in app/config which allows finer settings like https and context path in url.
So if "admin link" in package view is not usable as-is, please remove it. If it works, let it there.

@m4tt075
Copy link
Contributor Author

m4tt075 commented Jan 6, 2018

@ymartin59 I have addressed your latest comments. Anything else?

@m4tt075 m4tt075 changed the title [WIP] Update Jackett to use generic DSM 5+6 services Update Jackett to use generic DSM 5+6 services Jan 6, 2018
@ward0
Copy link

ward0 commented Jan 8, 2018

When can we see an update pls? @m4tt075

@m4tt075 m4tt075 changed the title Update Jackett to use generic DSM 5+6 services Update Jackett to v0.8.490 and to use generic DSM 5+6 services Jan 8, 2018
@m4tt075
Copy link
Contributor Author

m4tt075 commented Jan 8, 2018

@ymartin59 @kaso17 Following up with your recent comments in #3032, I have...

  • rebased
  • squashed all commits (including @kaso17 's) into one
  • Adapted the PR title
  • Adapted the PR description to keep the linked issues from @kaso17 's PR description
  • Re-compiled Jackett for bromolow architecture 5.2 and 6.1, just to make sure
  • Successfully upgraded the package on XPE 6.1 within the package manager and then again, using Jackett's internal upgrading process
  • Successfully installed the package on XPE 5.2 and upgraded it using Jackett's internal upgrading process

Should be ready to go now...

@ymartin59
Copy link
Contributor

Marvelous. Merging.
By the way, online repository rejects mono 5.4 package for x64... so it may not be published in a short term.

@ymartin59 ymartin59 merged commit 4104452 into SynoCommunity:master Jan 8, 2018
@m4tt075 m4tt075 deleted the jackett-service branch January 8, 2018 20:17
Copy link
Contributor

@ymartin59 ymartin59 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After @Safihre feedback with other packages, I have still some "improvements" to propose

{
# Replace generic service startup

MONO_PATH="${SYNOPKG_PKGDEST}/../mono/bin"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad idea... Prefer to use /usr/local/mono/bin

echo "Starting Jackett as user ${EFF_USER}" >> ${LOG_FILE}
COMMAND="env HOME=${HOME_DIR} PATH=${PATH} LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${MONO} ${JACKETT} --PIDFile ${PID_FILE}"

if [ $SYNOPKG_DSM_VERSION_MAJOR -lt 6 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These if statements are same as generic script.
I think moving all variables settings out of service_prestart (so removing this function) and provide SERVICE_COMMAND at the begging of this script should work.

Copy link
Contributor

@Safihre Safihre Jan 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No that won't work because the process never detaches: no & at the end when using SERVICE_COMMAND for processes that don't support deamon.
So DSM will stay in a constant state of Starting since the start never returns (since iets running the actual application).
That's why we need this special function. Or integrated in generic approach :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL Just came here to write the same! Agree with @Safihre . This is another candidate for the start-stop-daemon approach. I propose to keep this package as is for the time being and update once that approach is established...

@m4tt075
Copy link
Contributor Author

m4tt075 commented Feb 23, 2018

@ymartin59 This has been merged 6 weeks ago. Anything preventing this from being published?

@ymartin59
Copy link
Contributor

@m4tt075 Yes... Mono update. The fix I designed to relocate cert-sync seems to work. My DSM has a pending update, I will test everything is ok with mono+jackett upgrade

@jdeluyck
Copy link
Contributor

Having just pulled in Mono, and just wanted to pull in Jackett, it fails to upgrade from 0.7.1483-4 to the latest. Complains about corrupt package?

@Safihre
Copy link
Contributor

Safihre commented Feb 25, 2018

@jdeluyck Could you restart your NAS and try again?
What model NAS do you use?

@jdeluyck
Copy link
Contributor

jdeluyck commented Feb 25, 2018

@Safihre I'm using a DS916+.
Rebooted NAS, retried upgrade, same story.

@ymartin59
Copy link
Contributor

Hum hum. Corrupt package ? It remembers me trouble with signing process in repository... I have already fixed it (and there was no issue with recent published packages like mono, ffmpeg...) so probably there is a specific failure with Jackett. I am investigating....

@ymartin59
Copy link
Contributor

@jdeluyck As an immediate work-around, open Package Center "Settings" and select "Any publishers" in Trust Level section... sorry for the inconvenience

@Safihre
Copy link
Contributor

Safihre commented Feb 26, 2018

Simple re-publish is not fixing it? I indeed also see this error..

@jdeluyck
Copy link
Contributor

@ymartin59 that indeed works. So the package is ok, signing is borked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants