-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
DietPi-Services 2.0 | Fine tuning part 2 #2853
Conversation
+ DietPi-Services | Create systemd wrappers and drop-in configs inside /etc/systemd/system/ always, leave /lib/systemd/system/ for APT package installs only + DietPi-Services | Do not check /usr/lib/systemd/system/ for service files, since this is never used by systemd: https://manpages.debian.org/stretch/systemd/systemd.unit.5.en.html + DietPi-Services | Populate_Available_Array() only once each script execution, which renders $INIT_ALL_ARRAYS obsolete. In case values are changed from menu, re-estimate them per-service. This solves the issue that aSERVICE_RESTART_REQUIRED[] is overwritten for all services, e.g. when one gets reset. + DietPi-Services | Instead of looping through all known services and checking aSERVICE_AVAILABLE[], unset aSERVICE_NAME[] for all non-existent and excluded services. This reduces array memory size and loop counts vastly. + DietPi-Services | Pass aSERVICE_NAME[] always in double quotes as command argument, to be failsafe if service name contains spaces or magic characters
Performance tests
pre-PR
post-PR
|
Performance tests: Single service mode (commit 2)pre-PR
post-PR
|
a181f57 performance tests
pre-commit
post-commit
|
# - [Service] line throws an effectless error that we can simply hide. | ||
# - All values are single word strings, so bash assigns them correctly. | ||
local Nice CPUAffinity CPUSchedulingPolicy CPUSchedulingPriority IOSchedulingClass IOSchedulingPriority | ||
. $fp &> /dev/null |
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.
Nice, I did think of adding #!/bin/bash
to our drop in service, but interesting its not needed 👍
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.
@Fourdee
Hehe nope for sourcing it's not required. Actually it is even ignored. When sourcing scripts, they are always executed with the originating shell, of course, since no new shell is initiated.
Only downside is that custom user changes "might" be a danger. Although all systemd unit syntax is var=value style, so the worst thing is that we source some inerte variables and/or get some more silenced syntax errors.
Legend 👍 |
Status: Ready
ToDo:
[ ] Instead of allow editing the /lib/systemd/system/ or /etc/init.d/ service files (thus touching maintainer defaults and breaking file updates by APT), create a copy to /etc/systemd/system/ to edit, which overrides the /lib location file. In case of sysvinit either a wrapper needs to be created or a drop-in config to override the auto-generated systemd unit. The drop-in config is actually the safest way in general, allowing easy reverting. A commented copy of the original file could be used as template, so lines to be changed can be un-commented to edit, which makes the done changes transparent.Move to last part 3Commit list/description: