Skip to content

Add basic support for Synology DSM #136

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

Merged
merged 8 commits into from
Apr 27, 2025

Conversation

sideeffect42
Copy link
Member

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.

  • DSM < 6.0 is missing the command command and requires a polyfill which maps calls to which.
  • DSM < 5.0 is missing the tr command which is harder to polyfill and it's probably easier to try to replace tr with other commands in skonfig. Currently not implemented. To get the basics working at the very least the machine_type explorer would need to be updated.

sideeffect42 and others added 8 commits April 24, 2025 17:52
…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.
@sideeffect42 sideeffect42 requested a review from 4nd3r April 24, 2025 17:12
@4nd3r 4nd3r merged commit f4fa309 into skonfig:main Apr 27, 2025
1 check passed
@sideeffect42 sideeffect42 deleted the feature/dsm-support branch April 27, 2025 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants