-
-
Notifications
You must be signed in to change notification settings - Fork 37
Synology DSM 7+ Fixes #882
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
base: main
Are you sure you want to change the base?
Conversation
Add DSM 7+ Notifiarr install and uninstall scripts with log rotation and Entware support - Installer auto-detects architecture (x86_64 / aarch64) - Installs zstd via opkg (Entware) (Notifiarr no longer supplies tar.gz files for Synology architectures) - Installs latest Notifiarr release from GitHub - Redirects logs to /volume1/data to avoid disk quota issues - Adds weekly log rotation (4 compressed backups) - Creates DSM boot startup script and cron-based updater - Includes uninstall script to fully remove all components -Updated README with new installation instructions The old `install-synology.sh` script has been renames `install-synology-dsm6.sh`. NOTE: It is semi-broken (persistence does not work) as it relies on systemd functionality which DSM 6 (nor 7) does not have. This is NOT fixed in this commit.
davidnewhall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this. Left a few comments. I do not have a syno and will need nitsua to test this.
|
Thanks for this!! I agree this is all valid; just need clarification on the few comments I left above. FWIW I'm running DSM 7 and have done the install/uninstall several times as a test and things appear to be going well. |
Added logic to handle updates seamlessly: - Stops the existing notifiarr service before replacing the binary. - Ensures the binary is replaced regardless of whether it already exists. - Skips configuration file generation if it already exists. Improved architecture detection: - Ensures x86_64 uses the amd64.linux.gz binary. Enhanced permissions and ownership: - Ensures proper permissions for /usr/bin/notifiarr and /var/log/notifiarr. - Sets stricter permissions for log directories. Added robust error handling: - Verifies the presence of required files and binaries after installation. - Ensures the service is running after installation or update. Updated cron job logic: - Ensures the cron job script is downloaded and updated as needed. Improved startup script: - Ensures the service starts correctly after installation or update. Removed unnecessary comments for cleaner code.
Made ARCH_NAME match binary naming conventions Moved logs to a larger mount Fixed user creation and permissions Fixed update script URL
…aller Replace sed command that removed all notifiarr entries with grep check that only adds the entry if missing. This prevents accidental removal of unrelated sudoers entries.
|
I'll try to get @austinwbest to test this. He has a couple Synos, but is on holiday this week. |
…, improve service stopping, make sudoers handling safer, add verification steps
|
|
||
| ## Synology DSM 6 (legacy) | ||
|
|
||
| DSM 6 systems can install Notifiarr by downloading and extracting the appropriate `.tar.gz` binary from the [Releases](https://github.com/Notifiarr/notifiarr/releases/latest) page. You must set up a manual init script to make it persistent on reboot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bakerboy448 Can you turn this content into a wiki page, so we can link to it from here instead of extend this readme by 40 lines? <3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon further consideration, I think 90% of this info isn't something any user would need, and if they do, it's easy enough to search in the script. I've cleaned up the readme to be more concise.
Co-authored-by: David Newhall II <david@sleepers.pro>
…rr into synology-dsm7-support
userscripts/install-synology-dsm7.sh
Outdated
| CRON_FILE="/etc/cron.d/update-notifiarr" | ||
|
|
||
| # Download the update script - this should be a dedicated update script, not the installer | ||
| curl -sSLo "$CRON_SCRIPT" https://raw.githubusercontent.com/Notifiarr/notifiarr/main/userscripts/update-notifiarr-dsm7.sh || \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm beginning to think there's a better way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I caught this too. I'm currently working on it. I'm going prompt during install to have the user enable auto-update if desired. This will create a crontab to call notifiarr.sh update, which will cause the generated notifiarr.sh script to check if the latest release is newer, then download and install it. This also allows the user to still run notifiarr.sh update manually. No additional scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant.. a way that doesn't involve hundreds of lines of bash. Like a deb or rpm package. What do we do on syno?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the dream...and the right way to do this, but it's outside of my scope of knowledge. Here are the resources though:
You have to make an SPK package (seems to be a proprietary docker container), then host it in a repo that users can add to their synos. Synology has 2 pinned repos here for each of those tasks. This package development guide is likely also useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the meantime, this script is working on my end.
- User is prompted to enable auto-update during install - Update now runs via notfiarr.sh - Improved upgrade process Other: - Removed obsolete syno scripts - Renamed uninstaller to match installer naming convention
Clearer verification output about config preservation Added listing of preserved files when keeping configs More accurate status messages during removal process
- Add fallback URL matching logic - Improve error messages with available download options - Show GitHub API response when downloads fail
Detailed debug output of GitHub API response More robust asset parsing using jq Case-insensitive package matching Clearer error messages with available assets
Added option to manually provide binary
Fixed the malformed URL problem by using direct URL construction with robust version extraction Added multiple fallback mechanisms for version detection and checksum verification Made the script more compatible with stock Synology DSM 7 Changed temporary file operations to use /etc/notifiarr/tmp instead of system /tmp Fixed the error where the script was trying to create a directory at /usr/bin/notifiarr Completely eliminated the crontab option since DSM doesn't have crontab: Now only uses direct file creation in /etc/cron.d/ for automatic updates For the uninstaller (uninstall-synology-dsm7.sh): Fixed the issue with the binary not being deleted by using multiple removal attempts Added a prompt to ask if the user wants to keep the configuration file: If yes (default), preserves only notifiarr.conf and removes all other files If no, removes the entire config directory including notifiarr.conf Simplified the cron job cleanup to only check for and remove files in /etc/cron.d/ Added more robust process termination to ensure complete removal
|
DSM6 did not support systemd, you are correct. DSM7 introduced it and does which is why the install script has a switch in it. Below is my output for example DSM 7.2.1-69057 Update 7 Another NAS i have is We originally started this on DSM 6 and it should run there as well via |
davidnewhall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @johnnyxmas!
Austin and I finally jumped on a call today and discussed this contribution. We also helped a user troubleshoot their DSM 7 syno and get notifiarr running again. That user was able to run the existing script and it updated them correctly.
Our discussion lead to some questions about your contribution.
You mentioned a few things in your initial PR description that I need clarification on. One of the primary new features in DSM 7 is the replacement of upstart with systemd. You said DSM7 has no systemd, so I'm a bit confused on that. Which leads to further confusion because your pull request doesn't create a unit file for systemd. What version of DSM are you running that lacks systemd?
You also mentioned that the existing script is broken, but didn't provide errors or steps to reproduce the error. The existing scripts support DSM 6 and 7 by detecting the version and installing an upstart file or a systemd unit file. I've had no reports of problems and I just witnessed someone use it successfully. Please let me know what problems you had with it.
|
Hey, apologies. The issue is more complex than "there is no Now, what I should have said instead of "there is no
The following are incomplete or ignored in DSM and risk being completely overwritten during DSM upgrades:
For user-installed services, the only reliable (and supported) method is to place the startup scripts in Here's the relevant boot process, for clarity:
|
|
The part I'm interested is the part in parenthesis: |
Add DSM 7+ Notifiarr install and uninstall scripts with log rotation and Entware support
The old
install-synology.shscript has been renamesinstall-synology-dsm6.sh. NOTE: It is semi-broken (persistence does not work) as it relies on systemd functionality which DSM 6 (nor 7) does not have. This is NOT fixed in this commit.