mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Improve systemd settings for slapd (#933)
This commit is contained in:
parent
7cfd553c3f
commit
7061c4c3fe
2 changed files with 19 additions and 0 deletions
|
@ -63,6 +63,9 @@ do_pre_regen() {
|
|||
cp -a ldap.conf slapd.conf "$ldap_dir"
|
||||
cp -a sudo.schema mailserver.schema yunohost.schema "$schema_dir"
|
||||
|
||||
mkdir -p ${pending_dir}/etc/systemd/system/slapd.service.d/
|
||||
cp systemd-override.conf ${pending_dir}/etc/systemd/system/slapd.service.d/ynh-override.conf
|
||||
|
||||
install -D -m 644 slapd.default "${pending_dir}/etc/default/slapd"
|
||||
}
|
||||
|
||||
|
@ -83,6 +86,13 @@ do_post_regen() {
|
|||
chmod o-rwx /etc/yunohost/certs/yunohost.org/
|
||||
chmod -R g+rx /etc/yunohost/certs/yunohost.org/
|
||||
|
||||
# If we changed the systemd ynh-override conf
|
||||
if echo "$regen_conf_files" | sed 's/,/\n/g' | grep -q "^/etc/systemd/system/slapd.service.d/ynh-override.conf$"
|
||||
then
|
||||
systemctl daemon-reload
|
||||
systemctl restart slapd
|
||||
fi
|
||||
|
||||
[ -z "$regen_conf_files" ] && exit 0
|
||||
|
||||
# check the slapd config file at first
|
||||
|
|
9
data/templates/slapd/systemd-override.conf
Normal file
9
data/templates/slapd/systemd-override.conf
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Service]
|
||||
# Prevent slapd from getting killed by oom reaper as much as possible
|
||||
OOMScoreAdjust=-1000
|
||||
# If slapd exited (for instance if got killed) the service should not be
|
||||
# considered as active anymore...
|
||||
RemainAfterExit=no
|
||||
# Automatically restart the service if the service gets down
|
||||
Restart=always
|
||||
RestartSec=3
|
Loading…
Add table
Reference in a new issue