Skip to content

Commit

Permalink
fix(rc): re-read rc.conf using ALRM to /bin/sh
Browse files Browse the repository at this point in the history
I previously thought that would be handled by signaling /sbin/init but
obviously that is not the case.

Ticket: #80472
  • Loading branch information
william-gr committed Mar 13, 2019
1 parent f6b1ef7 commit 3d8ee05
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/freenas/etc/ix.rc.d/ix-etc
Expand Up @@ -34,6 +34,9 @@ generate_etc()
[ -s /data/dhparam.pem ] || openssl dhparam -rand /dev/random 2048 > /data/dhparam.pem

LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/midclt call etc.generate_all > /dev/null

# etc rc plugin will generate rc.conf.freenas which needs to be re-read by /etc/rc script
killall -ALRM sh
}

name="ix-etc"
Expand Down
2 changes: 1 addition & 1 deletion src/freenas/etc/ix.rc.d/ix-netif
Expand Up @@ -230,7 +230,7 @@ netif_start()
# we need to fallback to configuring interfaces using rc.d/netif for debugging.
if ! /usr/local/bin/midclt -t 120 call interfaces.sync true > /dev/null 2>&1; then
_interface_config > /etc/rc.conf.network
kill -ALRM 1
killall -ALRM sh
fi
}
Expand Down
4 changes: 1 addition & 3 deletions src/middlewared/middlewared/etc_files/rc.conf.py
Expand Up @@ -2,7 +2,6 @@
import itertools
import os
import re
import signal
import subprocess
import sysctl

Expand Down Expand Up @@ -446,5 +445,4 @@ def render(service, middleware):
except Exception:
middleware.logger.error('Failed to generate %s', i.__name__, exc_info=True)

if write_if_changed('/etc/rc.conf.freenas', '\n'.join(rcs) + '\n'):
os.kill(1, signal.SIGALRM)
write_if_changed('/etc/rc.conf.freenas', '\n'.join(rcs) + '\n')

0 comments on commit 3d8ee05

Please sign in to comment.