LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   what is the difference between service network reload and service network restart ? (https://www.linuxquestions.org/questions/linux-networking-3/what-is-the-difference-between-service-network-reload-and-service-network-restart-601405/)

markraem 11-21-2007 06:30 AM

what is the difference between service network reload and service network restart ?
 
when I want to change IP address on RHEL, I edit the files in /etc/sysconfig/network-scripts/ifcfg-ethX and then do service network restart or reload

Both options work OK for me, but what is the difference between them?

When is it better to use service network reload ?
When is it better to use service network restart ?

Thanx in advance.

jschiwal 11-21-2007 06:38 AM

Often they are the same. I think for the network service this is the case because ifdown is called on the interfaces followed by ifup. Other services like xinetd might reload the config without restarting.

markraem 11-21-2007 08:27 AM

Is it then correct to say that restart will do ifup/ifdown
but
reload will not do ifup/ifdown ?

jschiwal 11-21-2007 03:08 PM

No, I think "service network reload" will call ifdown / ifup. You can try it yourself. Also, you can read the service script. It depends on the particular service script and the binary that is called. The reload option for some services might be included for completeness but it may be restart that is called.

Here is an example from SuSE:
Code:

        reload)
                # NetworkManager does not support reload (2005.01.15).
                # If configuration and running system do not match exec restart.
                # Fall through if NetControl is confiured and NM not active.
                if [ "$NETWORKMANAGER" == yes ] ; then
                        if netcontrol_running; then
                                mesg "Changing Network Control System. Calling $0 restart"
                                exec $0 restart $CONFIG $INTERFACE ${OPTIONS:+-o $OPTIONS}
                        else
                                # NetworkManager doesn't support signaling --> restarting
                                exec $0 restart $CONFIG $INTERFACE ${OPTIONS:+-o $OPTIONS}
                        fi
                else
                        if nm_running; then
                                mesg "Changing Network Control System. Calling $0 restart"
                                shift
                                exec $0 restart $*
                        fi
                fi
                ;;



All times are GMT -5. The time now is 01:18 PM.