Commit 86058fb8 authored by Ad Schellevis's avatar Ad Schellevis

rename check_reload_status to configd, but keep legacy support for check_reload_status.

parent 32a052f2
...@@ -345,9 +345,12 @@ echo "done." ...@@ -345,9 +345,12 @@ echo "done."
# Run the php.ini setup file # Run the php.ini setup file
/usr/local/etc/rc.php_ini_setup /usr/local/etc/rc.php_ini_setup
chmod u+rx /usr/local/opnsense/service/check_reload_status.py chmod u+rx /usr/local/opnsense/service/configd.py
/usr/local/opnsense/service/check_reload_status.py /usr/local/opnsense/service/configd.py
sleep 1 # give check_reload_status some time to load to prevent missing socket # check_reload_status renamed, for legacy stuff symlink old socket
/bin/rm -f /var/run/check_reload_status
ln -s /var/run/configd.socket /var/run/check_reload_status
sleep 1 # give configd some time to load to prevent missing socket
# let the PHP-based configuration subsystem set up the system now # let the PHP-based configuration subsystem set up the system now
echo -n "Launching the init system..." echo -n "Launching the init system..."
......
...@@ -430,10 +430,10 @@ pfSenseupgrade) ...@@ -430,10 +430,10 @@ pfSenseupgrade)
rm /tmp/configbak/*_log.txt 2>/dev/null rm /tmp/configbak/*_log.txt 2>/dev/null
# tar explode image onto hd # tar explode image onto hd
ps -a | grep "check_reload_status" | awk '{print $1;}' | kill -9 ps -a | grep "configd" | awk '{print $1;}' | kill -9
echo "Installing $IMG." >> /conf/upgrade_log.txt 2>&1 echo "Installing $IMG." >> /conf/upgrade_log.txt 2>&1
cd / && /usr/bin/tar --exclude=./dev -xzUPf $IMG >> /conf/upgrade_log.txt 2>&1 cd / && /usr/bin/tar --exclude=./dev -xzUPf $IMG >> /conf/upgrade_log.txt 2>&1
/usr/local/opnsense/service/check_reload_status.py /usr/local/opnsense/service/configd.py
echo "Image installed $IMG." >> /conf/upgrade_log.txt 2>&1 echo "Image installed $IMG." >> /conf/upgrade_log.txt 2>&1
# process custom image if its passed # process custom image if its passed
......
...@@ -38,7 +38,7 @@ class Backend ...@@ -38,7 +38,7 @@ class Backend
/** /**
* @var string location of configd socket * @var string location of configd socket
*/ */
private $configdSocket = "/var/run/check_reload_status"; private $configdSocket = "/var/run/configd.socket";
/** /**
* init Backend component * init Backend component
......
[main] [main]
socket_filename:/var/run/check_reload_status socket_filename:/var/run/configd.socket
pid_filename:/var/run/check_reload_status.pid pid_filename:/var/run/configd.pid
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
package : check_reload_status package : configd
function: delivers a process coordinator to handle frontend functions function: delivers a process coordinator to handle frontend functions
...@@ -56,12 +56,12 @@ os.chdir(program_path) ...@@ -56,12 +56,12 @@ os.chdir(program_path)
# open configuration # open configuration
cnf = ConfigParser.ConfigParser() cnf = ConfigParser.ConfigParser()
cnf.read('conf/check_reload_status.conf') cnf.read('conf/configd.conf')
# validate configuration, exit on missing item # validate configuration, exit on missing item
for config_item in ['socket_filename','pid_filename']: for config_item in ['socket_filename','pid_filename']:
if cnf.has_section('main') == False or cnf.has_option('main',config_item) == False: if cnf.has_section('main') == False or cnf.has_option('main',config_item) == False:
print('configuration item main/%s not found in %s/conf/check_reload_status.conf'%(config_item,program_path)) print('configuration item main/%s not found in %s/conf/configd.conf'%(config_item,program_path))
sys.exit(0) sys.exit(0)
# run process coordinator ( on console or as daemon ) # run process coordinator ( on console or as daemon )
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
package : check_reload_status package : configd
function: commandline execute commands to check_reload_status daemon function: commandline execute commands to check_reload_status daemon
...@@ -63,6 +63,16 @@ except socket.error, msg: ...@@ -63,6 +63,16 @@ except socket.error, msg:
try: try:
print ('send:%s '%exec_command) print ('send:%s '%exec_command)
sock.send(exec_command) sock.send(exec_command)
print ('response:%s'% sock.recv(4096)) data = []
while True:
line = sock.recv(4096)
if line:
data.append(line)
else:
break
print ('response:%s'% ''.join(data) )
finally: finally:
sock.close() sock.close()
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
package : check_reload_status package : configd
function: config handler function: config handler
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
package : check_reload_status package : configd
function: unix domain socket process worker process function: unix domain socket process worker process
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
package : check_reload_status package : configd
function: unix domain socket process worker process function: unix domain socket process worker process
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
package : check_reload_status package : configd
function: template handler, generate configuration files using templates function: template handler, generate configuration files using templates
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment