精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 >

      BSD單用戶級與多用戶級啟動腳本/etc/rc.d/rc.1

      時間: 若木635 分享

        BSD單用戶級啟動腳本/etc/rc.d/rc.1

        腳本執(zhí)行后,除了內(nèi)核后臺程序和init外都將關(guān)閉。登陸程序?qū)㈤_啟,su:S1:respawn:/sbin/sulogin指定的功能。只有root用戶才能用系統(tǒng)。

        --------------------------------/etc/rc.d/rc.1-------------------------------

        #!/bin/sh

        # 卸載遠(yuǎn)程文件系統(tǒng)

        echo "Unmounting remote filesystems..."

        /bin/umount -a -tnfs

        #下面兩個信號后,除了內(nèi)核后臺程序和init外都將關(guān)閉。

        echo "Sending all processes the TERM signal..."

        /sbin/killall5 -15

        sleep 1

        echo "Sending all processes the KILL signal..."

        /sbin/killall5 -9

        ----------------------------end of /etc/rc.d/rc.1----------------------------

        BSD多用戶終端腳本/etc/rc.d/rc.2

        /etc/rc.d/rc.2

        #!/bin/sh

        # 這個例子里網(wǎng)卡ip設(shè)置為192.168.0.2 。子網(wǎng)掩碼為255.255.255.0,網(wǎng)關(guān)為192.168.0.1

        ### You may wish to add some commands changing sysctl states here, for example:

        # echo 1 > /proc/sys/net/ipv4/ip_forward # enable IP forwarding

        # echo 1 > /proc/sys/net/ipv4/tcp_syncookies # defend against SYN flood

        #設(shè)置網(wǎng)卡

        echo "Setting up loopback networking..."

        /sbin/ifconfig lo 127.0.0.1

        /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

        echo "Setting up eth0..."

        /sbin/ifconfig eth0 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0

        /sbin/route add -net default gw 192.168.0.1 netmask 0.0.0.0

        # 掛載遠(yuǎn)程文件系統(tǒng)

        echo "Mounting remote filesystems..."

        /bin/mount -a -v -tnfs

        ### you can create additional scripts for specific (networking) tasks,

        ### for example NFS, which needs a lot of daemons to work (see 3.2)

        ### or your firewall script:

        # 有防火墻則去下面注釋

        # if [ -x /etc/rc.d/rc.firewall ]; then

        # echo "Restoring firewall rules..."

        # /etc/rc.d/rc.firewall

        # fi

        # 網(wǎng)絡(luò)的一些后臺程序,如NFS

        # if [ -x /etc/rc.d/rc.netdaemons ]; then

        # echo "Starting network daemons..."

        # /etc/rc.d/rc.netdaemons

        # fi

        # 用戶個人配制文件

        if [ -x /etc/rc.d/rc.local ]; then

        /etc/rc.d/rc.local

        fi

      75551