Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 326536 Details for
Bug 438342
New russian translation
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
hb-working-rcscripts
hb-working-rcscripts.xml (text/plain), 43.14 KB, created by
Vladimir Romanov (RETIRED)
on 2012-10-14 14:33:00 UTC
(
hide
)
Description:
hb-working-rcscripts
Filename:
MIME Type:
Creator:
Vladimir Romanov (RETIRED)
Created:
2012-10-14 14:33:00 UTC
Size:
43.14 KB
patch
obsolete
><?xml version='1.0' encoding='UTF-8'?> ><!DOCTYPE sections SYSTEM "/dtd/book.dtd"> ><!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/ru/handbook/hb-working-rcscripts.xml,v 2 2012-09-24 blueboar Exp $ --> > ><!-- ТекÑÑ ÑÑого докÑменÑа ÑаÑпÑоÑÑÑанÑеÑÑÑ Ð½Ð° ÑÑловиÑÑ Ð»Ð¸Ñензии CC-BY-SA --> ><!-- См. http://creativecommons.org/licenses/by-sa/2.5 --> > ><sections> > ><version>2</version> ><date>2012-07-24</date> > ><section> ><title>УÑовни запÑÑка</title> ><subsection> ><title>ÐÑоÑеÑÑ Ð·Ð°Ð³ÑÑзки ÑиÑÑемÑ</title> ><body> > ><p> >ÐÑи загÑÑзке ваÑей ÑиÑÑÐµÐ¼Ñ Ð¿Ð¾ ÑкÑÐ°Ð½Ñ Ð¿ÑÐ¾Ð±ÐµÐ³Ð°ÐµÑ Ð¼Ð½Ð¾Ð³Ð¾ ÑекÑÑа. ÐÑли >пÑиÑмоÑÑеÑÑÑÑ, замеÑно, ÑÑо ÑÑÐ¾Ñ ÑекÑÑ Ð½Ðµ менÑеÑÑÑ Ð¾Ñ Ð·Ð°Ð³ÑÑзки к загÑÑзке. >ÐоÑледоваÑелÑноÑÑÑ Ð²ÑÐµÑ ÑÑÐ¸Ñ Ð´ÐµÐ¹ÑÑвий назÑваеÑÑÑ <e>поÑледоваÑелÑноÑÑÑÑ >загÑÑзки</e> и в Ñой или иной ÑÑепени поÑÑоÑнна. ></p> > ><p> >Ðо-пеÑвÑÑ , загÑÑзÑик ÑазмеÑÐ°ÐµÑ Ð² памÑÑи обÑаз ÑдÑа, коÑоÑÑй Ð²Ñ Ñказали в >Ñайле его конÑигÑÑаÑии. ÐоÑле ÑÑого ÑдÑо запÑÑкаеÑÑÑ. Ðогда ÑдÑо загÑÑжено и >запÑÑено, оно иниÑиализиÑÑÐµÑ Ð¾ÑноÑÑÑиеÑÑ Ðº ÑдÑÑ ÑÑÑÑкÑÑÑÑ Ð¸ заданиÑ, и >запÑÑÐºÐ°ÐµÑ Ð¿ÑоÑеÑÑ <c>init</c>. ></p> > ><p> >ÐÑÐ¾Ñ Ð¿ÑоÑеÑÑ ÑдоÑÑовеÑÑеÑÑÑ, ÑÑо вÑе ÑайловÑе ÑиÑÑÐµÐ¼Ñ (опÑеделеннÑе в ><path>/etc/fstab</path>) ÑмонÑиÑÐ¾Ð²Ð°Ð½Ñ Ð¸ гоÑÐ¾Ð²Ñ Ðº иÑполÑзованиÑ. ÐаÑем он >вÑполнÑÐµÑ Ð½ÐµÑколÑко ÑÑенаÑиев, Ð½Ð°Ñ Ð¾Ð´ÑÑÐ¸Ñ ÑÑ Ð² каÑалоге <path>/etc/init.d</path>, >коÑоÑÑе запÑÑкаÑÑ ÑлÑжбÑ, Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе Ð´Ð»Ñ Ð½Ð¾ÑмалÑного запÑÑка ÑиÑÑемÑ. ></p> > ><p> >Ð, наконеÑ, когда вÑе ÑÑенаÑии вÑполненÑ, <c>init</c> подклÑÑÐ°ÐµÑ ÑеÑÐ¼Ð¸Ð½Ð°Ð»Ñ >(ÑаÑе вÑего пÑоÑÑо виÑÑÑалÑнÑе конÑоли, коÑоÑÑе Ð²Ð¸Ð´Ð½Ñ Ð¿Ñи нажаÑии ><c>ALT+F1</c>, <c>ALT+F2</c> и Ñ.д.), пÑикÑеплÑÑ Ðº каждой конÑоли ÑпеÑиалÑнÑй >пÑоÑеÑÑ Ð¿Ð¾Ð´ названием <c>agetty</c>. ÐÑÐ¾Ñ Ð¿ÑоÑеÑÑ Ð²Ð¿Ð¾ÑледÑÑвии обеÑпеÑÐ¸Ð²Ð°ÐµÑ >возможноÑÑÑ Ð²Ñ Ð¾Ð´Ð° в ÑиÑÑÐµÐ¼Ñ Ñ Ð¿Ð¾Ð¼Ð¾ÑÑÑ <c>login</c>. ></p> > ></body> ></subsection> ><subsection> ><title>СÑенаÑии иниÑиализаÑии</title> ><body> > ><p> >СейÑÐ°Ñ Ð¿ÑоÑеÑÑ <c>init</c> запÑÑÐºÐ°ÐµÑ ÑÑенаÑии из каÑалога ><path>/etc/init.d</path> не пÑоÑÑо в ÑлÑÑайном поÑÑдке. Ðолее Ñого, запÑÑкаÑÑÑÑ >не вÑе ÑÑенаÑии из <path>/etc/init.d</path>, а ÑолÑко Ñе, коÑоÑÑе пÑедпиÑано >иÑполнÑÑÑ. РеÑение о запÑÑке ÑÑенаÑÐ¸Ñ Ð¿ÑинимаеÑÑÑ Ð² ÑезÑлÑÑаÑе пÑоÑмоÑÑа >каÑалога <path>/etc/runlevels</path>. ></p> > ><p> >Ðо-пеÑвÑÑ , <c>init</c> запÑÑÐºÐ°ÐµÑ Ð²Ñе ÑÑенаÑии из <path>/etc/init.d</path>, на >коÑоÑÑе еÑÑÑ ÑимволÑнÑе ÑÑÑлки из <path>/etc/runlevels/boot</path>. ÐбÑÑно >ÑÑенаÑии запÑÑкаÑÑÑÑ Ð² алÑавиÑном поÑÑдке, но в некоÑоÑÑÑ ÑÑенаÑиÑÑ Ð¸Ð¼ÐµÐµÑÑÑ >инÑоÑмаÑÐ¸Ñ Ð¾ завиÑимоÑÑÑÑ Ð¾Ñ Ð´ÑÑÐ³Ð¸Ñ ÑÑенаÑиев, ÑказÑваÑÑÐ°Ñ ÑиÑÑеме на >Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ð¾ÑÑÑ Ð¸Ñ Ð¿ÑедваÑиÑелÑного запÑÑка. ></p> > ><p> >Ðогда вÑе ÑÑенаÑии, ÑказаннÑе в <path>/etc/runlevels/boot</path>, бÑдÑÑ >вÑполненÑ, <c>init</c> пеÑÐµÑ Ð¾Ð´Ð¸Ñ Ðº запÑÑÐºÑ ÑÑенаÑиев, на коÑоÑÑе еÑÑÑ >ÑимволÑнÑе ÑÑÑлки из <path>/etc/runlevels/default</path>. Ð Ñнова запÑÑк >пÑоиÑÑ Ð¾Ð´Ð¸Ñ Ð² алÑавиÑном поÑÑдке, пока в ÑÑенаÑии не вÑÑÑеÑиÑÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¾ >завиÑимоÑÑÑÑ ; Ñогда поÑÑдок изменÑеÑÑÑ Ð´Ð»Ñ Ð¾Ð±ÐµÑпеÑÐµÐ½Ð¸Ñ Ð¿ÑавилÑного поÑÑдка >запÑÑка. ></p> > ></body> ></subsection> ><subsection> ><title>Ðак ÑабоÑÐ°ÐµÑ init</title> ><body> > ><p> >ÐонеÑно, <c>init</c> не пÑÐ¸Ð½Ð¸Ð¼Ð°ÐµÑ ÑеÑений Ñам по Ñебе. ÐÐ¼Ñ Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼ >конÑигÑÑаÑионнÑй Ñайл, где опиÑÐ°Ð½Ñ Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе дейÑÑвиÑ. ÐÑÐ¾Ñ Ñайл — ><path>/etc/inittab</path>. ></p> > ><p> >ÐÑли Ð²Ñ Ð·Ð°Ð¿Ð¾Ð¼Ð½Ð¸Ð»Ð¸ поÑледоваÑелÑноÑÑÑ Ð·Ð°Ð³ÑÑзки, опиÑаннÑÑ ÑÑÑÑ Ñанее, Ð²Ñ >вÑпомниÑе, ÑÑо пеÑвое дейÑÑвие <c>init</c> — ÑÑо монÑиÑование вÑÐµÑ ÑайловÑÑ >ÑиÑÑем. ÐÑо опÑеделÑеÑÑÑ Ð² ÑÑÑоке <path>/etc/inittab</path>, пÑиведенной ниже: ></p> > ><pre caption="СÑÑока иниÑиализаÑии ÑиÑÑÐµÐ¼Ñ Ð¸Ð· /etc/inittab"> >si::sysinit:/sbin/rc sysinit ></pre> > ><p> >ÐÑой ÑÑÑокой пÑоÑеÑÑÑ <c>init</c> пÑедпиÑÑваеÑÑÑ Ð²ÑполниÑÑ <c>/sbin/rc >sysinit</c> Ð´Ð»Ñ Ð¸Ð½Ð¸ÑиализаÑии ÑиÑÑемÑ. Самой иниÑиализаÑией занимаеÑÑÑ >ÑÑенаÑий <path>/sbin/rc</path>, Ñак ÑÑо можно ÑказаÑÑ, ÑÑо <c>init</c> Ð´ÐµÐ»Ð°ÐµÑ >не ÑлиÑком много — он пÑоÑÑо делегиÑÑÐµÑ Ð·Ð°Ð´Ð°ÑÑ Ð¿Ð¾ иниÑиализаÑии ÑиÑÑÐµÐ¼Ñ >дÑÑÐ³Ð¾Ð¼Ñ Ð¿ÑоÑеÑÑÑ. ></p> > ><p> >Ðо-вÑоÑÑÑ , <c>init</c> вÑполнÑÐµÑ Ð²Ñе ÑÑенаÑии, на коÑоÑÑе еÑÑÑ ÑимволÑнÑе >ÑÑÑлки из <path>/etc/runlevels/boot</path>. ÐÑо опÑеделÑеÑÑÑ ÑледÑÑÑей ÑÑÑокой: ></p> > ><pre caption="ÐниÑиализаÑÐ¸Ñ ÑиÑÑемÑ, пÑодолжение"> >rc::bootwait:/sbin/rc boot ></pre> > ><p> >Ð Ñнова вÑе Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе дейÑÑÐ²Ð¸Ñ Ð²ÑполнÑÑÑÑÑ ÑÑенаÑием <c>rc</c>. ÐамеÑÑÑе, ÑÑо >паÑамеÑÑ, пеÑеданнÑй <c>rc</c> (<e>boot</e>), ÑÐ¾Ð²Ð¿Ð°Ð´Ð°ÐµÑ Ñ Ð½Ð°Ð·Ð²Ð°Ð½Ð¸ÐµÐ¼ >иÑполÑзÑемого подкаÑалога в <path>/etc/runlevels</path>. ></p> > ><p> >ТепеÑÑ <c>init</c> пÑовеÑÑÐµÑ Ñвой конÑигÑÑаÑионнÑй Ñайл, ÑÑÐ¾Ð±Ñ Ð¾Ð¿ÑеделиÑÑ, >какой <e>ÑÑÐ¾Ð²ÐµÐ½Ñ Ð·Ð°Ð¿ÑÑка</e> иÑполÑзоваÑÑ. ÐÐ»Ñ ÑÑого из ><path>/etc/inittab</path> ÑÑиÑÑваеÑÑÑ ÑÑÑока: ></p> > ><pre caption="СÑÑока initdefault"> >id:3:initdefault: ></pre> > ><p> >РпÑиведенном пÑимеÑе (коÑоÑÑй Ð¿Ð¾Ð´Ñ Ð¾Ð´Ð¸Ñ Ð´Ð»Ñ Ð¿Ð¾Ð´Ð°Ð²Ð»ÑÑÑего болÑÑинÑÑва >полÑзоваÑелей Gentoo) Ð½Ð¾Ð¼ÐµÑ <e>ÑÑÐ¾Ð²Ð½Ñ Ð·Ð°Ð¿ÑÑка</e> — 3. ÐолÑзÑÑÑÑ ÑÑой >инÑоÑмаÑей, <c>init</c> пÑовеÑÑеÑ, ÑÑо нÑжно вÑполниÑÑ Ð´Ð»Ñ Ð·Ð°Ð¿ÑÑка <e>ÑÑÐ¾Ð²Ð½Ñ >запÑÑка 3</e>: ></p> > ><pre caption="ÐпÑеделение ÑÑовней запÑÑка"> >l0:0:wait:/sbin/rc shutdown >l1:S1:wait:/sbin/rc single >l2:2:wait:/sbin/rc nonetwork >l3:3:wait:/sbin/rc default >l4:4:wait:/sbin/rc default >l5:5:wait:/sbin/rc default >l6:6:wait:/sbin/rc reboot ></pre> > ><p> >Ð ÑÑÑоке, опÑеделÑÑÑей ÑÑÐ¾Ð²ÐµÐ½Ñ 3, Ð´Ð»Ñ Ð·Ð°Ð¿ÑÑка ÑлÑжб Ñнова иÑполÑзÑеÑÑÑ ÑÑенаÑий ><c>rc</c> (на ÑÑÐ¾Ñ Ñаз Ñ Ð°ÑгÑменÑом <e>default</e>). ÐпÑÑÑ-Ñаки, обÑаÑиÑе >внимание, ÑÑо аÑгÑменÑ, пеÑедаваемÑй ÑÑенаÑÐ¸Ñ <c>rc</c>, ÑÐ¾Ð²Ð¿Ð°Ð´Ð°ÐµÑ Ñ Ð½Ð°Ð·Ð²Ð°Ð½Ð¸ÐµÐ¼ >подкаÑалога из <path>/etc/runlevels</path>. ></p> > ><p> >Ðо оконÑании ÑабоÑÑ <c>rc</c>, <c>init</c> пÑÐ¸Ð½Ð¸Ð¼Ð°ÐµÑ ÑеÑение о Ñом, какие >виÑÑÑалÑнÑе конÑоли вклÑÑиÑÑ Ð¸ какие ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ Ð²ÑполниÑÑ Ð² каждой из Ð½Ð¸Ñ : ></p> > ><pre caption="ÐпÑеделение виÑÑÑалÑнÑÑ ÐºÐ¾Ð½Ñолей"> >c1:12345:respawn:/sbin/agetty 38400 tty1 linux >c2:12345:respawn:/sbin/agetty 38400 tty2 linux >c3:12345:respawn:/sbin/agetty 38400 tty3 linux >c4:12345:respawn:/sbin/agetty 38400 tty4 linux >c5:12345:respawn:/sbin/agetty 38400 tty5 linux >c6:12345:respawn:/sbin/agetty 38400 tty6 linux ></pre> > > ></body> ></subsection> ><subsection> ><title>ЧÑо Ñакое ÑÑÐ¾Ð²ÐµÐ½Ñ Ð·Ð°Ð¿ÑÑка?</title> ><body> > ><p> >Ðак Ð²Ñ Ð·Ð°Ð¼ÐµÑили, <c>init</c> пÑименÑÐµÑ Ð½ÑмеÑаÑÐ¸Ñ Ð´Ð»Ñ Ð¾Ð¿ÑÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ <e>ÑÑÐ¾Ð²Ð½Ñ >запÑÑка</e>, коÑоÑÑй надо иÑполÑзоваÑÑ. <e>УÑÐ¾Ð²ÐµÐ½Ñ Ð·Ð°Ð¿ÑÑка</e> — ÑÑо Ñо >ÑоÑÑоÑние, в коÑоÑом запÑÑкаеÑÑÑ Ð²Ð°Ñа ÑиÑÑема, он ÑодеÑÐ¶Ð¸Ñ Ð½Ð°Ð±Ð¾Ñ >ÑÑенаÑиев (ÑÑенаÑиев ÑÑÐ¾Ð²Ð½Ñ Ð·Ð°Ð¿ÑÑка или <e>ÑÑенаÑиев иниÑиализаÑии >[initscript]</e>), коÑоÑÑе ÑледÑÐµÑ Ð²ÑполнÑÑÑ, пÑи Ð²Ñ Ð¾Ð´Ðµ и вÑÑ Ð¾Ð´Ðµ из >опÑеделенного ÑÑÐ¾Ð²Ð½Ñ Ð·Ð°Ð¿ÑÑка. ></p> > ><p> >Ð Gentoo опÑеделено ÑÐµÐ¼Ñ ÑÑовней запÑÑка: ÑÑи ÑлÑжебнÑÑ Ð¸ ÑеÑÑÑе >опÑеделÑемÑÑ Ð¿Ð¾Ð»ÑзоваÑелем. СлÑжебнÑе назÑваÑÑÑÑ <e>sysinit</e>, ><e>shutdown</e> и <e>reboot</e>. ÐейÑÑвиÑ, ÑовеÑÑаемÑе ими, в ÑоÑноÑÑи >ÑооÑвеÑÑÑвÑÑÑ Ð¸Ñ Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñм: иниÑиализаÑÐ¸Ñ ÑиÑÑемÑ, вÑклÑÑение ÑиÑÑÐµÐ¼Ñ Ð¸ ее >пеÑезагÑÑзка. ></p> > ><p> >ÐпÑеделÑемÑе полÑзоваÑелем ÑÑовни — ÑÑо Ñе, коÑоÑÑм ÑооÑвеÑÑÑвÑÑÑ >подкаÑалоги в <path>/etc/runlevels</path>: <path>boot</path>, ><path>default</path>, <path>nonetwork</path> и <path>single</path>. УÑÐ¾Ð²ÐµÐ½Ñ ><path>boot</path> запÑÑÐºÐ°ÐµÑ Ð²Ñе ÑлÑжбÑ, Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе ÑиÑÑеме и иÑполÑзÑемÑе >вÑеми оÑÑалÑнÑми ÑÑовнÑми. ÐÑÑалÑнÑе ÑÑовни оÑлиÑаÑÑÑÑ Ð´ÑÑг Ð¾Ñ Ð´ÑÑга >запÑÑкаемÑми ÑлÑжбами: <path>default</path> иÑполÑзÑеÑÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð²Ñедневной >ÑабоÑÑ, <path>nonetwork</path> — Ð´Ð»Ñ ÑÐµÑ ÑлÑÑаев, когда не ÑÑебÑеÑÑÑ >ÑеÑÑ, а <path>single</path> — пÑи Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ð¾ÑÑи воÑÑÑÐ°Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ ÑиÑÑемÑ. ></p> > ></body> ></subsection> ><subsection> ><title>РабоÑа Ñо ÑÑенаÑиÑми иниÑиализаÑии</title> ><body> > ><p> >СÑенаÑии, запÑÑкаемÑе пÑоÑеÑÑом <c>rc</c>, назÑваÑÑÑÑ <e>ÑÑенаÑиÑми >иниÑиализаÑии</e>. ÐаждÑй ÑÑенаÑий из <path>/etc/init.d</path> Ð¼Ð¾Ð¶ÐµÑ >запÑÑкаÑÑÑÑ Ñ Ð°ÑгÑменÑами <e>start</e>, <e>stop</e>, <e>restart</e>, ><e>pause</e>, <e>zap</e>, <e>status</e>, <e>ineed</e>, <e>iuse</e>, ><e>needsme</e>, <e>usesme</e> и <e>broken</e>. ></p> > ><p> >ÐÐ»Ñ Ð·Ð°Ð¿ÑÑка, оÑÑановки или пеÑезапÑÑка ÑлÑÐ¶Ð±Ñ (и вÑÐµÑ , завиÑÑÑÐ¸Ñ Ð¾Ñ Ð½ÐµÐµ) >ÑледÑÐµÑ Ð¸ÑполÑзоваÑÑ <c>start</c>, <c>stop</c> и <c>restart</c>: ></p> > ><pre caption="ÐапÑÑк postfix"> ># <i>/etc/init.d/postfix start</i> ></pre> > ><note> >ÐÑÑанавливаÑÑÑÑ Ð¸Ð»Ð¸ пеÑезапÑÑкаÑÑÑÑ ÑолÑко Ñе ÑлÑжбÑ, коÑоÑÑм <e>Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ð°</e> >Ð´Ð°Ð½Ð½Ð°Ñ ÑлÑжба. ÐÑÑалÑнÑе завиÑимÑе ÑлÑÐ¶Ð±Ñ (Ñе, коÑоÑÑе <e>иÑполÑзÑÑÑ</e> >ÑлÑжбÑ, но не нÑждаÑÑÑÑ Ð² ней) ÑÑа опеÑаÑÐ¸Ñ Ð½Ðµ заÑÑагиваеÑ. ></note> > ><p> >ÐÑли Ð²Ñ Ñ Ð¾ÑиÑе оÑÑановиÑÑ ÑлÑжбÑ, но оÑÑавиÑÑ Ð·Ð°Ð²Ð¸ÑимÑе Ð¾Ñ Ð½ÐµÐµ ÑабоÑаÑÑими, >можно иÑполÑзоваÑÑ Ð°ÑгÑÐ¼ÐµÐ½Ñ <c>pause</c>: ></p> > ><pre caption="ÐÑÑановка postfix без оÑÑановки завиÑимÑÑ ÑлÑжб"> ># <i>/etc/init.d/postfix pause</i> ></pre> > ><p> >ЧÑÐ¾Ð±Ñ ÑзнаÑÑ ÑекÑÑее ÑоÑÑоÑние ÑлÑÐ¶Ð±Ñ (запÑÑена, оÑÑановлена, >пÑиоÑÑановлена и Ñ.д.), можно иÑполÑзоваÑÑ Ð°ÑгÑÐ¼ÐµÐ½Ñ <c>status</c>: ></p> > ><pre caption="ÐнÑоÑмаÑÐ¸Ñ Ð¾ ÑоÑÑоÑнии postfix"> ># <i>/etc/init.d/postfix status</i> ></pre> > ><p> >ÐÑли Ñказано, ÑÑо ÑлÑжба ÑабоÑаеÑ, но Ð²Ñ Ð·Ð½Ð°ÐµÑе, ÑÑо ÑÑо не Ñак, можно ÑбÑоÑиÑÑ >ÑоÑÑоÑние на stopped (оÑÑановлена), иÑполÑзÑÑ Ð°ÑгÑÐ¼ÐµÐ½Ñ <c>zap</c>: ></p> > ><pre caption="СбÑÐ¾Ñ Ð¸Ð½ÑоÑмаÑии о ÑоÑÑоÑнии postfix"> ># <i>/etc/init.d/postfix zap</i> ></pre> > ><p> >ÐÐ»Ñ Ñого, ÑÑÐ¾Ð±Ñ Ð²ÑÑÑниÑÑ Ð·Ð°Ð²Ð¸ÑимоÑÑи ÑлÑжбÑ, можно иÑполÑзоваÑÑ Ð°ÑгÑменÑÑ ><c>iuse</c> или <c>ineed</c>. С помоÑÑÑ <c>ineed</c> Ð²Ñ ÑвидиÑе Ñе ÑлÑжбÑ, >коÑоÑÑе дейÑÑвиÑелÑно Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñ Ð´Ð»Ñ Ð¿ÑавилÑного ÑÑнкÑиониÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð¸Ð½ÑеÑеÑÑÑÑей >Ð²Ð°Ñ ÑлÑжбÑ. С дÑÑгой ÑÑоÑонÑ, <c>iuse</c> Ð¿Ð¾ÐºÐ°Ð¶ÐµÑ Ñе ÑлÑжбÑ, коÑоÑÑе могÑÑ >иÑполÑзоваÑÑÑÑ Ð½Ð°Ñей ÑлÑжбой, но не обÑзаÑелÑÐ½Ñ Ð´Ð»Ñ ÐµÐµ ÑабоÑÑ. ></p> > ><pre caption="ÐапÑÐ¾Ñ ÑпиÑка вÑÐµÑ Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼ÑÑ ÑлÑжб, Ð¾Ñ ÐºÐ¾ÑоÑÑÑ Ð·Ð°Ð²Ð¸ÑÐ¸Ñ Postfix"> ># <i>/etc/init.d/postfix ineed</i> ></pre> > ><p> >ÐналогиÑно Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе ÑзнаÑÑ, какие ÑлÑÐ¶Ð±Ñ Ð½ÑждаÑÑÑÑ Ð² данной ÑлÑжбе >(<c>needsme</c>) или могÑÑ ÐµÐµ иÑполÑзоваÑÑ (<c>usesme</c>): ></p> > ><pre caption="ÐапÑÐ¾Ñ ÑпиÑка вÑÐµÑ ÑлÑжб, коÑоÑÑм Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼ Postfix"> ># <i>/etc/init.d/postfix needsme</i> ></pre> > ><p> >ÐаконеÑ, можно пÑоÑмоÑÑеÑÑ ÑпиÑок ÑлÑжб, ÑÑебÑÑÑÐ¸Ñ ÑÑ Ð´Ð»Ñ Ð´Ð°Ð½Ð½Ð¾Ð¹, но >оÑÑÑÑÑÑвÑÑÑÐ¸Ñ Ð² ÑиÑÑеме: ></p> > ><pre caption="ÐапÑÐ¾Ñ ÑпиÑка ÑлÑжб, Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼ÑÑ Postfix, но оÑÑÑÑÑÑвÑÑÑÐ¸Ñ "> ># <i>/etc/init.d/postfix broken</i> ></pre> > ></body> ></subsection> ></section> ><section> ><title>ÐÑполÑзование rc-update</title> ><subsection> ><title>ЧÑо Ñакое rc-update?</title> ><body> > ><p> >СиÑÑема иниÑиализаÑии Gentoo иÑполÑзÑÐµÑ Ð´ÐµÑево завиÑимоÑÑей Ð´Ð»Ñ Ð¾Ð¿ÑÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ >ÑлÑжб, коÑоÑÑе запÑÑкаÑÑÑÑ Ð² пеÑвÑÑ Ð¾ÑеÑедÑ. Т. к. ÑÑо оÑÐµÐ½Ñ ÑÑомиÑелÑное >занÑÑие, и Ð¼Ñ Ð½Ðµ Ñ Ð¾Ñели, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ Ð·Ð°Ð½Ð¸Ð¼Ð°Ð»ÑÑ ÑÑим вÑÑÑнÑÑ, Ð¼Ñ >ÑазÑабоÑали инÑÑÑÑменÑÑ, ÑпÑоÑаÑÑие ÑпÑавление ÑÑовнÑми запÑÑка и ÑÑенаÑиÑми >иниÑиализаÑии. ></p> > ><p> >ÐÑполÑзÑÑ <c>rc-update</c>, можно вклÑÑаÑÑ Ð¸ иÑклÑÑаÑÑ ÑÑенаÑии иниÑиализаÑии >из ÑÑовней запÑÑка. Ðз <c>rc-update</c> авÑомаÑиÑеÑки запÑÑкаеÑÑÑ ÑÑенаÑий ><c>depscan.sh</c> Ð´Ð»Ñ Ð¿ÐµÑеÑÑÑÐ¾ÐµÐ½Ð¸Ñ Ð´ÐµÑева завиÑимоÑÑей. ></p> > ></body> ></subsection> ><subsection> ><title>Ðобавление и Ñдаление ÑлÑжб</title> ><body> > ><p> >РпÑоÑеÑÑе ÑÑÑановки Gentoo Ð²Ñ Ñже добавлÑли ÑÑенаÑии иниÑиализаÑии в ÑÑÐ¾Ð²ÐµÐ½Ñ >запÑÑка «default». Ð ÑÐ¾Ñ Ð¼Ð¾Ð¼ÐµÐ½Ñ Ð²Ñ, возможно, не имели понÑÑиÑ, ÑÑо >Ñакое «default» и заÑем он нÑжен, но ÑепеÑÑ Ð²Ñ Ð²Ñе ÑÑо знаеÑе. >СÑенаÑÐ¸Ñ <c>rc-update</c> ÑÑебÑеÑÑÑ Ð²ÑоÑой аÑгÑменÑ, опÑеделÑÑÑий дейÑÑвие: ><e>add</e> (добавиÑÑ), <e>del</e> (ÑдалиÑÑ) или <e>show</e> (показаÑÑ). ></p> > ><p> >ÐÐ»Ñ Ñого, ÑÑÐ¾Ð±Ñ Ð´Ð¾Ð±Ð°Ð²Ð¸ÑÑ Ð¸Ð»Ð¸ ÑдалиÑÑ ÑÑенаÑий, пÑоÑÑо введиÑе <c>rc-update</c> >Ñ Ð°ÑгÑменÑом <c>add</c> или <c>del</c>, заÑем название ÑÑенаÑÐ¸Ñ Ð¸ ÑÑÐ¾Ð²Ð½Ñ >запÑÑка. ÐапÑимеÑ: ></p> > ><pre caption="Удаление Postfix из ÑÑÐ¾Ð²Ð½Ñ Ð·Ð°Ð¿ÑÑка default"> ># <i>rc-update del postfix default</i> ></pre> > ><p> >Ðо команде <c>rc-update -v show</c> вÑводиÑÑÑ ÑпиÑок вÑÐµÑ Ð´Ð¾ÑÑÑпнÑÑ ÑÑенаÑиев Ñ >Ñказанием ÑооÑвеÑÑÑвÑÑÑÐ¸Ñ ÑÑовней запÑÑка: ></p> > ><pre caption="ÐолÑÑение инÑоÑмаÑии о ÑÑенаÑиÑÑ Ð¸Ð½Ð¸ÑиализаÑии"> ># <i>rc-update -v show</i> ></pre> > ><p> >ÐÑ Ñакже можеÑе запÑÑÑиÑÑ <c>rc-update show</c> (без <c>-v</c>) ÑÑÐ¾Ð±Ñ Ð¿ÑоÑÑо >пÑоÑмоÑÑеÑÑ Ð²ÐºÐ»ÑÑеннÑе иниÑиализаÑионнÑе ÑкÑипÑÑ Ð¸ Ð¸Ñ ÑÑовни запÑÑка. ></p> > ></body> ></subsection> ></section> ><section> ><title>ÐаÑÑÑойка ÑлÑжб</title> ><subsection> ><title>ÐоÑÐµÐ¼Ñ Ð½Ñжна дополниÑелÑÐ½Ð°Ñ Ð½Ð°ÑÑÑойка?</title> ><body> > ><p> >СÑенаÑии иниÑиализаÑии могÑÑ Ð±ÑÑÑ Ð²ÐµÑÑма ÑложнÑ. ÐоÑÑÐ¾Ð¼Ñ Ð½ÐµÐ¶ÐµÐ»Ð°ÑелÑно допÑÑкаÑÑ >непоÑÑедÑÑвенное ÑедакÑиÑование ÑÑенаÑÐ¸Ñ Ð¿Ð¾Ð»ÑзоваÑелÑми, Ñ.к. ÑÑо Ð¼Ð¾Ð¶ÐµÑ >пÑивнеÑÑи в ÑиÑÑÐµÐ¼Ñ Ð¼Ð½Ð¾Ð¶ÐµÑÑво оÑибок. Ðо, Ñ Ð´ÑÑгой ÑÑоÑонÑ, Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ð¾ >пÑавилÑно наÑÑÑоиÑÑ ÑлÑжбÑ. ÐапÑимеÑ, Ð¼Ð¾Ð¶ÐµÑ Ð¿Ð¾Ð½Ð°Ð´Ð¾Ð±Ð¸ÑÑÑÑ Ð¿ÐµÑедаÑÑ ÑлÑжбе >дополниÑелÑнÑе паÑамеÑÑÑ. ></p> > ><p> >ÐÑоÑÐ°Ñ Ð¿ÑиÑина, по коÑоÑой наÑÑÑойки Ñ ÑанÑÑÑÑ Ð¾ÑделÑно Ð¾Ñ Ñамого ÑÑенаÑÐ¸Ñ >— ÑÑо возможноÑÑÑ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ ÑÑенаÑÐ¸Ñ Ð±ÐµÐ· опаÑениÑ, ÑÑо вÑе ваÑи >наÑÑÑойки бÑдÑÑ ÑÑеÑÑнÑ. ></p> > ></body> ></subsection> ><subsection> ><title>ÐаÑалог /etc/conf.d</title> ><body> > ><p> >Ð Gentoo пÑедÑÑмоÑÑен оÑÐµÐ½Ñ Ð¿ÑоÑÑой ÑпоÑоб наÑÑÑойки ÑлÑжб: Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ >ÑÑенаÑиÑ, пÑедполагаÑÑего наÑÑÑойкÑ, в каÑалоге <path>/etc/conf.d</path> >еÑÑÑ ÐºÐ¾Ð½ÑигÑÑаÑионнÑй Ñайл. ÐапÑимеÑ, Ñ ÑÑенаÑиÑ, запÑÑкаÑÑего apache2 >(под названием <path>/etc/init.d/apache2</path>) еÑÑÑ ÐºÐ¾Ð½ÑигÑÑаÑионнÑй Ñайл ><path>/etc/conf.d/apache2</path>, где могÑÑ Ñ ÑаниÑÑÑÑ Ð½ÑжнÑе вам паÑамеÑÑÑ, >пеÑедаваемÑе ÑеÑвеÑÑ Apache 2 пÑи запÑÑке: ></p> > ><pre caption="ÐеÑеменнаÑ, опÑÐµÐ´ÐµÐ»ÐµÐ½Ð½Ð°Ñ Ð² /etc/conf.d/apache2"> >APACHE2_OPTS="-D PHP5" ></pre> > ><p> >Такие ÑÐ°Ð¹Ð»Ñ Ð½Ð°ÑÑÑоек ÑодеÑÐ¶Ð°Ñ Ð¾Ð´Ð½Ð¸ пеÑеменнÑе (наподобие ><path>/etc/portage/make.conf</path>), облегÑÐ°Ñ Ð½Ð°ÑÑÑÐ¾Ð¹ÐºÑ ÑлÑжб. ÐÑо Ñакже позволÑÐµÑ Ð½Ð°Ð¼ >даваÑÑ Ð±Ð¾Ð»ÑÑе инÑоÑмаÑии о пеÑеменнÑÑ (в комменÑаÑиÑÑ ). ></p> > ></body> ></subsection> ></section> ><section> ><title>ÐапиÑание ÑÑенаÑиев иниÑиализаÑии</title> ><subsection> ><title>Ðне Ñоже пÑидеÑÑÑ?..</title> ><body> > ><p> >ÐеÑ, напиÑание ÑÑенаÑиев иниÑиализаÑии обÑÑно не ÑÑебÑеÑÑÑ, Ñ.к. Gentoo >ÑодеÑÐ¶Ð¸Ñ Ð³Ð¾ÑовÑе ÑÑенаÑии Ð´Ð»Ñ Ð²ÑÐµÑ Ð¿Ð¾Ð´Ð´ÐµÑживаемÑÑ ÑлÑжб. Ðднако, Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе >ÑÑÑановиÑÑ ÐºÐ°ÐºÑÑ-либо ÑлÑжбÑ, не иÑполÑзÑÑ ÑиÑÑÐµÐ¼Ñ Portage; в Ñаком ÑлÑÑае, >веÑоÑÑно, вам пÑидеÑÑÑ ÑоздаваÑÑ ÑÑенаÑий иниÑиализаÑии ÑамоÑÑоÑÑелÑно. ></p> > ><p> >Ðе иÑполÑзÑйÑе ÑÑенаÑий, идÑÑий Ñо ÑлÑжбой, еÑли он не напиÑан ÑпеÑиалÑно Ð´Ð»Ñ >Gentoo: ÑÑенаÑии иниÑиализаÑии Gentoo не ÑовмеÑÑÐ¸Ð¼Ñ Ñо ÑÑенаÑиÑми, >иÑполÑзÑемÑми в дÑÑÐ³Ð¸Ñ Ð´Ð¸ÑÑÑибÑÑÐ¸Ð²Ð°Ñ ! ></p> > ></body> ></subsection> ><subsection> ><title>СÑÑÑкÑÑÑа</title> ><body> > ><p> >ÐÑÐ½Ð¾Ð²Ð½Ð°Ñ ÑÑÑÑкÑÑÑа ÑÑенаÑÐ¸Ñ Ð¸Ð½Ð¸ÑиализаÑии показана ниже. ></p> > ><pre caption="ÐÑÐ½Ð¾Ð²Ð½Ð°Ñ ÑÑÑÑкÑÑÑа ÑÑенаÑиÑ"> >#!/sbin/runscript > >depend() { > <comment>(инÑоÑмаÑÐ¸Ñ Ð¾ завиÑимоÑÑÑÑ )</comment> >} > >start() { > <comment>(командÑ, Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе Ð´Ð»Ñ Ð·Ð°Ð¿ÑÑка ÑлÑжбÑ)</comment> >} > >stop() { > <comment>(командÑ, Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе Ð´Ð»Ñ Ð¾ÑÑановки ÑлÑжбÑ)</comment> >} ></pre> > ><p> >РлÑбом ÑÑенаÑии <e>должна</e> бÑÑÑ Ð¾Ð¿Ñеделена ÑÑнкÑÐ¸Ñ <c>start()</c>. ÐÑе >оÑÑалÑнÑе ÑÐ°Ð·Ð´ÐµÐ»Ñ Ð½ÐµÐ¾Ð±ÑзаÑелÑнÑ. ></p> > ></body> ></subsection> ><subsection> ><title>ÐавиÑимоÑÑи</title> ><body> > ><p> >СÑÑеÑÑвÑÑÑ Ð´Ð²Ðµ наÑÑÑойки, ÑабоÑаÑÑие Ñ Ð·Ð°Ð²Ð¸ÑимоÑÑÑми, коÑоÑÑе Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе >опÑеделиÑÑ, и они бÑдÑÑ Ð²Ð»Ð¸ÑÑÑ Ð½Ð° поÑÑдок запÑÑка иниÑиализаÑионнÑÑ >ÑкÑипÑов: <c>use</c> (иÑполÑзÑÑ) и <c>need</c> (нÑждаÑÑÑ). ÐÑоме ÑÑÐ¸Ñ Ð´Ð²ÑÑ , >ÑÑÑеÑÑвÑÑÑ ÐµÑе два влиÑÑÑÐ¸Ñ Ð½Ð° поÑÑдок загÑÑзки меÑода, назÑваÑÑÐ¸Ñ ÑÑ ><c>before</c> (пеÑед) и <c>after</c> (поÑле). ÐоÑледние два опÑеделÑÑÑ Ð½Ðµ >завиÑимоÑÑи, они не заÑÑавÑÑ Ð²ÑдаÑÑ Ð¾ÑÐ¸Ð±ÐºÑ ÑкÑипÑ, еÑли ÑÐ¾Ñ ÑкÑипÑ, ÑÑо в >Ð½Ð¸Ñ Ð¾Ð¿Ð¸Ñан вообÑе не должен запÑÑÑиÑÑÑÑ (или не запÑÑÑиÑÑÑ). ></p> > ><ul> > <li> > ÐаÑÑÑойка <c>use</c> инÑоÑмиÑÑÐµÑ ÑиÑÑÐµÐ¼Ñ init, ÑÑо даннÑй ÑкÑÐ¸Ð¿Ñ > <e>иÑполÑзÑеÑ</e> ÑÑнкÑионалÑноÑÑÑ Ð½ÐµÐºÐ¾ÑоÑого ÑкÑипÑа, но ÑÑÑого Ð¾Ñ > него не завиÑиÑ. ХоÑоÑим пÑимеÑом бÑÐ´ÐµÑ <c>use logger</c> или > <c>use dns</c>. ÐÑли ÑÑи ÑеÑвиÑÑ ÐµÑÑÑ, они бÑдÑÑ Ñ Ð¾ÑоÑо иÑполÑзоваÑÑÑÑ, > но еÑли Ñ Ð²Ð°Ñ Ð½ÐµÑ Ð»Ð¾Ð³Ð³ÐµÑа, или DNS-ÑеÑвеÑа, ÑеÑвиÑÑ Ð²Ñе Ñавно бÑдÑÑ > ÑабоÑаÑÑ. ÐÑли ÑеÑвиÑÑ ÑÑÑеÑÑвÑÑÑ, они бÑдÑÑ Ð·Ð°Ð¿ÑÑÐµÐ½Ñ Ð´Ð¾ Ñого, > как запÑÑÑиÑÑÑ ÑкÑипÑ, <c>иÑполÑзÑÑÑий</c> Ð¸Ñ . > </li> > <li> > ÐаÑÑÑойка <c>need</c> ÑÑо жеÑÑÐºÐ°Ñ Ð·Ð°Ð²Ð¸ÑимоÑÑÑ. Ðна ознаÑаеÑ, ÑÑо > ÑкÑипÑ, коÑоÑÐ¾Ð¼Ñ <c>нÑжен</c> дÑÑгой ÑкÑипÑ, не запÑÑÑиÑÑÑ, пока > дÑÑгой ÑкÑÐ¸Ð¿Ñ Ð½Ðµ запÑÑÑиÑÑÑ ÑÑпеÑно. Также, еÑли дÑÑгой ÑкÑÐ¸Ð¿Ñ > бÑÐ´ÐµÑ Ð¿ÐµÑезапÑÑен, Ñо ÑÑÐ¾Ñ Ñоже бÑÐ´ÐµÑ Ð¿ÐµÑезапÑÑен. > </li> > <li> > ÐÑи иÑполÑзовании <c>before</c>, даннÑй ÑкÑÐ¸Ð¿Ñ Ð·Ð°Ð¿ÑÑкаеÑÑÑ Ð´Ð¾ > некоÑоÑого ÑкÑипÑа, <e>еÑли</e> вÑбÑаннÑй ÑкÑÐ¸Ð¿Ñ ÑÑо ÑаÑÑÑ Ñого же > ÑÑÐ¾Ð²Ð½Ñ Ð¸Ð½Ð¸ÑиализаÑии. Так, иниÑиализаÑионнÑй ÑкÑÐ¸Ð¿Ñ <path>xdm</path>, > коÑоÑÑй опÑеделен <c>before alsasound</c> бÑÐ´ÐµÑ Ð·Ð°Ð¿ÑÑен до ÑкÑипÑа > <path>alsasound</path>, но ÑолÑко еÑли <path>alsasound</path> запланиÑован > запÑÑÑиÑÑÑÑ Ð½Ð° Ñом же ÑÑовне иниÑиализаÑии. ÐÑли <path>alsasound</path> > не запланиÑован запÑÑÑиÑÑÑÑ, Ñо ÑÑа конкÑеÑÐ½Ð°Ñ Ð½Ð°ÑÑÑойка не бÑÐ´ÐµÑ Ð¸Ð¼ÐµÑÑ > ÑÑÑекÑа, и <path>xdm</path> запÑÑÑиÑÑÑ Ð² ÑÐ¾Ñ Ð¼Ð¾Ð¼ÐµÐ½Ñ Ð²Ñемени, коÑоÑÑй > ÑиÑÑема init поÑÑиÑÐ°ÐµÑ Ð»ÑÑÑим ваÑианÑом. > </li> > <li> > ÐÐ¾Ñ Ð¾Ð¶Ð¸Ð¼ обÑазом, <c>after</c> инÑоÑмиÑÑÐµÑ ÑиÑÑÐµÐ¼Ñ init, ÑÑо даннÑй ÑкÑÐ¸Ð¿Ñ > нÑжно запÑÑÑиÑÑ Ð¿Ð¾Ñле некоÑоÑого ÑкÑипÑа, <e>еÑли</e> вÑбÑаннÑй ÑкÑÐ¸Ð¿Ñ > ÑвлÑеÑÑÑ ÑаÑÑÑÑ Ñого же ÑÑÐ¾Ð²Ð½Ñ Ð¸Ð½Ð¸ÑиализаÑии. ÐÑли неÑ, Ñо наÑÑÑойка не > Ð¸Ð¼ÐµÐµÑ ÑÑÑекÑа, и ÑкÑÐ¸Ð¿Ñ Ð±ÑÐ´ÐµÑ Ð·Ð°Ð¿ÑÑен ÑиÑÑемой init в Ð¼Ð¾Ð¼ÐµÐ½Ñ Ð²Ñемени, > коÑоÑÑй, как она поÑÑиÑаеÑ, бÑÐ´ÐµÑ Ð½Ð°Ð¸Ð»ÑÑÑим. > </li> ></ul> > ><p> >Ðз вÑÑенапиÑанного должно бÑÑÑ ÑÑно, ÑÑо <c>need</c> ÑÑо единÑÑÐ²ÐµÐ½Ð½Ð°Ñ >"дейÑÑвиÑелÑнаÑ" наÑÑÑойка завиÑимоÑÑей, Ñак как она влиÑÐµÑ Ð½Ð° Ñо, >бÑÐ´ÐµÑ Ð»Ð¸ запÑÑен ÑкÑÐ¸Ð¿Ñ Ð¸Ð»Ð¸ неÑ. ÐÑе оÑÑалÑнÑе ÑвлÑÑÑÑÑ Ð±Ð¾Ð»ÑÑе ÑказаÑелÑми >ÑиÑÑеме init, говоÑÑÑими в каком поÑÑдке ÑкÑипÑÑ Ð¼Ð¾Ð³ÑÑ (или должнÑ) >запÑÑкаÑÑÑÑ. ></p> > ><p> >ТепеÑÑ, еÑли Ð²Ñ Ð¿Ð¾ÑмоÑÑиÑе на многие из ÑÑÑеÑÑвÑÑÑÐ¸Ñ Ð¸Ð½Ð¸ÑиализаÑионнÑÑ >ÑкÑипÑов Gentoo, Ð²Ñ Ð·Ð°Ð¼ÐµÑиÑе, ÑÑо некоÑоÑÑе из Ð½Ð¸Ñ Ð¸Ð¼ÐµÑÑ Ð·Ð°Ð²Ð¸ÑимоÑÑи >Ð¾Ñ Ð²ÐµÑей, коÑоÑÑе не ÑвлÑÑÑÑÑ Ð¸Ð½Ð¸ÑиализаÑионнÑми ÑкÑипÑами. >ÐÑи "веÑи" Ð¼Ñ Ð½Ð°Ð·Ñваем <e>виÑÑÑалÑнÑми</e>. ></p> > ><p> ><e>ÐиÑÑÑалÑнаÑ</e> завиÑимоÑÑÑ — ÑÑо завиÑимоÑÑÑ Ð¾Ñ ÑÑнкÑий, >пÑедоÑÑавлÑемÑÑ ÑлÑжбой, но не какой-Ñо единÑÑвенной ÑлÑжбой. СÑенаÑий Ð¼Ð¾Ð¶ÐµÑ >завиÑеÑÑ Ð¾Ñ ÑлÑÐ¶Ð±Ñ ÑиÑÑемного жÑÑнала, но ÑÐ°ÐºÐ¸Ñ Ð´Ð¾ÑÑаÑоÑно много (metalogd, >syslog-ng, sysklogd и Ñ.п.). ÐоÑколÑÐºÑ Ð½ÐµÐ»ÑÐ·Ñ Ð½ÑждаÑÑÑÑ Ð² каждой из Ð½Ð¸Ñ >(ни в одной вÑазÑмиÑелÑной ÑиÑÑеме они не запÑÑÐµÐ½Ñ Ð²Ñе ÑÑазÑ), Ð¼Ñ Ð¾Ð±ÐµÑпеÑили ><c>пÑедоÑÑавление</c> виÑÑÑалÑной завиÑимоÑÑи вÑеми ÑÑими ÑлÑжбами. ></p> > ><p> >ÐавайÑе взглÑнем на инÑоÑмаÑÐ¸Ñ Ð¾ завиÑимоÑÑÑÑ postfix. ></p> > ><pre caption="ÐнÑоÑмаÑÐ¸Ñ Ð¾ завиÑимоÑÑÑÑ Postfix"> >depend() { > need net > use logger dns > provide mta >} ></pre> > ><p> >Ðак можно ÑвидеÑÑ, postfix: ></p> > ><ul> > <li> > ÑÑебÑÐµÑ ÑеÑÑ (<c>net</c>): виÑÑÑалÑÐ½Ð°Ñ Ð·Ð°Ð²Ð¸ÑимоÑÑÑ, ÑдовлеÑвоÑÑемаÑ, > напÑимеÑ, <path>/etc/init.d/net.eth0</path> > </li> > <li> > иÑполÑзÑÐµÑ Ð¶ÑÑнал (<c>logger</c>): виÑÑÑалÑÐ½Ð°Ñ Ð·Ð°Ð²Ð¸ÑимоÑÑÑ, > ÑдовлеÑвоÑÑемаÑ, напÑимеÑ, <path>/etc/init.d/syslog-ng</path> > </li> > <li> > иÑполÑзÑÐµÑ ÑлÑÐ¶Ð±Ñ Ð¸Ð¼ÐµÐ½ (<c>dns</c>): виÑÑÑалÑÐ½Ð°Ñ Ð·Ð°Ð²Ð¸ÑимоÑÑÑ, > ÑдовлеÑвоÑÑемаÑ, напÑимеÑ, <path>/etc/init.d/named</path>) > </li> > <li> > пÑедоÑÑавлÑÐµÑ Ð¿Ð¾ÑÑовÑй Ð°Ð³ÐµÐ½Ñ (<c>mta</c>): виÑÑÑалÑÐ½Ð°Ñ Ð·Ð°Ð²Ð¸ÑимоÑÑÑ, > обÑÐ°Ñ Ð´Ð»Ñ Ð²ÑÐµÑ Ð¿ÑогÑамм — поÑÑовÑÑ ÑеÑвеÑов > </li> ></ul> > ></body> ></subsection> ><subsection> ><title>ÐоÑÑдок запÑÑка</title> ><body> > ><p> >Ðак Ð¼Ñ Ð¾Ð¿Ð¸Ñали в пÑедÑдÑÑем Ñазделе, Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе ÑказаÑÑ ÑиÑÑеме init, >в каком поÑÑдке она должна запÑÑкаÑÑ (или оÑÑанавливаÑÑ) ÑкÑипÑÑ. >ÐÑÐ¾Ñ Ð¿Ð¾ÑÑдок поддеÑживаеÑÑÑ ÐºÐ°Ðº ÑеÑез наÑÑÑойки завиÑимоÑÑей ><c>use</c> и <c>need</c>, Ñак и ÑеÑез наÑÑÑойки поÑÑдка <c>before</c> и ><c>after</c>. Так как Ð¼Ñ Ð¾Ð¿Ð¸Ñали Ð¸Ñ Ñанее, давайÑе поÑмоÑÑим на ÑеÑÐ²Ð¸Ñ >Portmap, как на пÑÐ¸Ð¼ÐµÑ Ñакого иниÑиализаÑионного ÑкÑипÑа. ></p> > ><pre caption="ФÑнкÑÐ¸Ñ depend() ÑлÑÐ¶Ð±Ñ Portmap"> >depend() { > need net > before inetd > before xinetd >} ></pre> > ><p> >Также можно иÑполÑзоваÑÑ Ð·Ð½Ð°Ðº «*«, ÑÑÐ¾Ð±Ñ Ð¾Ñ Ð²Ð°ÑиÑÑ Ð²Ñе ÑлÑÐ¶Ð±Ñ >данного ÑÑÐ¾Ð²Ð½Ñ Ð·Ð°Ð¿ÑÑка, Ñ Ð¾ÑÑ ÑÑо не ÑекомендÑеÑÑÑ. ></p> > ><pre caption="ÐапÑÑк ÑÑенаÑÐ¸Ñ Ð¿ÐµÑвÑм на ÑÑовне запÑÑка"> >depend() { > before * >} ></pre> > ><p> >ÐÑли Ð²Ð°Ñ ÑеÑÐ²Ð¸Ñ Ð´Ð¾Ð»Ð¶ÐµÐ½ пиÑаÑÑ Ð½Ð° локалÑнÑе диÑки, он должен поÑÑебоваÑÑ ><c>localmount</c>. ÐÑли он ÑÑо-либо помеÑÑÐ¸Ñ Ð² <path>/var/run</path>, напÑимеÑ, >pid-Ñайл, Ñогда он должен запÑÑкаÑÑÑÑ Ð¿Ð¾Ñле <c>bootmisc</c>: ></p> > ><pre caption="ÐÑÐ¸Ð¼ÐµÑ ÑÑнкÑии depend()"> >depend() { >need localmount >after bootmisc >} ></pre> > ></body> ></subsection> ><subsection> ><title>СÑандаÑÑнÑе ÑÑнкÑии</title> ><body> > ><p> >Следом за Ñазделом <c>depend()</c> вам поÑÑебÑеÑÑÑ Ð¾Ð¿ÑеделиÑÑ ÑÑнкÑÐ¸Ñ ><c>start()</c>. Рней ÑодеÑжаÑÑÑ Ð²Ñе командÑ, Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе Ð´Ð»Ñ Ð·Ð°Ð¿ÑÑка ваÑей >ÑлÑжбÑ. РекомендÑеÑÑÑ Ð¿ÑименÑÑÑ ÑÑнкÑии <c>ebegin</c> и <c>eend</c> Ð´Ð»Ñ >ÑообÑений полÑзоваÑÐµÐ»Ñ Ð¾ Ñом, ÑÑо пÑоиÑÑ Ð¾Ð´Ð¸Ñ: ></p> > ><pre caption="ÐÑÐ¸Ð¼ÐµÑ ÑÑнкÑии start()"> >start() { > if [ "${RC_CMD}" = "restart" ]; > then > <comment># ЧÑо-нибÑÐ´Ñ ÑделаÑÑ, еÑли ÑеÑÑаÑÑ ÑÑебÑÐµÑ Ð±Ð¾Ð»ÑÑе, Ñем пÑоÑÑо > поÑледоваÑелÑнÑй запÑÑк stop и start</comment> > fi > > ebegin "ÐапÑÑк - моÑ_ÑлÑжба" > start-stop-daemon --start --exec /path/to/my_service \ > --pidfile /path/to/my_pidfile > eend $? >} ></pre> > ><p> >Ðак <c>--exec</c>, Ñак и <c>--pidfile</c> Ð´Ð¾Ð»Ð¶Ð½Ñ Ð¸ÑполÑзоваÑÑÑÑ Ð² >ÑÑнкÑиÑÑ start и stop. ÐÑли ÑеÑÐ²Ð¸Ñ Ð½Ðµ ÑÐ¾Ð·Ð´Ð°ÐµÑ pid-Ñайл, Ñогда >иÑполÑзÑйÑе <c>--make-pidfile</c>, еÑли возможно, Ñ Ð¾ÑÑ Ð»ÑÑÑе пÑоÑеÑÑиÑоваÑÑ >ÑÑо, ÑÑÐ¾Ð±Ñ Ð±ÑÑÑ ÑвеÑеннÑм. ÐнаÑе, не иÑполÑзÑйÑе пид-ÑайлÑ. ÐÑ Ñакже >можеÑе добавиÑÑ <c>--quiet</c> к опÑиÑм <c>start-stop-daemon</c>, но ÑÑо >не ÑекомендÑеÑÑÑ, еÑли ÑолÑко ÑеÑÐ²Ð¸Ñ Ð½Ðµ оÑÐµÐ½Ñ Ð¼Ð½Ð¾Ð³Ð¾ÑловнÑй. ÐÑполÑзование ><c>--quiet</c> Ð¼Ð¾Ð¶ÐµÑ ÑкÑÑÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ ÐµÑли ÑеÑÐ²Ð¸Ñ Ð½Ðµ ÑÐ¼Ð¾Ð¶ÐµÑ Ð·Ð°Ð¿ÑÑÑиÑÑÑÑ. ></p> > ><p> >ÐÑÑгой инÑеÑеÑной наÑÑÑойкой, иÑполÑзÑемой в вÑÑепÑиведенном пÑимеÑе ÑвлÑеÑÑÑ >пÑовеÑка ÑодеÑжимого пеÑеменной <c>RC_CMD</c>. РоÑлиÑие Ð¾Ñ Ð¿ÑедÑдÑÑей >иниÑиализаÑионной ÑиÑÑемÑ, Ð½Ð¾Ð²Ð°Ñ ÑиÑÑема <c>openrc</c> не поддеÑÐ¶Ð¸Ð²Ð°ÐµÑ >оÑделÑнÑÑ ÑÑнкÑионалÑноÑÑÑ restart Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ ÑкÑипÑа. ÐмеÑÑо ÑÑого, >ÑкÑÐ¸Ð¿Ñ Ð´Ð¾Ð»Ð¶ÐµÐ½ пÑовеÑиÑÑ ÑодеÑжимое пеÑеменной <c>RC_CMD</c>, ÑÑÐ¾Ð±Ñ Ð¿ÑовеÑиÑÑ, >вÑзÑваеÑÑÑ Ð»Ð¸ ÑÑнкÑÐ¸Ñ (как <c>start()</c>, Ñак и <c>stop()</c>) как ÑаÑÑÑ >restart, или неÑ. ></p> > ><note> >УдоÑÑовеÑÑÑеÑÑ, ÑÑо <c>--exec</c> дейÑÑвиÑелÑно вÑзÑÐ²Ð°ÐµÑ ÑеÑвиÑ, а не >shell-ÑкÑипÑ, коÑоÑÑй запÑÑÐºÐ°ÐµÑ ÑеÑвиÑÑ Ð¸ вÑÑ Ð¾Ð´Ð¸Ñ â ÑÑо должен делаÑÑ >Ñам иниÑиализаÑионнÑй ÑкÑипÑ. ></note> > ><p> >ÐÑли вам нÑÐ¶Ð½Ñ Ð´Ð¾Ð¿Ð¾Ð»Ð½Ð¸ÑелÑнÑе пÑимеÑÑ ÑÑнкÑии <c>start()</c>, пожалÑйÑÑа, >пÑоÑиÑайÑе иÑÑ Ð¾Ð´Ð½Ñе ÐºÐ¾Ð´Ñ ÑÑенаÑиев иниÑиализаÑии, Ð½Ð°Ñ Ð¾Ð´ÑÑÐ¸Ñ ÑÑ Ð² каÑалоге ><path>/etc/init.d</path>. ></p> > ><p> >ÐÑе одной ÑÑнкÑией, коÑоÑÑÑ Ð¼Ð¾Ð¶Ð½Ð¾ опÑеделиÑÑ, ÑвлÑеÑÑÑ <c>stop()</c>. >ÐÑ Ð²Ð°Ñ Ð½Ðµ ÑÑебÑеÑÑÑ Ð¾Ð¿Ñеделение ÑÑой ÑÑнкÑии! СиÑÑема >иниÑиализаÑии, пÑименÑÐµÐ¼Ð°Ñ Ð½Ð°Ð¼Ð¸, доÑÑаÑоÑно ÑазвиÑа и в ÑоÑÑоÑнии >ÑамоÑÑоÑÑелÑно заполниÑÑ ÑÑÑ ÑÑнкÑиÑ, еÑли Ð²Ñ Ð¸ÑполÑзÑеÑе ><c>start-stop-daemon</c>. ></p> > ><p> >Ðиже пÑиведен пÑÐ¸Ð¼ÐµÑ ÑÑнкÑии <c>stop()</c>: ></p> > ><pre caption="ÐÑÐ¸Ð¼ÐµÑ ÑÑнкÑии stop()"> >stop() { >ebegin "Stopping my_service" >start-stop-daemon --stop --exec /path/to/my_service \ >--pidfile /path/to/my_pidfile >eend $? >} ></pre> > ><p> >ÐÑли Ð²Ð°Ñ ÑеÑÐ²Ð¸Ñ Ð·Ð°Ð¿ÑÑÐºÐ°ÐµÑ Ð½ÐµÐºÐ¾ÑоÑÑй дÑÑгой ÑкÑÐ¸Ð¿Ñ (напÑимеÑ, на bash, >python или perl), и ÑÑÐ¾Ñ ÑкÑÐ¸Ð¿Ñ Ð¿Ð¾Ð·Ð´Ð½ÐµÐµ изменÑÐµÑ Ð¸Ð¼Ñ (напÑимеÑ, Ñ ><c>foo.py</c> на <c>foo</c>), Ñогда вам нÑжно добавиÑÑ <c>--name</c> к ><c>start-stop-daemon</c>. ÐÑ Ð´Ð¾Ð»Ð¶Ð½Ñ Ð¾Ð¿ÑеделиÑÑ Ð¸Ð¼Ñ, на коÑоÑое Ð¸Ð¼Ñ Ñайла >бÑÐ´ÐµÑ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¾. РпÑиведенном пÑимеÑе, ÑеÑÐ²Ð¸Ñ Ð·Ð°Ð¿ÑÑÐºÐ°ÐµÑ <c>foo.py</c>, а >поÑом ÑÑо Ð¸Ð¼Ñ Ð¼ÐµÐ½ÑеÑÑÑ Ð½Ð° <c>foo</c>: ></p> > ><pre caption="СеÑвиÑ, коÑоÑÑй запÑÑÐºÐ°ÐµÑ ÑкÑÐ¸Ð¿Ñ foo"> >start() { >ebegin "Starting my_script" >start-stop-daemon --start --exec /path/to/my_script \ >--pidfile /path/to/my_pidfile --name foo >eend $? >} ></pre> > ><p> >У <c>start-stop-daemon</c> еÑÑÑ Ð¾ÑлиÑÐ½Ð°Ñ man-ÑÑÑаниÑа, коÑоÑÑÑ Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе >поÑмоÑÑеÑÑ, еÑли вам нÑжна дополниÑелÑÐ½Ð°Ñ Ð¸Ð½ÑоÑмаÑиÑ. ></p> > ><pre caption="ÐолÑÑаем man-ÑÑÑаниÑÑ Ð´Ð»Ñ start-stop-daemon"> >$ <i>man start-stop-daemon</i> ></pre> > ><p> >СинÑакÑÐ¸Ñ ÑÑенаÑиев иниÑиализаÑии, пÑименÑемÑÑ Ð² Gentoo, оÑнован на >оболоÑке ÐоÑна (Bourne Again Shell — bash), поÑÑÐ¾Ð¼Ñ Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе Ñвободно >иÑполÑзоваÑÑ Ð²Ð½ÑÑÑи ÑÐ²Ð¾Ð¸Ñ ÑÑенаÑиев bash-ÑовмеÑÑимÑе конÑÑÑÑкÑии. >Ðднако Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе Ð·Ð°Ñ Ð¾ÑеÑÑ Ð½Ð°Ð¿Ð¸ÑаÑÑ Ð²Ð°Ñи иниÑиализаÑионнÑе ÑкÑипÑÑ Ñак, ÑÑÐ¾Ð±Ñ >они бÑли POSIX-ÑовмеÑÑимÑми. РбÑдÑÑем, ÑиÑÑÐµÐ¼Ñ Ð¸Ð½Ð¸ÑиализаÑионнÑÑ ÑкÑипÑов >могÑÑ Ð¿Ð¾Ð·Ð²Ð¾Ð»Ð¸ÑÑ Ð¸Ð·Ð¼ÐµÐ½Ð¸ÑÑ ÑимволиÑеÑкÑÑ ÑÑÑÐ»ÐºÑ <path>/bin/sh</path>, ÑÑÐ¾Ð±Ñ >она ÑказÑвала на дÑÑгие ÑеллÑ, а не ÑолÑко bash. ÐниÑиализаÑионнÑе ÑкÑипÑÑ, >коÑоÑÑе оÑÐ½Ð¾Ð²Ð°Ð½Ñ Ð½Ð° возможноÑÑÑÑ ÑолÑко bash на ÑÐ°ÐºÐ¸Ñ ÐºÐ¾Ð½ÑигÑÑаÑиÑÑ Ð¼Ð¾Ð³ÑÑ >оÑказаÑÑÑÑ ÑабоÑаÑÑ. ></p> > ></body> ></subsection> ><subsection> ><title>Ðобавление дополниÑелÑнÑÑ Ð¿Ð°ÑамеÑÑов</title> ><body> > ><p> >ÐÑли Ð²Ñ Ñ Ð¾ÑиÑе ввеÑÑи в ÑÑенаÑий дополниÑелÑнÑе паÑамеÑÑÑ, кÑоме ÑпоминавÑÐ¸Ñ ÑÑ, >нÑжно добавиÑÑ Ðº пеÑеменной <c>extra_commands</c> название паÑамеÑÑа и ÑоздаÑÑ ÑÑнкÑÐ¸Ñ >Ñ Ð½Ð°Ð·Ð²Ð°Ð½Ð¸ÐµÐ¼, ÑооÑвеÑÑÑвÑÑÑим паÑамеÑÑÑ. ÐапÑимеÑ, Ð´Ð»Ñ Ð¿Ð¾Ð´Ð´ÐµÑжки паÑамеÑÑа ><c>restartdelay</c>: ></p> > ><pre caption="Создание дополниÑелÑной ÑÑнкÑии restartdelay"> >extra_commands="restartdelay" > >restartdelay() { > stop > sleep 3 <comment># паÑза в 3 ÑекÑÐ½Ð´Ñ Ð¿ÐµÑед повÑоÑнÑм запÑÑком</comment> > start >} ></pre> > ><impo> >ФÑнкÑÐ¸Ñ <c>restart</c> не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿ÐµÑеназнаÑена в openrc! ></impo> > ></body> ></subsection> ><subsection> ><title>ÐеÑеменнÑе Ð´Ð»Ñ Ð½Ð°ÑÑÑойки ÑлÑжб</title> ><body> > ><p> >ÐÐ»Ñ Ð¿Ð¾Ð´Ð´ÐµÑжки конÑигÑÑаÑионного Ñайла в каÑалоге <path>/etc/conf.d</path> >ниÑего дополниÑелÑно делаÑÑ Ð½Ðµ нÑжно: пÑи запÑÑке ваÑего ÑÑенаÑÐ¸Ñ Ð¸Ð½Ð¸ÑиализаÑии >авÑомаÑиÑеÑки вклÑÑаÑÑÑÑ ÑледÑÑÑие ÑÐ°Ð¹Ð»Ñ (Ñ.е., пеÑеменнÑе из Ð½Ð¸Ñ ÑÑановÑÑÑÑ >доÑÑÑпнÑ): ></p> > ><ul> > <li><path>/etc/conf.d/<Ð²Ð°Ñ ÑÑенаÑий иниÑиализаÑии></path></li> > <li><path>/etc/conf.d/basic</path></li> > <li><path>/etc/rc.conf</path></li> ></ul> > ><p> >ÐÑли Ð²Ð°Ñ Ð¸Ð½Ð¸ÑиализаÑионнÑй ÑÑенаÑий пÑедоÑÑавлÑÐµÑ Ð²Ð¸ÑÑÑалÑнÑÑ Ð·Ð°Ð²Ð¸ÑимоÑÑÑ >(напÑимеÑ, <c>net</c>), Ñо Ñакже вклÑÑаеÑÑÑ Ñайл, ÑооÑвеÑÑÑвÑÑÑий ÑÑой >завиÑимоÑÑи (напÑимеÑ, <path>/etc/conf.d/net</path>). ></p> > ></body> ></subsection> ></section> ><section> ><title>Ðзменение Ð¿Ð¾Ð²ÐµÐ´ÐµÐ½Ð¸Ñ ÑÑовней запÑÑка</title> ><subsection> ><title>ÐÑо Ð¾Ñ ÑÑого вÑигÑаеÑ?</title> ><body> > ><p> >ÐолÑÑинÑÑÐ²Ñ Ð¿Ð¾Ð»ÑзоваÑелей ноÑÑбÑков знакома ÑиÑÑаÑиÑ: дома вам нÑжен запÑÑк ><c>net.eth0</c>, и наобоÑоÑ, в доÑоге запÑÑк <c>net.eth0</c> не нÑжен (Ñак как >ÑеÑÑ Ð½ÐµÐ´Ð¾ÑÑÑпна). Ð Gentoo можно изменÑÑÑ Ð¿Ð¾Ð²ÐµÐ´ÐµÐ½Ð¸Ðµ ÑÑовней запÑÑка по ÑÐ²Ð¾ÐµÐ¼Ñ >ÑÑмоÑÑениÑ. ></p> > ><p> >ÐапÑÐ¸Ð¼ÐµÑ Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе ÑоздаÑÑ Ð²ÑоÑой загÑÑжаемÑй ÑÑÐ¾Ð²ÐµÐ½Ñ Ð·Ð°Ð¿ÑÑка «Ð¿Ð¾ >ÑмолÑаниѻ, в коÑоÑом бÑдÑÑ Ð´ÑÑгие ÑÑенаÑии. ÐаÑем пÑи загÑÑзке Ð²Ñ >ÑможеÑе вÑбÑаÑÑ, какой из ÑÑовней по ÑмолÑÐ°Ð½Ð¸Ñ ÑледÑÐµÑ Ð¸ÑполÑзоваÑÑ. ></p> > ></body> ></subsection> ><subsection> ><title>ÐÑполÑзование пÑогÑаммного ÑÑÐ¾Ð²Ð½Ñ (softlevel)</title> ><body> > ><p> >ÐÑежде вÑего, ÑоздайÑе каÑалог Ð´Ð»Ñ Ñвоего вÑоÑого ÑÑÐ¾Ð²Ð½Ñ Ð·Ð°Ð¿ÑÑка «Ð¿Ð¾ >ÑмолÑаниѻ. ÐапÑимеÑ, Ñоздадим ÑÑÐ¾Ð²ÐµÐ½Ñ Ð·Ð°Ð¿ÑÑка <path>offline</path>: ></p> > ><pre caption="Создание каÑалога ÑÑÐ¾Ð²Ð½Ñ Ð·Ð°Ð¿ÑÑка"> ># <i>mkdir /etc/runlevels/offline</i> ></pre> > ><p> >ÐобавÑÑе Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ñе ÑÑенаÑии иниÑиализаÑии в ÑолÑко ÑÑо ÑозданнÑй ÑÑÐ¾Ð²ÐµÐ½Ñ >запÑÑка. ÐапÑимеÑ, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ ÑоÑнÑÑ ÐºÐ¾Ð¿Ð¸Ñ ÑÑÐ¾Ð²Ð½Ñ <c>default</c>, за >иÑклÑÑением <c>net.eth0</c>: ></p> > ><pre caption="Ðобавление нÑжнÑÑ ÑÑенаÑиев иниÑиализаÑии"> ><comment>(копиÑование вÑÐµÑ ÑлÑжб Ñ ÑÑÐ¾Ð²Ð½Ñ default в ÑÑÐ¾Ð²ÐµÐ½Ñ offline)</comment> ># <i>cd /etc/runlevels/default</i> ># <i>for service in *; do rc-update add $service offline; done</i> ><comment>(Ñдаление ненÑжнÑÑ ÑÑенаÑиев Ñ ÑÑÐ¾Ð²Ð½Ñ offline)</comment> ># <i>rc-update del net.eth0 offline</i> ><comment>(пÑоÑмоÑÑ ÑÑенаÑиев, запÑÑкаемÑÑ Ð½Ð° ÑÑовне offline)</comment> ># <i>rc-update show offline</i> ><comment>(ÑаÑÑÑ Ð²Ñведенного ÑпиÑка)</comment> > acpid | offline > domainname | offline > local | offline > net.eth0 | ></pre> > ><p> >Ðаже неÑмоÑÑÑ Ð½Ð° Ñо, ÑÑо <c>net.eth0</c> бÑл Ñдален Ñ ÑÑÐ¾Ð²Ð½Ñ Ð·Ð°Ð¿ÑÑка offline, >но <c>udev</c> Ð¼Ð¾Ð¶ÐµÑ Ð¿Ð¾Ð¿ÑÑаÑÑÑÑ Ð·Ð°Ð¿ÑÑÑиÑÑ Ð»ÑбÑе ÑÑÑÑойÑÑва, коÑоÑÑе >он найдеÑ, и запÑÑÑиÑÑ ÑооÑвеÑÑÑвÑÑÑие ÑеÑвиÑÑ. ÐÐ°Ð½Ð½Ð°Ñ ÑÑнкÑионалÑноÑÑÑ >назÑваеÑÑÑ <e>hotplugging</e>. Ðо ÑмолÑаниÑ, Gentoo оÑклÑÑÐ°ÐµÑ hotplugging. ></p> > ><p> >ÐÑли Ð²Ñ Ñ Ð¾ÑиÑе вклÑÑиÑÑ hotplugging, но ÑолÑко Ð´Ð»Ñ ÐºÐ¾Ð½ÐºÑеÑного набоÑа >ÑкÑипÑов, иÑполÑзÑйÑе пеÑеменнÑÑ <c>rc_hotplug</c> в <path>/etc/rc.conf</path>: ></p> > ><pre caption="ÐÑклÑÑаем ÑеÑвиÑÑ, иниÑииÑÑемÑе ÑÑÑÑойÑÑвами в /etc/rc.conf"> ><comment># РазÑеÑиÑÑ hotplugging Ð´Ð»Ñ net.wlan и лÑбого дÑÑгого ÑеÑвиÑа, кÑоме ># ÑÐµÑ , коÑоÑÑе попадаÑÑ Ð¿Ð¾Ð´ вÑÑажение net.*</comment> >rc_hotplug="net.wlan !net.*" ></pre> > ><note> >ÐÐ»Ñ Ð±Ð¾Ð»ÐµÐµ деÑалÑной инÑоÑмаÑии о ÑеÑвиÑÐ°Ñ , иниÑииÑÑемÑÑ ÑÑÑÑойÑÑвами, >пÑоÑмоÑÑиÑе комменÑаÑии в <path>/etc/rc.conf</path>. ></note> > ><p> >ТепеÑÑ Ð½ÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼Ð¾ оÑÑедакÑиÑоваÑÑ ÐºÐ¾Ð½ÑигÑÑаÑÐ¸Ñ Ð·Ð°Ð³ÑÑзÑика, добавив запиÑÑ Ð¾Ð± >ÑÑовне <c>offline</c>. ÐапÑимеÑ, в Ñайле <path>/boot/grub/grub.conf</path>: ></p> > ><pre caption="Ðобавление запиÑи об ÑÑовне offline"> >title ÐвÑономное иÑполÑзование Gentoo Linux > root (hd0,0) > kernel (hd0,0)/kernel-2.4.25 root=/dev/hda3 <i>softlevel=offline</i> ></pre> > ><p> >ÐÑалÑ, вÑе гоÑово. ТепеÑÑ, еÑли пÑи загÑÑзке Ð²Ñ Ð²ÑбеÑеÑе Ð²Ð½Ð¾Ð²Ñ ÑозданнÑÑ >запиÑÑ, Ñо вмеÑÑо <c>default</c> бÑÐ´ÐµÑ Ð¸ÑполÑзоваÑÑÑÑ ÑÑÐ¾Ð²ÐµÐ½Ñ <c>offline</c>. ></p> > ></body> ></subsection> ><subsection> ><title>ÐÑполÑзование загÑÑзоÑного ÑÑÐ¾Ð²Ð½Ñ (bootlevel)</title> ><body> > ><p> >ÐÑполÑзование <c>загÑÑзоÑного ÑÑовнÑ</c> полноÑÑÑÑ Ð°Ð½Ð°Ð»Ð¾Ð³Ð¸Ñно иÑполÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ ><c>пÑогÑаммного ÑÑовнÑ</c>. ÐдинÑÑÐ²ÐµÐ½Ð½Ð°Ñ ÑазниÑа ÑоÑÑÐ¾Ð¸Ñ Ð² Ñом, ÑÑо Ð²Ñ >опÑеделÑеÑе вÑоÑой ÑÑÐ¾Ð²ÐµÐ½Ñ «boot» вмеÑÑо «default». ></p> > ></body> ></subsection> ></section> ></sections> > ><!-- *$Localization: >target-language: Russian >target-date: 2012-07-24 >source-cvs-revision: 1.37 >translated-by: Vasiliy Golubev [vas@nightmail.ru] >edited-by: Sergey Kuleshov; Alexey Chumakov [achumakov@gentoo.org] >edited-by: Vladimir Romanov [blueboar2@gmail.com] >-->
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 438342
:
326524
|
326526
|
326528
|
326532
|
326534
| 326536 |
326584
|
326604
|
328274
|
328276
|
328278
|
328280
|
328282
|
328284
|
328288
|
328290
|
328292
|
328298
|
328300
|
328306
|
328308
|
329432
|
329434
|
329436
|
329438
|
329476
|
329792
|
329794
|
329798
|
329800
|
329836
|
329838
|
329840
|
330244
|
330246