Add basic support for Synology DSM#136
Merged
4nd3r merged 8 commits intoskonfig:mainfrom Apr 27, 2025
Merged
Conversation
…it and upstart busybox-init: used on DSM < 5.0 upstart: used on DSM 5.x and 6.x systemd: used on DSM 7.0+ busybox-init is mixed with a lot of special Synology code. There is no /etc/init.d or /etc/rc.d as one might expect. There is a flood of rc scripts and /usr/syno/etc/rc.d which containts scripts for all services which are then enabled/disabled using various flags in /etc/synoinfo.conf. upstart: While DSM 5.x and 6.x use upstart as PID 1, it uses /usr/share/init (which is symlinked to /etc/init) to store upstart service descriptions and /usr/syno/etc/rc.sysv for legacy(?) init scripts. It also has special commands to start or stop services (synoservicectl and synoservice). systemd: On DSM 7.x systemd seems to be pretty standard.
Synology DSM < 5.0 does not have the tr(1) command available in the base OS. Moving the substitution into the awk program works around this limitation and saves us an extra one or two forks.
On at least Synology DSM, although there is a crond, the crontab(1) command is missing. Check for it and produce an error if it is not present.
Running grep(1) when we already run awk(1) is superfluous. awk can do both tasks at the same time.
6cb00bf to
1dd009c
Compare
4nd3r
approved these changes
Apr 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Granted, it may seem to come at the worst possible time.
This PR has been in the works for some time already and I think it would be a shame to throw it away just because of one bad press release.
So here it is: basic support for Synology DSM.
Users and groups have not been touched, yet, because they would require quite some changes in the existing code.
Since larger changes are also required for improved support of other operating systems like Mac OS X or AIX, it makes more sense to add DSM support then (if I still have the motivation).
Support for DSM < 6.0 is partial.
commandcommand and requires a polyfill which maps calls towhich.trcommand which is harder to polyfill and it's probably easier to try to replacetrwith other commands in skonfig. Currently not implemented. To get the basics working at the very least themachine_typeexplorer would need to be updated.