تفاوت auto و allow-hotplug در فایل interfaces

سالهاست این allow-hotplug را توی تنظیمات پیشفرض دبیان می بینم و تنبلی مانع می شد که یک بار برای همیشه تفاوت اصلی و فاحش allow-hotplug با auto را در بیارم. تنها کاری که کردم اینه که به فراموشی سپردمش و فرض کردم نیست ?

یه اتفاق خوب باعث شد، بالاخره از صندوق خونه بکشمش بیرون. یکی لیست پستی دبیان بود و یکی به روز رسانی manual فایل interfaces.

شاید به این پیغام برخورده باشید

“A start job is running for raise network interfaces (2 minutes of 5 mins 1 sec)”

 

این پیغام به خاطر این هست سیستم یا یک سرویس منتظر بالاآمدن شبکه شماست. این همان اثر auto در فایل interfaces هست. این زمان خیلی طولانی هست (پنج دقیقه) و خیلی مواقع باعث دردسره. اگه نمی خواهید که منتظر ارتباط شبکه بشید بهتره از allow-hotplug استفاده کنید

allow-hotplug
iface eth0 inet dhcp

 

با این کار دیگه پیغام بالا را نمی‌بینید. این موضوع توی manual‌هم نیومده و چند روز پیش یک نفر در لیست پستی debian-user اعلام کرد، که در زیر آوردم و می تونید اصل مطلب را در اینجا مطالعه کنید.

The basic difference is the order in which services get loaded at
boot time, and whether the services wait for something, or just go.

An interface marked “auto” will be waited-for by services that are
configured to wait for interfaces to be up. E.g. mounting NFS file
systems, or starting an NFS server.

An interface marked “allow-hotplug” is considered nonessential or
transient, and the core OS services won’t wait for it before starting.

 

علاوه بر این یکی دیگه از استفاده های allow-hotplug برای کارت مواقعی است که ممکنه مثلا از کارت شبکه USB استفاده می کنید. می خواهید هر موقع وصلش کردید، کانفیگ روش اعمال بشه. این استفاده در man interfaces آمده.

Interfaces marked “allow-hotplug” are brought up when udev detects them. This can either be during boot if the interface is already present, or at a later time, for example when plugging in a USB network card. Please note that this does not have anything to do with detecting a network cable being plugged in.

 

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *