如何將 samba 新增至啟動應用程式

如何將 samba 新增至啟動應用程式

我在 ubuntu 14.04 上安裝了 samba,我希望它在系統啟動時啟動。有人幫忙嗎?

答案1

只需在終端機中執行以下命令:

sudo update-rc.d samba defaults

答案2

您可以嘗試以下方法。我不了解 samba,但它對我運行其他一些服務很有用。

有三種方法可以做到這一點。

替代方案 1# 建立新腳本/etc/init.d/

我們可以透過在 init.d 中建立新腳本來建立新的啟動服務

目錄

Note: Donot forget to make the script executable 

替代方案 2# 透過新增指令/etc/rc.local

以下範例說明了該技術:

vi /etc/rc.local

/path/to/my/script.sh || exit 1
exit 0

替代方案 3# 實現這一目標的第三種方法是新增 Upstart Job

    Create      /etc/init/myjob.conf

Add the following entries to the file


description "my Job"
start on startup
task
exec /path/to/my/script.sh

在描述中您可以使用任何名稱。在路徑中exec給出 samba 二進位檔案的路徑。

相關內容