如何在啟動時運行 no-ip -Debian

如何在啟動時運行 no-ip -Debian

我已經在 Kali 2.0 上安裝並運行了 no-ip ddns,但是當嘗試讓它在啟動時運行時,我無法弄清楚將 rcX.d 中的“X”更改為什麼?

設定檔說:

If you want it to run automatically when the machine is booted, then
place the following script in your startup directory. (/etc/init.d/rcX.d
or /sbin/init.d/rcX.d or ???)

        #######################################################
        #! /bin/sh
        # . /etc/rc.d/init.d/functions  # uncomment/modify for your killproc
        case "$1" in
            start)
                echo "Starting noip2."
                /usr/local/bin/noip2
            ;;
            stop)
                echo -n "Shutting down noip2."
                killproc -TERM /usr/local/bin/noip2
            ;;
            *)
                echo "Usage: $0 {start|stop}"
                exit 1
        esac
        exit 0
        #######################################################

Where the 'X' in rcX.d is the value obtained by running the
following command
        grep initdefault /etc/inittab | awk -F: '{print $2}'

當我輸入:

grep initdefault /etc/inittab | grep initdefault /etc/inittab | grep initdefault /etc/inittab awk -F: '{印 $2}'

我得到:

grep: /etc/inittab: No such file or directory

答案1

您可以使用命令列來取得運行等級:

運行等級

運行級別(7) | Linux 手冊頁

但我想你想要:

更新-rc.d .....

更新-rc.d(8) - sysv-rc | Debian Jessie 線上說明頁

答案2

由於某種原因,我對已接受的答案有疑問,所以如果這對在 Raspberry Pi3 上運行 Debian 的人有幫助,我使用了這些說明,它們似乎有效:

https://www.linuxtopia.org/online_books/linux_beginner_books/debian_linux_desktop_survival_guide/No_IP.shtml

相關內容