pivasoftware / easycwmp

EasyCwmp:
http://www.easycwmp.org/
GNU General Public License v2.0
73 stars 59 forks source link

Use order from /etc/rc.d when doing service reloads/restarts #23

Open okraits opened 8 years ago

okraits commented 8 years ago

So far, the services restart order when running easycwmp apply service is rather random and doesn't comply with the order defined in /etc/rc.d. This commit fixes that.

pivasoftware commented 8 years ago

For OpenWRT system, the restart of service is done by the function common_uci_track_restart_services(). This function determine automatically the service to restart in OpenWRT. So the "apply_service_tmp_file" is useless for OpenWRT. You should get an empty file.

If you are working with "apply_service_tmp_file" that means that you called (in your data model) the functions: common_delay_service_restart_in_apply_service() or common_execute_command_in_apply_service()

If you are working with OpenWRT, So you have to refer to the function common_uci_track_restart_services() and change it in order to restart services in order

pivasoftware commented 8 years ago

Beside that, Your change has to take account that the "$apply_service_tmp_file" does not contains only services to restart. It could contains also commands. So your changes will skip all commands in the "$apply_service_tmp_file" file