mdns: Misc fixes after tests on the battefield

This commit is contained in:
Alexandre Aubin 2021-08-12 17:19:45 +02:00
parent ffc132f2c5
commit 4d0581bef2
2 changed files with 6 additions and 4 deletions

View file

@ -30,18 +30,20 @@ do_init_regen() {
do_pre_regen() { do_pre_regen() {
pending_dir="$1" pending_dir="$1"
cd /usr/share/yunohost/templates/dnsmasq cd /usr/share/yunohost/templates/mdns
mkdir -p ${pending_dir}/etc/systemd/system/
cp yunomdns.service ${pending_dir}/etc/systemd/system/ cp yunomdns.service ${pending_dir}/etc/systemd/system/
getent passwd mdns &>/dev/null || useradd --no-create-home --shell /usr/sbin/nologin --system --user-group mdns getent passwd mdns &>/dev/null || useradd --no-create-home --shell /usr/sbin/nologin --system --user-group mdns
mkdir -p ${pending_dir}/etc/yunohost
_generate_config > ${pending_dir}/etc/yunohost/mdns.yml _generate_config > ${pending_dir}/etc/yunohost/mdns.yml
} }
do_post_regen() { do_post_regen() {
regen_conf_files="$1" regen_conf_files="$1"
chown mdns:mdns ${pending_dir}/etc/yunohost/mdns.yml chown mdns:mdns /etc/yunohost/mdns.yml
# If we changed the systemd ynh-override conf # If we changed the systemd ynh-override conf
if echo "$regen_conf_files" | sed 's/,/\n/g' | grep -q "^/etc/systemd/system/yunomdns.service$" if echo "$regen_conf_files" | sed 's/,/\n/g' | grep -q "^/etc/systemd/system/yunomdns.service$"

View file

@ -163,7 +163,7 @@ def domain_add(operation_logger, domain, dyndns=False):
# because it's one of the major service, but in the long term we # because it's one of the major service, but in the long term we
# should identify the root of this bug... # should identify the root of this bug...
_force_clear_hashes(["/etc/nginx/conf.d/%s.conf" % domain]) _force_clear_hashes(["/etc/nginx/conf.d/%s.conf" % domain])
regen_conf(names=["nginx", "metronome", "dnsmasq", "postfix", "rspamd"]) regen_conf(names=["nginx", "metronome", "dnsmasq", "postfix", "rspamd", "mdns"])
app_ssowatconf() app_ssowatconf()
except Exception as e: except Exception as e:
@ -290,7 +290,7 @@ def domain_remove(operation_logger, domain, remove_apps=False, force=False):
"/etc/nginx/conf.d/%s.conf" % domain, new_conf=None, save=True "/etc/nginx/conf.d/%s.conf" % domain, new_conf=None, save=True
) )
regen_conf(names=["nginx", "metronome", "dnsmasq", "postfix"]) regen_conf(names=["nginx", "metronome", "dnsmasq", "postfix", "rspamd", "mdns"])
app_ssowatconf() app_ssowatconf()
hook_callback("post_domain_remove", args=[domain]) hook_callback("post_domain_remove", args=[domain])