系統管理
1752486 會員
5409 線上
108788 解決方案
發表新文章

有關 /sbin/init.d/net stop

 
watermelonyu
教授

有關 /sbin/init.d/net stop

請教一下, 下完這個指令後整個網路會斷掉嗎 ? 我下完怎麼好像什麼事都沒發生一樣, 那這樣有什麼意義嗎 ??
10則回覆 10
watermelonyu
教授

有關 /sbin/init.d/net stop

root@snoopy /sbin/init.d> head -10 /sbin/init.d/net

#!/sbin/sh

#

# net: configure lan interface(s) at initialization time.

#

# @(#) net $Date: 2001/06/14 15:09:22 $Revision: cup_rar_r11.11_xport_pib/6 PATCH_11.11 (PHNE_23645)

#

# The ifconfig(1m) command assigns an IP address to a LAN interface and

# configures network interface parameters.

#

# See ifconfig(1m)



在檔頭就說明了, 'configure lan interface(s) at initialization time', 指在開機過程就已經透過ifconfig將ip bind到網卡上了, 目前系統是running狀態,

再去將他stop也就沒有作用了. 若真的在running狀態, 不想讓其他user登入, 有兩個辦法, 一個是切換到single user mode, 另一個就是下 inetd -k, 把inetd process刪掉, 若要再讓user登入, 直接下inetd就可以了. 可用ps -ef|grep inetd確認inetd是否有up.
watermelonyu
教授

有關 /sbin/init.d/net stop

忘了說, 網路不會斷.
watermelonyu
教授

有關 /sbin/init.d/net stop

If you want to stop internet service, pls run ....inetd -k

-----------------------

-k Kill the current inetd. This option sends the signal SIGTERM to the Internet daemon that is currently running, causing it to exit gracefully. This option is the preferred

method of killing inetd.

watermelonyu
教授

有關 /sbin/init.d/net stop

The inetd daemon is the Internet superserver, which invokes Internet server processes as needed. It must be running before other hosts can connect to the local host through ftp, rcp, remsh, rlogin, and telnet.



The inetd daemon also supports services based on the Remote Procedure Call (RPC) protocol (NFS), such as rwalld and rusersd. If RPC serversare started by inetd, the portmap server (see portmap(1M)) must be started before inetd.

watermelonyu
教授

有關 /sbin/init.d/net stop

謝謝兩位回答, 那有關 net stop 的指令不就沒有什麼用處 ? 如果我改了 ip 的話, 再用 net stop -> net start 也不會斷嗎 ?
watermelonyu
教授

有關 /sbin/init.d/net stop

不會, /sbin/init.d/net(它)是在系統開機階段呼叫ifconfig去bind ip到網卡上, so, 是沒用處.



若真的要讓網路斷線, try #ifconfig lanX down



*Note: 記得透過MP/GSP連到console做, 如果是single lan device, 又是用telnet進系統執行ifconfig lanX

down, 那可能就要麻煩您跑一趟機房了.

watermelonyu
教授

有關 /sbin/init.d/net stop

我還有個疑問, 改好 netconf 的 ip address 之後, 然後再 net start 一次, 這個時候 ip 是不是會變成新的 ip address ? 如果是的話, 那已經連線的部份也都不會斷線嗎 ???
watermelonyu
教授

有關 /sbin/init.d/net stop

剛剛稍微試了一下, 修改netconf, bind ip到另一張網卡,

用/sbin/init.d/net {start|stop}, 的卻會變成新的ip

address, 但如果是single nic變更ip, client端會以

time out斷線.



you can try on your test env, and share the result with us :-)
watermelonyu
教授

有關 /sbin/init.d/net stop

After re-configured the netconf file,you can just do a

/sbin/init.d/net stop

/sbin/init.d/net start