aboutsummaryrefslogtreecommitdiff
path: root/documentation/content/ru/articles/rc-scripting/_index.po
blob: 89953095226c8003e48cf107459ffb7bb340f03f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR The FreeBSD Project
# This file is distributed under the same license as the FreeBSD Documentation package.
# Vladlen Popolitov <vladlenpopolitov@list.ru>, 2025.
msgid ""
msgstr ""
"Project-Id-Version: FreeBSD Documentation VERSION\n"
"POT-Creation-Date: 2025-11-08 16:17+0000\n"
"PO-Revision-Date: 2025-11-12 04:45+0000\n"
"Last-Translator: Vladlen Popolitov <vladlenpopolitov@list.ru>\n"
"Language-Team: Russian <https://translate-dev.freebsd.org/projects/"
"documentation/articlesrc-scripting_index/ru/>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.17\n"

#. type: YAML Front Matter: description
#: documentation/content/en/articles/rc-scripting/_index.adoc:1
#, no-wrap
msgid "A guide to writing new rc.d scripts and understanding those already written"
msgstr "Руководство по написанию новых rc.d-скриптов и пониманию уже существующих"

#. type: Title =
#: documentation/content/en/articles/rc-scripting/_index.adoc:1
#: documentation/content/en/articles/rc-scripting/_index.adoc:12
#, no-wrap
msgid "Practical rc.d scripting in BSD"
msgstr "Практическое руководство по написанию rc.d скриптов в BSD"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:45
msgid "Abstract"
msgstr "Аннотация"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:49
msgid ""
"Beginners may find it difficult to relate the facts from the formal "
"documentation on the BSD [.filename]#rc.d# framework with the practical "
"tasks of [.filename]#rc.d# scripting.  In this article, we consider a few "
"typical cases of increasing complexity, show [.filename]#rc.d# features "
"suited for each case, and discuss how they work.  Such an examination should "
"provide reference points for further study of the design and efficient "
"application of [.filename]#rc.d#."
msgstr ""
"Новичкам может быть сложно соотнести факты из официальной документации по "
"фреймворку [.filename]#rc.d# в BSD с практическими задачами написания "
"скриптов для [.filename]#rc.d#. В этой статье мы рассмотрим несколько "
"типичных случаев возрастающей сложности, покажем возможности [.filename]#rc."
"d#, подходящие для каждого случая, и обсудим, как они работают. Такое "
"рассмотрение должно дать ориентиры для дальнейшего изучения устройства и "
"эффективного применения [.filename]#rc.d#."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:51
msgid "'''"
msgstr "'''"

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:55
#, no-wrap
msgid "Introduction"
msgstr "Введение"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:61
msgid ""
"The historical BSD had a monolithic startup script, [.filename]#/etc/rc#.  "
"It was invoked by man:init[8] at system boot time and performed all userland "
"tasks required for multi-user operation: checking and mounting file systems, "
"setting up the network, starting daemons, and so on.  The precise list of "
"tasks was not the same in every system; admins needed to customize it.  With "
"few exceptions, [.filename]#/etc/rc# had to be modified, and true hackers "
"liked it."
msgstr ""
"Исторически в BSD был монолитный стартовый сценарий [.filename]#/etc/rc#. Он "
"вызывался man:init[8] во время загрузки системы и выполнял все задачи "
"пользовательского пространства, необходимые для многопользовательского "
"режима: проверку и монтирование файловых систем, настройку сети, запуск "
"демонов и так далее. Точный список задач не был одинаковым в каждой системе; "
"администраторам требовалось его настраивать. За редкими исключениями, [."
"filename]#/etc/rc# приходилось изменять, и настоящим хакерам это нравилось."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:67
msgid ""
"The real problem with the monolithic approach was that it provided no "
"control over the individual components started from [.filename]#/etc/rc#.  "
"For instance, [.filename]#/etc/rc# could not restart a single daemon.  The "
"system admin had to find the daemon process by hand, kill it, wait until it "
"actually exited, then browse through [.filename]#/etc/rc# for the flags, and "
"finally type the full command line to start the daemon again.  The task "
"would become even more difficult and prone to errors if the service to "
"restart consisted of more than one daemon or demanded additional actions.  "
"In a few words, the single script failed to fulfil what scripts are for: to "
"make the system admin's life easier."
msgstr ""
"Основная проблема монолитного подхода заключалась в том, что он не "
"предоставлял контроля над отдельными компонентами, запускаемыми из [."
"filename]#/etc/rc#. Например, [.filename]#/etc/rc# не мог перезапустить "
"отдельный демон. Администратору системы приходилось вручную находить процесс "
"демона, завершать его, ждать, пока он действительно завершится, затем искать "
"в [.filename]#/etc/rc# нужные флаги и, наконец, вводить полную командную "
"строку для повторного запуска демона. Задача становилась ещё сложнее и более "
"подверженной ошибкам, если служба состояла из нескольких демонов или "
"требовала дополнительных действий. Одним словом, единый скрипт не справлялся "
"с тем, для чего скрипты вообще предназначены: облегчать жизнь администратору "
"системы."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:74
msgid ""
"Later there was an attempt to split out some parts of [.filename]#/etc/rc# "
"for the sake of starting the most important subsystems separately.  The "
"notorious example was [.filename]#/etc/netstart# to bring up networking.  It "
"did allow for accessing the network from single-user mode, but it did not "
"integrate well into the automatic startup process because parts of its code "
"needed to interleave with actions essentially unrelated to networking.  That "
"was why [.filename]#/etc/netstart# mutated into [.filename]#/etc/rc."
"network#.  The latter was no longer an ordinary script; it comprised of "
"large, tangled man:sh[1] functions called from [.filename]#/etc/rc# at "
"different stages of system startup.  However, as the startup tasks grew "
"diverse and sophisticated, the \"quasi-modular\" approach became even more "
"of a drag than the monolithic [.filename]#/etc/rc# had been."
msgstr ""
"Позже была предпринята попытка разделить некоторые части [.filename]#/etc/"
"rc# для возможности отдельного запуска наиболее важных подсистем. Известным "
"примером стал [.filename]#/etc/netstart#, предназначенный для настройки "
"сети. Это позволяло получить доступ к сети в однопользовательском режиме, но "
"плохо интегрировалось в автоматический процесс запуска, так как части его "
"кода требовалось переплетаться с действиями, по сути не связанными с сетью. "
"Именно поэтому [.filename]#/etc/netstart# превратился в [.filename]#/etc/rc."
"network#. Последний больше не был обычным скриптом; он состоял из больших, "
"запутанных функций man:sh[1], вызываемых из [.filename]#/etc/rc# на разных "
"этапах загрузки системы. Однако по мере того, как задачи при запуске "
"становились разнообразнее и сложнее, \"квазимодульный\" подход стал ещё "
"большей обузой, чем монолитный [.filename]#/etc/rc#."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:82
msgid ""
"Without a clean and well-designed framework, the startup scripts had to bend "
"over backwards to satisfy the needs of rapidly developing BSD-based "
"operating systems.  It became obvious at last that more steps are necessary "
"on the way to a fine-grained and extensible [.filename]#rc# system.  Thus "
"BSD [.filename]#rc.d# was born.  Its acknowledged fathers were Luke Mewburn "
"and the NetBSD community.  Later it was imported into FreeBSD.  Its name "
"refers to the location of system scripts for individual services, which is "
"in [.filename]#/etc/rc.d#.  Soon we will learn about more components of the "
"[.filename]#rc.d# system and see how the individual scripts are invoked."
msgstr ""
"Без чистого и хорошо продуманного каркаса, стартовые скрипты вынуждены были "
"идти на всевозможные ухищрения, чтобы удовлетворить потребности быстро "
"развивающихся BSD-ориентированных операционных систем. В конце концов стало "
"очевидно, что необходимы дополнительные шаги на пути к детализированной и "
"расширяемой системе [.filename]#rc#. Так появилась BSD [.filename]#rc.d#. Её "
"признанными создателями стали Люк Мьюберн и сообщество NetBSD. Позже она "
"была импортирована в FreeBSD. Её название отсылает к расположению системных "
"скриптов для отдельных служб, которое находится в [.filename]#/etc/rc.d#. "
"Вскоре мы узнаем больше о компонентах системы [.filename]#rc.d# и увидим, "
"как вызываются отдельные скрипты."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:93
msgid ""
"The basic ideas behind BSD [.filename]#rc.d# are _fine modularity_ and "
"__code reuse__.  _Fine modularity_ means that each basic \"service\" such as "
"a system daemon or primitive startup task gets its own man:sh[1] script able "
"to start the service, stop it, reload it, check its status.  A particular "
"action is chosen by the command-line argument to the script.  The [."
"filename]#/etc/rc# script still drives system startup, but now it merely "
"invokes the smaller scripts one by one with the `start` argument.  It is "
"easy to perform shutdown tasks as well by running the same set of scripts "
"with the `stop` argument, which is done by [.filename]#/etc/rc.shutdown#.  "
"Note how closely this follows the Unix way of having a set of small "
"specialized tools, each fulfilling its task as well as possible.  _Code "
"reuse_ means that common operations are implemented as man:sh[1] functions "
"and collected in [.filename]#/etc/rc.subr#.  Now a typical script can be "
"just a few lines' worth of man:sh[1] code.  Finally, an important part of "
"the [.filename]#rc.d# framework is man:rcorder[8], which helps [.filename]#/"
"etc/rc# to run the small scripts orderly with respect to dependencies "
"between them.  It can help [.filename]#/etc/rc.shutdown#, too, because the "
"proper order for the shutdown sequence is opposite to that of startup."
msgstr ""
"Основные идеи, лежащие в основе BSD [.filename]#rc.d#, — это _тонкая "
"модульность_ и __повторное использование кода__. _Тонкая модульность_ "
"означает, что каждая базовая «служба», такая как системный демон или "
"примитивная задача запуска, получает собственный сценарий man:sh[1], "
"способный запустить службу, остановить её, перезагрузить или проверить её "
"состояние. Конкретное действие выбирается аргументом командной строки, "
"переданным в сценарий. Сценарий [.filename]#/etc/rc# по-прежнему управляет "
"запуском системы, но теперь он просто вызывает небольшие сценарии один за "
"другим с аргументом `start`. Также легко выполнять задачи завершения работы, "
"запуская тот же набор сценариев с аргументом `stop`, что и делает [."
"filename]#/etc/rc.shutdown#. Обратите внимание, насколько это близко следует "
"Unix-подходу, где используется набор небольших специализированных "
"инструментов, каждый из которых выполняет свою задачу наилучшим образом. "
"_Повторное использование кода_ означает, что общие операции реализованы как "
"функции man:sh[1] и собраны в [.filename]#/etc/rc.subr#. Теперь типичный "
"сценарий может состоять всего из нескольких строк кода man:sh[1]. Наконец, "
"важной частью инфраструктуры [.filename]#rc.d# является man:rcorder[8], "
"который помогает [.filename]#/etc/rc# упорядоченно запускать небольшие "
"сценарии с учётом зависимостей между ними. Он также может помочь [."
"filename]#/etc/rc.shutdown#, поскольку правильный порядок завершения работы "
"противоположен порядку запуска."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:101
msgid ""
"The BSD [.filename]#rc.d# design is described in crossref:rc-"
"scripting[lukem, the original article by Luke Mewburn], and the [."
"filename]#rc.d# components are documented in great detail in crossref:rc-"
"scripting[manpages, the respective manual pages].  However, it might not "
"appear obvious to an [.filename]#rc.d# newbie how to tie the numerous bits "
"and pieces together to create a well-styled script for a particular task.  "
"Therefore this article will try a different approach to describe [."
"filename]#rc.d#.  It will show which features should be used in a number of "
"typical cases, and why.  Note that this is not a how-to document because our "
"aim is not at giving ready-made recipes, but at showing a few easy entrances "
"into the [.filename]#rc.d# realm.  Neither is this article a replacement for "
"the relevant manual pages.  Do not hesitate to refer to them for more formal "
"and complete documentation while reading this article."
msgstr ""
"Дизайн BSD [.filename]#rc.d# описан в crossref:rc-scripting[lukem, "
"оригинальной статье Люка Мьюберна], а компоненты [.filename]#rc.d# подробно "
"документированы в crossref:rc-scripting[manpages, соответствующих страницах "
"Справочника]. Однако новичку в [.filename]#rc.d# может быть неочевидно, как "
"связать многочисленные элементы вместе, чтобы создать хорошо "
"структурированный скрипт для конкретной задачи. Поэтому в этой статье будет "
"предпринята попытка описать [.filename]#rc.d# с другого ракурса. В ней будет "
"показано, какие функции следует использовать в ряде типичных случаев и "
"почему. Обратите внимание, что это не руководство HowTo, поскольку наша цель "
"— не предоставление готовых рецептов, а демонстрация нескольких простых "
"способов входа в мир [.filename]#rc.d#. Также эта статья не заменяет "
"соответствующие страниц Справочника. Не стесняйтесь обращаться к ним для "
"получения более формальной и полной документации во время чтения этой статьи."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:105
msgid ""
"There are prerequisites to understanding this article.  First of all, you "
"should be familiar with the man:sh[1] scripting language to master [."
"filename]#rc.d#.  In addition, you should know how the system performs "
"userland startup and shutdown tasks, which is described in man:rc[8]."
msgstr ""
"Для понимания этой статьи есть предварительные требования. Прежде всего, вы "
"должны быть знакомы с языком написания сценариев man:sh[1], чтобы освоить [."
"filename]#rc.d#. Кроме того, вы должны знать, как система выполняет задачи "
"запуска и завершения работы пользовательского пространства, что описано в "
"man:rc[8]."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:108
msgid ""
"This article focuses on the FreeBSD branch of [.filename]#rc.d#.  "
"Nevertheless, it may be useful to NetBSD developers, too, because the two "
"branches of BSD [.filename]#rc.d# not only share the same design but also "
"stay similar in their aspects visible to script authors."
msgstr ""
"Эта статья посвящена ветке FreeBSD в [.filename]#rc.d#. Тем не менее, она "
"может быть полезна и разработчикам NetBSD, потому что две ветки BSD [."
"filename]#rc.d# не только разделяют одинаковый дизайн, но и остаются схожими "
"в аспектах, видимых авторам скриптов."

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:110
#, no-wrap
msgid "Outlining the task"
msgstr "Обрисовка задачи"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:114
msgid ""
"A little consideration before starting `$EDITOR` will not hurt.  To write a "
"well-tempered [.filename]#rc.d# script for a system service, we should be "
"able to answer the following questions first:"
msgstr ""
"Немного размышлений перед запуском `$EDITOR` не повредит. Чтобы написать "
"хорошо продуманный скрипт [.filename]#rc.d# для системной службы, сначала "
"нужно ответить на следующие вопросы:"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:116
msgid "Is the service mandatory or optional?"
msgstr "Является ли служба обязательной или опциональной?"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:117
msgid ""
"Will the script serve a single program, e.g., a daemon, or perform more "
"complex actions?"
msgstr ""
"Будет ли скрипт обслуживать одну программу, например, демон, или выполнять "
"более сложные действия?"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:118
msgid "Which other services will our service depend on, and vice versa?"
msgstr "От каких других служб зависит наша служба, и наоборот?"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:120
msgid ""
"From the examples that follow we will see why it is important to know the "
"answers to these questions."
msgstr ""
"Из следующих примеров мы увидим, почему важно знать ответы на эти вопросы."

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:122
#, no-wrap
msgid "A dummy script"
msgstr "Примитивный скрипт"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:125
msgid ""
"The following script just emits a message each time the system boots up:"
msgstr ""
"Следующий скрипт просто выводит сообщение каждый раз при загрузке системы:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:129
#, no-wrap
msgid "#!/bin/sh <.>\n"
msgstr "#!/bin/sh <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:131
#, no-wrap
msgid ". /etc/rc.subr <.>\n"
msgstr ". /etc/rc.subr <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:135
#, no-wrap
msgid ""
"name=\"dummy\" <.>\n"
"start_cmd=\"${name}_start\" <.>\n"
"stop_cmd=\":\" <.>\n"
msgstr ""
"name=\"dummy\" <.>\n"
"start_cmd=\"${name}_start\" <.>\n"
"stop_cmd=\":\" <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:140
#, no-wrap
msgid ""
"dummy_start() <.>\n"
"{\n"
"\techo \"Nothing started.\"\n"
"}\n"
msgstr ""
"dummy_start() <.>\n"
"{\n"
"\techo \"Nothing started.\"\n"
"}\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:143
#, no-wrap
msgid ""
"load_rc_config $name <.>\n"
"run_rc_command \"$1\" <.>\n"
msgstr ""
"load_rc_config $name <.>\n"
"run_rc_command \"$1\" <.>\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:146
msgid "Things to note are:"
msgstr "Вот что следует учитывать:"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:152
msgid ""
"&#10122; An interpreted script should begin with the magic \"shebang\" "
"line.  That line specifies the interpreter program for the script.  Due to "
"the shebang line, the script can be invoked exactly like a binary program "
"provided that it has the execute bit set.  (See man:chmod[1].)  For example, "
"a system admin can run our script manually, from the command line:"
msgstr ""
"&#10122; Интерпретируемый скрипт должен начинаться с \"волшебной\" строки "
"shebang. Эта строка указывает программу-интерпретатор для скрипта. Благодаря "
"строке shebang скрипт может быть запущен точно так же, как бинарная "
"программа, при условии что у него установлен бит выполнения. (См. man:"
"chmod[1].) Например, системный администратор может запустить наш скрипт "
"вручную из командной строки:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:156
#, no-wrap
msgid "# /etc/rc.d/dummy start\n"
msgstr "# /etc/rc.d/dummy start\n"

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:162
msgid ""
"To be properly managed by the [.filename]#rc.d# framework, its scripts need "
"to be written in the man:sh[1] language.  If you have a service or port that "
"uses a binary control utility or a startup routine written in another "
"language, install that element in [.filename]#/usr/sbin# (for the system) or "
"[.filename]#/usr/local/sbin# (for ports) and call it from a man:sh[1] script "
"in the appropriate [.filename]#rc.d# directory."
msgstr ""
"Для корректного управления в рамках [.filename]#rc.d# скрипты должны быть "
"написаны на языке man:sh[1]. Если у вас есть служба или порт, который "
"использует двоичную утилиту управления или процедуру запуска, написанную на "
"другом языке, установите этот компонент в [.filename]#/usr/sbin# (для "
"системы) или [.filename]#/usr/local/sbin# (для портов) и вызовите его из man:"
"sh[1] скрипта в соответствующем каталоге [.filename]#rc.d#."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:167
msgid ""
"If you would like to learn the details of why [.filename]#rc.d# scripts must "
"be written in the man:sh[1] language, see how [.filename]#/etc/rc# invokes "
"them by means of `run_rc_script`, then study the implementation of "
"`run_rc_script` in [.filename]#/etc/rc.subr#."
msgstr ""
"Если вы хотите узнать подробности о том, почему скрипты [.filename]#rc.d# "
"должны быть написаны на языке man:sh[1], изучите, как [.filename]#/etc/rc# "
"вызывает их с помощью `run_rc_script`, а затем изучите реализацию "
"`run_rc_script` в [.filename]#/etc/rc.subr#."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:173
msgid ""
"&#10123; In [.filename]#/etc/rc.subr#, a number of man:sh[1] functions are "
"defined for an [.filename]#rc.d# script to use.  The functions are "
"documented in man:rc.subr[8].  While it is theoretically possible to write "
"an [.filename]#rc.d# script without ever using man:rc.subr[8], its functions "
"prove extremely handy and make the job an order of magnitude easier. So it "
"is no surprise that everybody resorts to man:rc.subr[8] in [.filename]#rc.d# "
"scripts.  We are not going to be an exception."
msgstr ""
"&#10123; В файле [.filename]#/etc/rc.subr# определено несколько функций man:"
"sh[1], которые могут использоваться скриптами [.filename]#rc.d#. Эти функции "
"описаны в man:rc.subr[8]. Хотя теоретически возможно написать скрипт [."
"filename]#rc.d# без использования man:rc.subr[8], его функции оказываются "
"чрезвычайно полезными и значительно упрощают задачу. Поэтому неудивительно, "
"что все используют man:rc.subr[8] в скриптах [.filename]#rc.d#. Мы не будем "
"исключением."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:176
msgid ""
"An [.filename]#rc.d# script must \"source\"[.filename]#/etc/rc.subr# "
"(include it using \"`.`\") _before_ it calls man:rc.subr[8] functions so "
"that man:sh[1] has an opportunity to learn the functions.  The preferred "
"style is to source [.filename]#/etc/rc.subr# first of all."
msgstr ""
"Файл [.filename]#rc.d# должен \"подгрузить\" ([.filename]#/etc/rc.subr#, "
"включить его с помощью \"`.`\") _до_ вызова функций man:rc.subr[8], чтобы у "
"man:sh[1] была возможность знать об этих функциях заранее. Предпочтительный "
"стиль — подгружать [.filename]#/etc/rc.subr# в самом начале."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:180
msgid ""
"Some useful functions related to networking are provided by another include "
"file, [.filename]#/etc/network.subr#."
msgstr ""
"Некоторые полезные функции, связанные с сетью, предоставляются другим "
"включаемым файлом — [.filename]#/etc/network.subr#."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:185
msgid ""
"&#10124; [[name-var]]The mandatory variable `name` specifies the name of our "
"script.  It is required by man:rc.subr[8].  That is, each [.filename]#rc.d# "
"script _must_ set `name` before it calls man:rc.subr[8] functions."
msgstr ""
"&#10124; [[name-var]]Обязательная переменная `name` определяет имя нашего "
"скрипта. Она требуется man:rc.subr[8]. То есть, каждый скрипт в [."
"filename]#rc.d# _должен_ установить `name` перед вызовом функций man:rc."
"subr[8]."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:191
msgid ""
"Now it is the right time to choose a unique name for our script once and for "
"all.  We will use it in a number of places while developing the script.  The "
"content of the name variable needs to match the script name, some parts of "
"FreeBSD (e.g., crossref:rc-scripting[rcng-service-jails, service jails] and "
"the cpuset feature of the rc framework) depend upon this.  As such the "
"filename shall also not contain characters which may be troublesome in "
"scripting (e.g., do not use a hyphen \"-\" and others)."
msgstr ""
"Теперь самое время раз и навсегда выбрать уникальное имя для нашего скрипта. "
"Мы будем использовать его в нескольких местах при разработке скрипта. "
"Содержимое переменной name должно соответствовать имени скрипта, так как "
"некоторые части FreeBSD (например, crossref:rc-scripting[rcng-service-jails, "
"сервисные клетки (jail)] и функция cpuset в rc framework) зависят от этого. "
"Таким образом, имя файла также не должно содержать символов, которые могут "
"вызвать проблемы в скриптах (например, не используйте дефис \"-\" и другие)."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:198
msgid ""
"The current style of [.filename]#rc.d# scripting is to enclose values "
"assigned to variables in double quotes.  Keep in mind that it is just a "
"style issue that may not always be applicable.  You can safely omit quotes "
"from around simple words without man:sh[1] metacharacters in them, while in "
"certain cases you will need single quotes to prevent any interpretation of "
"the value by man:sh[1].  A programmer should be able to tell the language "
"syntax from style conventions and use both of them wisely."
msgstr ""
"Текущий стиль написания скриптов в [.filename]#rc.d# заключается в "
"заключении значений, присваиваемых переменным, в двойные кавычки. Имейте в "
"виду, что это всего лишь вопрос стиля, который может быть не всегда "
"применим. Вы можете безопасно опустить кавычки вокруг простых слов без "
"метасимволов man:sh[1], тогда как в некоторых случаях вам понадобятся "
"одинарные кавычки, чтобы предотвратить интерпретацию значения man:sh[1]. "
"Программист должен уметь отличать синтаксис языка от стилевых соглашений и "
"разумно использовать и то, и другое."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:204
msgid ""
"&#10125; The main idea behind man:rc.subr[8] is that an [.filename]#rc.d# "
"script provides handlers, or methods, for man:rc.subr[8] to invoke.  In "
"particular, `start`, `stop`, and other arguments to an [.filename]#rc.d# "
"script are handled this way.  A method is a man:sh[1] expression stored in a "
"variable named `argument_cmd`, where _argument_ corresponds to what can be "
"specified on the script's command line.  We will see later how man:rc."
"subr[8] provides default methods for the standard arguments."
msgstr ""
"&#10125; Основная идея man:rc.subr[8] заключается в том, что скрипт [."
"filename]#rc.d# предоставляет обработчики (или методы) для вызова man:rc."
"subr[8]. В частности, аргументы `start`, `stop` и другие, передаваемые в "
"скрипт [.filename]#rc.d#, обрабатываются таким образом. Метод представляет "
"собой выражение man:sh[1], сохранённое в переменной с именем `argument_cmd`, "
"где _argument_ соответствует тому, что может быть указано в командной строке "
"скрипта. Далее мы увидим, как man:rc.subr[8] предоставляет стандартные "
"методы для типовых аргументов."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:209
msgid ""
"To make the code in [.filename]#rc.d# more uniform, it is common to use `"
"${name}` wherever appropriate.  Thus a number of lines can be just copied "
"from one script to another."
msgstr ""
"Чтобы сделать код в [.filename]#rc.d# более единообразным, обычно используют "
"`${name}` везде, где это уместно. Таким образом, множество строк можно "
"просто копировать из одного скрипта в другой."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:213
msgid ""
"&#10126; We should keep in mind that man:rc.subr[8] provides default methods "
"for the standard arguments.  Consequently, we must override a standard "
"method with a no-op man:sh[1] expression if we want it to do nothing."
msgstr ""
"&#10126; Следует помнить, что man:rc.subr[8] предоставляет методы по "
"умолчанию для стандартных аргументов. Следовательно, если мы хотим, чтобы "
"стандартный метод ничего не делал, мы должны переопределить его с помощью no-"
"op man:sh[1] выражения."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:216
msgid ""
"&#10127; The body of a sophisticated method can be implemented as a "
"function.  It is a good idea to make the function name meaningful."
msgstr ""
"&#10127; Тело сложного метода может быть реализовано в виде функции. Хорошей "
"практикой является использование осмысленного имени функции."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:220
msgid ""
"It is strongly recommended to add the prefix `${name}` to the names of all "
"functions defined in our script so they never clash with the functions from "
"man:rc.subr[8] or another common include file."
msgstr ""
"Настоятельно рекомендуется добавлять префикс `${name}` к именам всех "
"функций, определенных в нашем скрипте, чтобы они никогда не конфликтовали с "
"функциями из man:rc.subr[8] или другого общего включаемого файла."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:224
msgid ""
"&#10128; This call to man:rc.subr[8] loads man:rc.conf[5] variables.  Our "
"script makes no use of them yet, but it still is recommended to load man:rc."
"conf[5] because there can be man:rc.conf[5] variables controlling man:rc."
"subr[8] itself."
msgstr ""
"&#10128; Этот вызов man:rc.subr[8] загружает переменные man:rc.conf[5]. Наш "
"скрипт пока их не использует, но всё равно рекомендуется загружать man:rc."
"conf[5], потому что могут быть переменные man:rc.conf[5], управляющие самим "
"man:rc.subr[8]."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:227
msgid ""
"&#10129; Usually this is the last command in an [.filename]#rc.d# script.  "
"It invokes the man:rc.subr[8] machinery to perform the requested action "
"using the variables and methods our script has provided."
msgstr ""
"&#10129; Обычно это последняя команда в скрипте [.filename]#rc.d#. Она "
"вызывает механизм man:rc.subr[8] для выполнения запрошенного действия, "
"используя переменные и методы, предоставленные нашим скриптом."

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:229
#, no-wrap
msgid "A configurable dummy script"
msgstr "Настраиваемый фиктивный скрипт"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:239
msgid ""
"Now let us add some controls to our dummy script.  As you may know, [."
"filename]#rc.d# scripts are controlled with man:rc.conf[5].  Fortunately, "
"man:rc.subr[8] hides all the complications from us.  The following script "
"uses man:rc.conf[5] via man:rc.subr[8] to see whether it is enabled in the "
"first place, and to fetch a message to show at boot time.  These two tasks "
"in fact are independent.  On the one hand, an [.filename]#rc.d# script can "
"just support enabling and disabling its service.  On the other hand, a "
"mandatory [.filename]#rc.d# script can have configuration variables.  We "
"will do both things in the same script though:"
msgstr ""
"Теперь добавим некоторые элементы управления в наш тестовый скрипт. Как вам "
"может быть известно, скрипты [.filename]#rc.d# управляются с помощью man:rc."
"conf[5]. К счастью, man:rc.subr[8] скрывает от нас все сложности. Следующий "
"скрипт использует man:rc.conf[5] через man:rc.subr[8], чтобы проверить, "
"включен ли он вообще, и получить сообщение для отображения во время "
"загрузки. Эти две задачи на самом деле независимы. С одной стороны, скрипт [."
"filename]#rc.d# может просто поддерживать включение и выключение своего "
"сервиса. С другой стороны, обязательный скрипт [.filename]#rc.d# может иметь "
"переменные конфигурации. Однако мы реализуем обе возможности в одном скрипте:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:243
#: documentation/content/en/articles/rc-scripting/_index.adoc:334
#: documentation/content/en/articles/rc-scripting/_index.adoc:392
#: documentation/content/en/articles/rc-scripting/_index.adoc:624
#: documentation/content/en/articles/rc-scripting/_index.adoc:755
#: documentation/content/en/articles/rc-scripting/_index.adoc:860
#: documentation/content/en/articles/rc-scripting/_index.adoc:893
#: documentation/content/en/articles/rc-scripting/_index.adoc:927
#, no-wrap
msgid "#!/bin/sh\n"
msgstr "#!/bin/sh\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:245
#: documentation/content/en/articles/rc-scripting/_index.adoc:336
#: documentation/content/en/articles/rc-scripting/_index.adoc:394
#: documentation/content/en/articles/rc-scripting/_index.adoc:631
#: documentation/content/en/articles/rc-scripting/_index.adoc:757
#: documentation/content/en/articles/rc-scripting/_index.adoc:862
#: documentation/content/en/articles/rc-scripting/_index.adoc:895
#: documentation/content/en/articles/rc-scripting/_index.adoc:943
#, no-wrap
msgid ". /etc/rc.subr\n"
msgstr ". /etc/rc.subr\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:248
#, no-wrap
msgid ""
"name=dummy\n"
"rcvar=dummy_enable <.>\n"
msgstr ""
"name=dummy\n"
"rcvar=dummy_enable <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:251
#, no-wrap
msgid ""
"start_cmd=\"${name}_start\"\n"
"stop_cmd=\":\"\n"
msgstr ""
"start_cmd=\"${name}_start\"\n"
"stop_cmd=\":\"\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:255
#, no-wrap
msgid ""
"load_rc_config $name <.>\n"
": ${dummy_enable:=no} <.>\n"
": ${dummy_msg=\"Nothing started.\"} <.>\n"
msgstr ""
"load_rc_config $name <.>\n"
": ${dummy_enable:=no} <.>\n"
": ${dummy_msg=\"Nothing started.\"} <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:260
#, no-wrap
msgid ""
"dummy_start()\n"
"{\n"
"\techo \"$dummy_msg\" <.>\n"
"}\n"
msgstr ""
"dummy_start()\n"
"{\n"
"\techo \"$dummy_msg\" <.>\n"
"}\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:262
#: documentation/content/en/articles/rc-scripting/_index.adoc:972
#, no-wrap
msgid "run_rc_command \"$1\"\n"
msgstr "run_rc_command \"$1\"\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:265
msgid "What changed in this example?"
msgstr "Что изменилось в этом примере?"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:267
msgid ""
"&#10122; The variable `rcvar` specifies the name of the ON/OFF knob variable."
msgstr ""
"&#10122; Переменная `rcvar` определяет имя переменной-переключателя ON/OFF."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:269
msgid ""
"&#10123; Now `load_rc_config` is invoked earlier in the script, before any "
"man:rc.conf[5] variables are accessed."
msgstr ""
"&#10123; Теперь `load_rc_config` вызывается раньше в скрипте, до обращения к "
"любым переменным man:rc.conf[5]."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:275
msgid ""
"While examining [.filename]#rc.d# scripts, keep in mind that man:sh[1] "
"defers the evaluation of expressions in a function until the latter is "
"called.  Therefore it is not an error to invoke `load_rc_config` as late as "
"just before `run_rc_command` and still access man:rc.conf[5] variables from "
"the method functions exported to `run_rc_command`.  This is because the "
"method functions are to be called by `run_rc_command`, which is invoked "
"_after_ `load_rc_config`."
msgstr ""
"При изучении скриптов в [.filename]#rc.d# следует помнить, что man:sh[1] "
"откладывает вычисление выражений в функции до её вызова. Поэтому не будет "
"ошибкой вызвать `load_rc_config` непосредственно перед `run_rc_command` и "
"при этом обращаться к переменным man:rc.conf[5] из функций методов, "
"экспортируемых в `run_rc_command`. Это связано с тем, что функции методов "
"вызываются `run_rc_command`, который выполняется _после_ `load_rc_config`."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:281
msgid ""
"&#10124; A warning will be emitted by `run_rc_command` if `rcvar` itself is "
"set, but the indicated knob variable is unset.  If your [.filename]#rc.d# "
"script is for the base system, you should add a default setting for the knob "
"to [.filename]#/etc/defaults/rc.conf# and document it in man:rc.conf[5].  "
"Otherwise it is your script that should provide a default setting for the "
"knob.  The canonical approach to the latter case is shown in the example."
msgstr ""
"&#10124; `run_rc_command` выдаст предупреждение, если переменная `rcvar` "
"установлена, но указанная переменная-флаг не задана. Если ваш скрипт [."
"filename]#rc.d# предназначен для базовой системы, вы должны добавить "
"значение по умолчанию для флага в [.filename]#/etc/defaults/rc.conf# и "
"задокументировать его в man:rc.conf[5]. В противном случае ваш скрипт должен "
"предоставить значение по умолчанию для флага. Канонический подход для "
"последнего случая показан в примере."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:288
msgid ""
"You can make man:rc.subr[8] act as though the knob is set to `ON`, "
"irrespective of its current setting, by prefixing the argument to the script "
"with `one` or `force`, as in `onestart` or `forcestop`.  Keep in mind though "
"that `force` has other dangerous effects we will touch upon below, while "
"`one` just overrides the ON/OFF knob.  E.g., assume that `dummy_enable` is "
"`OFF`.  The following command will run the `start` method in spite of the "
"setting:"
msgstr ""
"Вы можете заставить man:rc.subr[8] действовать так, как если бы "
"переключатель установлен в `ON`, независимо от его текущего значения, "
"добавив перед аргументом скрипта префикс `one` или `force`, например "
"`onestart` или `forcestop`. Однако учтите, что `force` имеет другие опасные "
"эффекты, которые мы затронем ниже, тогда как `one` просто переопределяет "
"переключатель ON/OFF. Например, предположим, что `dummy_enable` установлен в "
"`OFF`. Следующая команда выполнит метод `start`, несмотря на настройку:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:292
#, no-wrap
msgid "# /etc/rc.d/dummy onestart\n"
msgstr "# /etc/rc.d/dummy onestart\n"

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:299
msgid ""
"&#10125; Now the message to be shown at boot time is no longer hard-coded in "
"the script.  It is specified by an man:rc.conf[5] variable named "
"`dummy_msg`.  This is a trivial example of how man:rc.conf[5] variables can "
"control an [.filename]#rc.d# script."
msgstr ""
"&#10125; Теперь сообщение, отображаемое при загрузке, больше не жестко "
"закодировано в скрипте. Оно задается переменной `dummy_msg` в man:rc."
"conf[5]. Это простой пример того, как переменные man:rc.conf[5] могут "
"управлять скриптом в [.filename]#rc.d#."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:304
msgid ""
"The names of all man:rc.conf[5] variables used exclusively by our script "
"_must_ have the same prefix: `${name}_`.  For example: `dummy_mode`, "
"`dummy_state_file`, and so on."
msgstr ""
"Имена всех переменных man:rc.conf[5], используемых исключительно нашим "
"скриптом, _должны_ иметь один и тот же префикс: `${name}_`. Например: "
"`dummy_mode`, `dummy_state_file` и так далее."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:309
msgid ""
"While it is possible to use a shorter name internally, e.g., just `msg`, "
"adding the unique prefix `${name}_` to all global names introduced by our "
"script will save us from possible collisions with the man:rc.subr[8] "
"namespace."
msgstr ""
"Хотя можно использовать более короткое имя внутри, например, просто `msg`, "
"добавление уникального префикса `${name}_` ко всем глобальным именам, "
"вводимым нашим скриптом, избавит нас от возможных конфликтов с пространством "
"имен man:rc.subr[8]."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:312
msgid ""
"As a rule, [.filename]#rc.d# scripts of the base system need not provide "
"defaults for their man:rc.conf[5] variables because the defaults should be "
"set in [.filename]#/etc/defaults/rc.conf# instead.  On the other hand, [."
"filename]#rc.d# scripts for ports should provide the defaults as shown in "
"the example."
msgstr ""
"Как правило, скрипты [.filename]#rc.d# базовой системы не должны "
"предоставлять значения по умолчанию для своих переменных man:rc.conf[5], "
"поскольку значения по умолчанию должны быть установлены в [.filename]#/etc/"
"defaults/rc.conf#. С другой стороны, скрипты [.filename]#rc.d# для портов "
"должны предоставлять значения по умолчанию, как показано в примере."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:316
msgid ""
"&#10126; Here we use `dummy_msg` to actually control our script, i.e., to "
"emit a variable message.  Use of a shell function is overkill here, since it "
"only runs a single command; an equally valid alternative is:"
msgstr ""
"&#10126; Здесь мы используем `dummy_msg` для фактического управления нашим "
"скриптом, т.е., для выдачи переменного сообщения. Использование shell-"
"функции здесь избыточно, так как она выполняет только одну команду; "
"равнозначной альтернативой является:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:320
#, no-wrap
msgid "start_cmd=\"echo \\\"$dummy_msg\\\"\"\n"
msgstr "start_cmd=\"echo \\\"$dummy_msg\\\"\"\n"

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:323
#, no-wrap
msgid "Startup and shutdown of a simple daemon"
msgstr "Запуск и остановка простого демона"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:330
msgid ""
"We said earlier that man:rc.subr[8] could provide default methods.  "
"Obviously, such defaults cannot be too general.  They are suited for the "
"common case of starting and shutting down a simple daemon program.  Let us "
"assume now that we need to write an [.filename]#rc.d# script for such a "
"daemon called `mumbled`.  Here it is:"
msgstr ""
"Мы ранее говорили, что man:rc.subr[8] может предоставлять методы по "
"умолчанию. Очевидно, что такие методы не могут быть слишком общими. Они "
"подходят для стандартного случая запуска и остановки простого демона. "
"Предположим, что нам нужно написать скрипт [.filename]#rc.d# для такого "
"демона с именем `mumbled`. Вот он:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:339
#: documentation/content/en/articles/rc-scripting/_index.adoc:397
#: documentation/content/en/articles/rc-scripting/_index.adoc:634
#, no-wrap
msgid ""
"name=mumbled\n"
"rcvar=mumbled_enable\n"
msgstr ""
"name=mumbled\n"
"rcvar=mumbled_enable\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:341
#, no-wrap
msgid "command=\"/usr/sbin/${name}\" <.>\n"
msgstr "command=\"/usr/sbin/${name}\" <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:344
#: documentation/content/en/articles/rc-scripting/_index.adoc:443
#: documentation/content/en/articles/rc-scripting/_index.adoc:649
#: documentation/content/en/articles/rc-scripting/_index.adoc:876
#, no-wrap
msgid ""
"load_rc_config $name\n"
"run_rc_command \"$1\"\n"
msgstr ""
"load_rc_config $name\n"
"run_rc_command \"$1\"\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:348
msgid ""
"Pleasingly simple, isn't it? Let us examine our little script.  The only new "
"thing to note is as follows:"
msgstr ""
"Приятно просто, не так ли? Давайте рассмотрим наш небольшой скрипт. "
"Единственное новое, на что стоит обратить внимание, это следующее:"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:352
msgid ""
"&#10122; The `command` variable is meaningful to man:rc.subr[8].  If it is "
"set, man:rc.subr[8] will act according to the scenario of serving a "
"conventional daemon.  In particular, the default methods will be provided "
"for such arguments: `start`, `stop`, `restart`, `poll`, and `status`."
msgstr ""
"&#10122; Переменная `command` имеет значение для man:rc.subr[8]. Если она "
"установлена, man:rc.subr[8] будет действовать по сценарию обслуживания "
"обычного демона. В частности, будут предоставлены стандартные методы для "
"таких аргументов: `start`, `stop`, `restart`, `poll` и `status`."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:361
msgid ""
"The daemon will be started by running `$command` with command-line flags "
"specified by `$mumbled_flags`.  Thus all the input data for the default "
"`start` method are available in the variables set by our script.  Unlike "
"`start`, other methods may require additional information about the process "
"started.  For instance, `stop` must know the PID of the process to terminate "
"it.  In the present case, man:rc.subr[8] will scan through the list of all "
"processes, looking for a process with its name equal to `procname`.  The "
"latter is another variable of meaning to man:rc.subr[8], and its value "
"defaults to that of `command`.  In other words, when we set `command`, "
"`procname` is effectively set to the same value.  This enables our script to "
"kill the daemon and to check if it is running in the first place."
msgstr ""
"Демон будет запущен выполнением `$command` с флагами командной строки, "
"указанными в `$mumbled_flags`. Таким образом, все входные данные для метода "
"`start` по умолчанию доступны в переменных, установленных нашим скриптом. В "
"отличие от `start`, другие методы могут требовать дополнительной информации "
"о запущенном процессе. Например, `stop` должен знать PID процесса, чтобы "
"завершить его. В данном случае, man:rc.subr[8] будет просматривать список "
"всех процессов, ища процесс с именем, равным `procname`. Последний является "
"ещё одной значимой переменной для man:rc.subr[8], и её значение по умолчанию "
"совпадает со значением `command`. Другими словами, когда мы устанавливаем "
"`command`, `procname` фактически устанавливается в то же значение. Это "
"позволяет нашему скрипту завершить демон и проверить, запущен ли он вообще."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:368
msgid ""
"Some programs are in fact executable scripts.  The system runs such a script "
"by starting its interpreter and passing the name of the script to it as a "
"command-line argument.  This is reflected in the list of processes, which "
"can confuse man:rc.subr[8].  You should additionally set "
"`command_interpreter` to let man:rc.subr[8] know the actual name of the "
"process if `$command` is a script."
msgstr ""
"Некоторые программы на самом деле являются исполняемыми скриптами. Система "
"запускает такие скрипты, запуская их интерпретатор и передавая ему имя "
"скрипта в качестве аргумента командной строки. Это отражается в списке "
"процессов, что может сбить с толку man:rc.subr[8]. Дополнительно следует "
"установить `command_interpreter`, чтобы man:rc.subr[8] знал фактическое имя "
"процесса, если `$command` является скриптом."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:374
msgid ""
"For each [.filename]#rc.d# script, there is an optional man:rc.conf[5] "
"variable that takes precedence over `command`.  Its name is constructed as "
"follows: `${name}_program`, where `name` is the mandatory variable we "
"discussed crossref:rc-scripting[name-var, earlier].  E.g., in this case it "
"will be `mumbled_program`.  It is man:rc.subr[8] that arranges `${name}"
"_program` to override `command`."
msgstr ""
"Для каждого скрипта [.filename]#rc.d# существует необязательная переменная "
"man:rc.conf[5], которая имеет приоритет над `command`. Её имя формируется "
"следующим образом: `${name}_program`, где `name` — это обязательная "
"переменная, которую мы обсуждали crossref:rc-scripting[name-var, ранее]. "
"Например, в данном случае это будет `mumbled_program`. Именно man:rc.subr[8] "
"обеспечивает переопределение `command` с помощью `${name}_program`."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:378
msgid ""
"Of course, man:sh[1] will permit you to set `${name}_program` from man:rc."
"conf[5] or the script itself even if `command` is unset.  In that case, the "
"special properties of `${name}_program` are lost, and it becomes an ordinary "
"variable your script can use for its own purposes.  However, the sole use of "
"`${name}_program` is discouraged because using it together with `command` "
"became an idiom of [.filename]#rc.d# scripting."
msgstr ""
"Конечно, man:sh[1] позволяет установить `${name}_program` из man:rc.conf[5] "
"или самого скрипта, даже если `command` не задан. В этом случае специальные "
"свойства `${name}_program` теряются, и она становится обычной переменной, "
"которую ваш скрипт может использовать для своих целей. Однако использование `"
"${name}_program` в одиночку не рекомендуется, так как совместное "
"использование с `command` стало идиомой в [.filename]#rc.d# скриптах."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:381
msgid ""
"For more detailed information on default methods, refer to man:rc.subr[8]."
msgstr ""
"Для получения более подробной информации о стандартных методах обратитесь к "
"man:rc.subr[8]."

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:383
#, no-wrap
msgid "Startup and shutdown of an advanced daemon"
msgstr "Запуск и остановка продвинутого демона"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:388
msgid ""
"Let us add some meat onto the bones of the previous script and make it more "
"complex and featureful.  The default methods can do a good job for us, but "
"we may need some of their aspects tweaked.  Now we will learn how to tune "
"the default methods to our needs."
msgstr ""
"Добавим немного мяса к костям предыдущего скрипта и сделаем его более "
"сложным и функциональным. Стандартные методы могут хорошо справляться с "
"задачами, но иногда требуется их тонкая настройка. Теперь мы узнаем, как "
"адаптировать стандартные методы под наши нужды."

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:400
#, no-wrap
msgid ""
"command=\"/usr/sbin/${name}\"\n"
"command_args=\"mock arguments > /dev/null 2>&1\" <.>\n"
msgstr ""
"command=\"/usr/sbin/${name}\"\n"
"command_args=\"mock arguments > /dev/null 2>&1\" <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:402
#, no-wrap
msgid "pidfile=\"/var/run/${name}.pid\" <.>\n"
msgstr "pidfile=\"/var/run/${name}.pid\" <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:404
#, no-wrap
msgid "required_files=\"/etc/${name}.conf /usr/share/misc/${name}.rules\" <.>\n"
msgstr "required_files=\"/etc/${name}.conf /usr/share/misc/${name}.rules\" <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:406
#, no-wrap
msgid "sig_reload=\"USR1\" <.>\n"
msgstr "sig_reload=\"USR1\" <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:409
#, no-wrap
msgid ""
"start_precmd=\"${name}_prestart\" <.>\n"
"stop_postcmd=\"echo Bye-bye\" <.>\n"
msgstr ""
"start_precmd=\"${name}_prestart\" <.>\n"
"stop_postcmd=\"echo Bye-bye\" <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:411
#, no-wrap
msgid "extra_commands=\"reload plugh xyzzy\" <.>\n"
msgstr "extra_commands=\"reload plugh xyzzy\" <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:414
#, no-wrap
msgid ""
"plugh_cmd=\"mumbled_plugh\" <.>\n"
"xyzzy_cmd=\"echo 'Nothing happens.'\"\n"
msgstr ""
"plugh_cmd=\"mumbled_plugh\" <.>\n"
"xyzzy_cmd=\"echo 'Nothing happens.'\"\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:435
#, no-wrap
msgid ""
"mumbled_prestart()\n"
"{\n"
"\tif checkyesno mumbled_smart; then <.>\n"
"\t\trc_flags=\"-o smart ${rc_flags}\" <.>\n"
"\tfi\n"
"\tcase \"$mumbled_mode\" in\n"
"\tfoo)\n"
"\t\trc_flags=\"-frotz ${rc_flags}\"\n"
"\t\t;;\n"
"\tbar)\n"
"\t\trc_flags=\"-baz ${rc_flags}\"\n"
"\t\t;;\n"
"\t*)\n"
"\t\twarn \"Invalid value for mumbled_mode\" <.>\n"
"\t\treturn 1 <.>\n"
"\t\t;;\n"
"\tesac\n"
"\trun_rc_command xyzzy <.>\n"
"\treturn 0\n"
"}\n"
msgstr ""
"mumbled_prestart()\n"
"{\n"
"\tif checkyesno mumbled_smart; then <.>\n"
"\t\trc_flags=\"-o smart ${rc_flags}\" <.>\n"
"\tfi\n"
"\tcase \"$mumbled_mode\" in\n"
"\tfoo)\n"
"\t\trc_flags=\"-frotz ${rc_flags}\"\n"
"\t\t;;\n"
"\tbar)\n"
"\t\trc_flags=\"-baz ${rc_flags}\"\n"
"\t\t;;\n"
"\t*)\n"
"\t\twarn \"Invalid value for mumbled_mode\" <.>\n"
"\t\treturn 1 <.>\n"
"\t\t;;\n"
"\tesac\n"
"\trun_rc_command xyzzy <.>\n"
"\treturn 0\n"
"}\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:440
#, no-wrap
msgid ""
"mumbled_plugh() <.>\n"
"{\n"
"\techo 'A hollow voice says \"plugh\".'\n"
"}\n"
msgstr ""
"mumbled_plugh() <.>\n"
"{\n"
"\techo 'A hollow voice says \"plugh\".'\n"
"}\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:448
msgid ""
"&#10122; Additional arguments to `$command` can be passed in "
"`command_args`.  They will be added to the command line after `"
"$mumbled_flags`.  Since the final command line is passed to `eval` for its "
"actual execution, input and output redirections can be specified in "
"`command_args`."
msgstr ""
"&#10122; Дополнительные аргументы для `$command` могут быть переданы в "
"`command_args`. Они будут добавлены в командную строку после `"
"$mumbled_flags`. Поскольку итоговая командная строка передаётся в `eval` для "
"фактического выполнения, перенаправления ввода и вывода могут быть указаны в "
"`command_args`."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:455
msgid ""
"_Never_ include dashed options, like `-X` or `--foo`, in `command_args`.  "
"The contents of `command_args` will appear at the end of the final command "
"line, hence they are likely to follow arguments present in `${name}_flags`; "
"but most commands will not recognize dashed options after ordinary "
"arguments.  A better way of passing additional options to `$command` is to "
"add them to the beginning of `${name}_flags`.  Another way is to modify "
"`rc_flags` crossref:rc-scripting[rc-flags, as shown later]."
msgstr ""
"Никогда не включайте параметры с дефисами, такие как `-X` или `--foo`, в "
"`command_args`. Содержимое `command_args` будет добавлено в конец итоговой "
"командной строки, поэтому, скорее всего, окажется после аргументов, "
"указанных в `${name}_flags`; однако большинство команд не распознают "
"параметры с дефисами после обычных аргументов. Лучший способ передать "
"дополнительные параметры в `$command` — добавить их в начало `${name}"
"_flags`. Другой способ — изменить `rc_flags` crossref:rc-scripting[rc-flags, "
"как показано далее]."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:459
msgid ""
"&#10123; A good-mannered daemon should create a _pidfile_ so that its "
"process can be found more easily and reliably.  The variable `pidfile`, if "
"set, tells man:rc.subr[8] where it can find the pidfile for its default "
"methods to use."
msgstr ""
"&#10123; Вежливый демон должен создавать _pidfile_, чтобы его процесс можно "
"было найти проще и надёжнее. Переменная `pidfile`, если она установлена, "
"указывает man:rc.subr[8], где можно найти pidfile для использования его "
"стандартными методами."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:464
msgid ""
"In fact, man:rc.subr[8] will also use the pidfile to see if the daemon is "
"already running before starting it.  This check can be skipped by using the "
"`faststart` argument."
msgstr ""
"На самом деле, man:rc.subr[8] также использует pidfile для проверки, запущен "
"ли демон, перед его запуском. Эту проверку можно пропустить, используя "
"аргумент `faststart`."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:469
msgid ""
"&#10124; If the daemon cannot run unless certain files exist, just list them "
"in `required_files`, and man:rc.subr[8] will check that those files do exist "
"before starting the daemon.  There also are `required_dirs` and "
"`required_vars` for directories and environment variables, respectively.  "
"They all are described in detail in man:rc.subr[8]."
msgstr ""
"&#10124; Если демон не может работать без определённых файлов, просто "
"укажите их в `required_files`, и man:rc.subr[8] проверит их наличие перед "
"запуском демона. Также существуют `required_dirs` и `required_vars` для "
"каталогов и переменных окружения соответственно. Все они подробно описаны в "
"man:rc.subr[8]."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:473
msgid ""
"The default method from man:rc.subr[8] can be forced to skip the "
"prerequisite checks by using `forcestart` as the argument to the script."
msgstr ""
"Метод по умолчанию из man:rc.subr[8] можно принудительно заставить "
"пропустить проверки предварительных условий, используя аргумент `forcestart` "
"в скрипте."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:479
msgid ""
"&#10125; We can customize signals to send to the daemon in case they differ "
"from the well-known ones.  In particular, `sig_reload` specifies the signal "
"that makes the daemon reload its configuration; it is SIGHUP by default.  "
"Another signal is sent to stop the daemon process; the default is SIGTERM, "
"but this can be changed by setting `sig_stop` appropriately."
msgstr ""
"&#10125; Мы можем настроить сигналы, отправляемые демону, если они "
"отличаются от общеизвестных. В частности, `sig_reload` указывает сигнал, "
"который заставляет демона перезагрузить свою конфигурацию; по умолчанию это "
"SIGHUP. Другой сигнал отправляется для остановки процесса демона; по "
"умолчанию используется SIGTERM, но это можно изменить, установив `sig_stop` "
"соответствующим образом."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:484
msgid ""
"The signal names should be specified to man:rc.subr[8] without the `SIG` "
"prefix, as it is shown in the example.  The FreeBSD version of man:kill[1] "
"can recognize the `SIG` prefix, but the versions from other OS types may not."
msgstr ""
"Имена сигналов должны указываться для man:rc.subr[8] без префикса `SIG`, как "
"показано в примере. Версия man:kill[1] в FreeBSD может распознавать префикс "
"`SIG`, но версии из других типов ОС могут не поддерживать его."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:489
msgid ""
"&#10126;&#10127; Performing additional tasks before or after the default "
"methods is easy.  For each command-argument supported by our script, we can "
"define `argument_precmd` and `argument_postcmd`.  These man:sh[1] commands "
"are invoked before and after the respective method, as it is evident from "
"their names."
msgstr ""
"&#10126;&#10127; Выполнение дополнительных задач до или после стандартных "
"методов — это просто. Для каждого аргумента команды, поддерживаемого нашим "
"скриптом, мы можем определить `argument_precmd` и `argument_postcmd`. Эти "
"команды man:sh[1] вызываются до и после соответствующего метода, что "
"очевидно из их названий."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:495
msgid ""
"Overriding a default method with a custom `argument_cmd` still does not "
"prevent us from making use of `argument_precmd` or `argument_postcmd` if we "
"need to.  In particular, the former is good for checking custom, "
"sophisticated conditions that should be met before performing the command "
"itself.  Using `argument_precmd` along with `argument_cmd` lets us logically "
"separate the checks from the action."
msgstr ""
"Переопределение стандартного метода с помощью пользовательского "
"`argument_cmd` всё равно не мешает нам использовать `argument_precmd` или "
"`argument_postcmd`, если это необходимо. В частности, первый полезен для "
"проверки пользовательских сложных условий, которые должны быть выполнены "
"перед выполнением самой команды. Использование `argument_precmd` вместе с "
"`argument_cmd` позволяет логически разделить проверки от действия."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:498
msgid ""
"Do not forget that you can cram any valid man:sh[1] expressions into the "
"methods, pre-, and post-commands you define.  Just invoking a function that "
"makes the real job is a good style in most cases, but never let style limit "
"your understanding of what is going on behind the curtain."
msgstr ""
"Не забывайте, что вы можете вставлять любые допустимые выражения из man:"
"sh[1] в определяемые вами методы, а также команды pre- и post-. Просто "
"вызывать функцию, которая выполняет основную работу, — это хороший стиль в "
"большинстве случаев, но никогда не позволяйте стилю ограничивать ваше "
"понимание того, что происходит за кулисами."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:501
msgid ""
"&#10128; If we would like to implement custom arguments, which can also be "
"thought of as _commands_ to our script, we need to list them in "
"`extra_commands` and provide methods to handle them."
msgstr ""
"&#10128; Если мы хотим реализовать пользовательские аргументы, которые также "
"можно рассматривать как _команды_ для нашего скрипта, необходимо перечислить "
"их в `extra_commands` и предоставить методы для их обработки."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:509
msgid ""
"The `reload` command is special. On the one hand, it has a preset method in "
"man:rc.subr[8].  On the other hand, `reload` is not offered by default.  The "
"reason is that not all daemons use the same reload mechanism and some have "
"nothing to reload at all.  So we need to ask explicitly that the builtin "
"functionality be provided.  We can do so via `extra_commands`."
msgstr ""
"Команда `reload` является особенной. С одной стороны, у неё есть "
"предустановленный метод в man:rc.subr[8]. С другой стороны, `reload` не "
"предлагается по умолчанию. Причина в том, что не все демоны используют "
"одинаковый механизм перезагрузки, а у некоторых вообще нет ничего для "
"перезагрузки. Поэтому нам нужно явно запросить предоставление встроенной "
"функциональности. Это можно сделать с помощью `extra_commands`."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:513
msgid ""
"What do we get from the default method for `reload`? Quite often daemons "
"reload their configuration upon reception of a signal - typically, SIGHUP.  "
"Therefore man:rc.subr[8] attempts to reload the daemon by sending a signal "
"to it.  The signal is preset to SIGHUP but can be customized via "
"`sig_reload` if necessary."
msgstr ""
"Что мы получаем от метода по умолчанию для `reload`? Довольно часто демоны "
"перезагружают свою конфигурацию при получении сигнала — обычно, SIGHUP. "
"Поэтому man:rc.subr[8] пытается перезагрузить демона, отправляя ему сигнал. "
"Сигнал предустановлен на SIGHUP, но может быть изменён через `sig_reload` "
"при необходимости."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:518
msgid ""
"&#10129;&#9454; Our script supports two non-standard commands, `plugh` and "
"`xyzzy`.  We saw them listed in `extra_commands`, and now it is time to "
"provide methods for them.  The method for `xyzzy` is just inlined while that "
"for `plugh` is implemented as the `mumbled_plugh` function."
msgstr ""
"&#10129;&#9454; Наш скрипт поддерживает две нестандартные команды: `plugh` и "
"`xyzzy`. Мы видели их в списке `extra_commands`, и теперь пришло время "
"реализовать методы для них. Метод для `xyzzy` просто встроен в код, а для "
"`plugh` он реализован как функция `mumbled_plugh`."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:522
msgid ""
"Non-standard commands are not invoked during startup or shutdown.  Usually "
"they are for the system admin's convenience.  They can also be used from "
"other subsystems, e.g., man:devd[8] if specified in man:devd.conf[5]."
msgstr ""
"Нестандартные команды не вызываются во время запуска или завершения работы. "
"Обычно они предназначены для удобства системного администратора. Они также "
"могут использоваться другими подсистемами, например, man:devd[8], если "
"указаны в man:devd.conf[5]."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:525
msgid ""
"The full list of available commands can be found in the usage line printed "
"by man:rc.subr[8] when the script is invoked without arguments.  For "
"example, here is the usage line from the script under study:"
msgstr ""
"Полный список доступных команд можно найти в строке использования, выводимой "
"man:rc.subr[8], когда скрипт вызывается без аргументов. Например, вот строка "
"использования из изучаемого скрипта:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:530
#, no-wrap
msgid ""
"# /etc/rc.d/mumbled\n"
"Usage: /etc/rc.d/mumbled [fast|force|one](start|stop|restart|rcvar|reload|plugh|xyzzy|status|poll)\n"
msgstr ""
"# /etc/rc.d/mumbled\n"
"Usage: /etc/rc.d/mumbled [fast|force|one](start|stop|restart|rcvar|reload|plugh|xyzzy|status|poll)\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:537
msgid ""
"&#9453; A script can invoke its own standard or non-standard commands if "
"needed.  This may look similar to calling functions, but we know that "
"commands and shell functions are not always the same thing.  For instance, "
"`xyzzy` is not implemented as a function here.  In addition, there can be a "
"pre-command and post-command, which should be invoked orderly.  So the "
"proper way for a script to run its own command is by means of man:rc."
"subr[8], as shown in the example."
msgstr ""
"&#9453; Скрипт может вызывать свои собственные стандартные или нестандартные "
"команды, если это необходимо.  Это может выглядеть похоже на вызов функций, "
"но мы знаем, что команды и функции оболочки не всегда одно и то же.  "
"Например, `xyzzy` не реализован как функция в данном случае.  Кроме того, "
"могут существовать пред-команда и пост-команда, которые должны вызываться в "
"определённом порядке.  Поэтому правильный способ для скрипта выполнить свою "
"собственную команду — с помощью man:rc.subr[8], как показано в примере."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:543
msgid ""
"&#10130; A handy function named `checkyesno` is provided by man:rc.subr[8].  "
"It takes a variable name as its argument and returns a zero exit code if and "
"only if the variable is set to `YES`, or `TRUE`, or `ON`, or `1`, case "
"insensitive; a non-zero exit code is returned otherwise.  In the latter "
"case, the function tests the variable for being set to `NO`, `FALSE`, `OFF`, "
"or `0`, case insensitive; it prints a warning message if the variable "
"contains anything else, i.e., junk."
msgstr ""
"&#10130; Полезная функция `checkyesno` предоставляется man:rc.subr[8]. Она "
"принимает имя переменной в качестве аргумента и возвращает нулевой код "
"выхода только если переменная установлена в `YES`, `TRUE`, `ON` или `1`, без "
"учёта регистра; в противном случае возвращается ненулевой код выхода. В "
"последнем случае функция проверяет, установлена ли переменная в `NO`, "
"`FALSE`, `OFF` или `0`, также без учёта регистра; если переменная содержит "
"что-то иное (т.е. мусор), функция выводит предупреждение."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:545
msgid ""
"Keep in mind that for man:sh[1] a zero exit code means true and a non-zero "
"exit code means false."
msgstr ""
"Имейте в виду, что для man:sh[1] нулевой код возврата означает истину, а "
"ненулевой код возврата означает ложь."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:550
msgid ""
"The `checkyesno` function takes a __variable name__.  Do not pass the "
"expanded _value_ of a variable to it; it will not work as expected."
msgstr ""
"Функция `checkyesno` принимает __имя переменной__. Не передавайте ей "
"_значение_ переменной; это не будет работать, как ожидается."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:552
msgid "The following is the correct usage of `checkyesno`:"
msgstr "Ниже приведено правильное использование `checkyesno`:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:558
#, no-wrap
msgid ""
"if checkyesno mumbled_enable; then\n"
"        foo\n"
"fi\n"
msgstr ""
"if checkyesno mumbled_enable; then\n"
"        foo\n"
"fi\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:561
msgid ""
"On the contrary, calling `checkyesno` as shown below will not work - at "
"least not as expected:"
msgstr ""
"Напротив, вызов `checkyesno`, как показано ниже, не сработает — по крайней "
"мере, не так, как ожидается:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:567
#, no-wrap
msgid ""
"if checkyesno \"${mumbled_enable}\"; then\n"
"        foo\n"
"fi\n"
msgstr ""
"if checkyesno \"${mumbled_enable}\"; then\n"
"        foo\n"
"fi\n"

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:572
msgid ""
"&#10131; [[rc-flags]]We can affect the flags to be passed to `$command` by "
"modifying `rc_flags` in `$start_precmd`."
msgstr ""
"&#10131; [[rc-flags]] Мы можем влиять на флаги, передаваемые команде `"
"$command`, изменяя `rc_flags` в `$start_precmd`."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:576
msgid ""
"&#9451; In certain cases we may need to emit an important message that "
"should go to `syslog` as well.  This can be done easily with the following "
"man:rc.subr[8] functions: `debug`, `info`, `warn`, and `err`.  The latter "
"function then exits the script with the code specified."
msgstr ""
"&#9451; В некоторых случаях может потребоваться вывести важное сообщение, "
"которое также должно попасть в `syslog`. Это можно легко сделать с помощью "
"следующих функций man:rc.subr[8]: `debug`, `info`, `warn` и `err`. Последняя "
"функция завершает выполнение скрипта с указанным кодом."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:580
msgid ""
"&#9452; The exit codes from methods and their pre-commands are not just "
"ignored by default.  If `argument_precmd` returns a non-zero exit code, the "
"main method will not be performed.  In turn, `argument_postcmd` will not be "
"invoked unless the main method returns a zero exit code."
msgstr ""
"&#9452; Коды выхода из методов и их предварительных команд не просто "
"игнорируются по умолчанию. Если `argument_precmd` возвращает ненулевой код "
"выхода, основной метод не будет выполнен. В свою очередь, `argument_postcmd` "
"не будет вызван, если основной метод возвращает ненулевой код выхода."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:584
msgid ""
"However, man:rc.subr[8] can be instructed from the command line to ignore "
"those exit codes and invoke all commands anyway by prefixing an argument "
"with `force`, as in `forcestart`."
msgstr ""
"Однако man:rc.subr[8] можно указать из командной строки игнорировать эти "
"коды завершения и выполнять все команды в любом случае, добавив префикс "
"`force` к аргументу, например `forcestart`."

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:587
#, no-wrap
msgid "Connecting a script to the rc.d framework"
msgstr "Подключение скрипта к инфраструктуре rc.d"

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:594
msgid ""
"After a script has been written, it needs to be integrated into [."
"filename]#rc.d#.  The crucial step is to install the script in [.filename]#/"
"etc/rc.d# (for the base system) or [.filename]#/usr/local/etc/rc.d# (for "
"ports).  Both [.filename]#bsd.prog.mk# and [.filename]#bsd.port.mk# provide "
"convenient hooks for that, and usually you do not have to worry about the "
"proper ownership and mode.  System scripts should be installed from [."
"filename]#src/libexec/rc/rc.d# through the [.filename]#Makefile# found "
"there.  Port scripts can be installed using `USE_RC_SUBR` as described "
"extref:{porters-handbook}special[in the Porter's Handbook, rc-scripts]."
msgstr ""
"После написания скрипта его необходимо интегрировать в [.filename]#rc.d#. "
"Ключевой шаг — установка скрипта в [.filename]#/etc/rc.d# (для базовой "
"системы) или [.filename]#/usr/local/etc/rc.d# (для портов). И [.filename]#bsd"
".prog.mk#, и [.filename]#bsd.port.mk# предоставляют удобные механизмы для "
"этого, и обычно вам не нужно беспокоиться о правильных правах доступа и "
"режиме. Системные скрипты должны устанавливаться из [.filename]#src/libexec/"
"rc/rc.d# через [.filename]#Makefile#, находящийся там. Скрипты портов можно "
"установить с помощью `USE_RC_SUBR`, как описано extref:{porters-"
"handbook}special[в Руководстве FreeBSD по созданию портов, rc-scripts]."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:599
msgid ""
"However, we should consider beforehand the place of our script in the system "
"startup sequence.  The service handled by our script is likely to depend on "
"other services.  For instance, a network daemon cannot function without the "
"network interfaces and routing up and running.  Even if a service seems to "
"demand nothing, it can hardly start before the basic filesystems have been "
"checked and mounted."
msgstr ""
"Однако следует заранее продумать место нашего скрипта в последовательности "
"запуска системы.  Скорее всего, обслуживаемый нашим скриптом сервис зависит "
"от других сервисов.  Например, сетевой демон не может работать без поднятых "
"сетевых интерфейсов и маршрутизации.  Даже если сервис, казалось бы, ничего "
"не требует, он вряд ли сможет запуститься до проверки и монтирования "
"основных файловых систем."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:605
msgid ""
"We mentioned man:rcorder[8] already.  Now it is time to have a close look at "
"it.  In a nutshell, man:rcorder[8] takes a set of files, examines their "
"contents, and prints a dependency-ordered list of files from the set to "
"`stdout`.  The point is to keep dependency information _inside_ the files so "
"that each file can speak for itself only.  A file can specify the following "
"information:"
msgstr ""
"Мы уже упоминали man:rcorder[8]. Теперь пришло время рассмотреть его "
"подробнее. В двух словах, man:rcorder[8] принимает набор файлов, анализирует "
"их содержимое и выводит на `stdout` список этих файлов, упорядоченный по "
"зависимостям. Главная идея заключается в том, чтобы хранить информацию о "
"зависимостях _внутри_ файлов, чтобы каждый файл мог описывать только себя. "
"Файл может содержать следующую информацию:"

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:607
msgid ""
"the names of the \"conditions\" (which means services to us) it __provides__;"
msgstr ""
"имена \"условий\" (что для нас означает сервисы), которые он "
"__предоставляет__;"

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:608
msgid "the names of the \"conditions\" it __requires__;"
msgstr "имена \"условий\", которые он __требует__;"

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:609
msgid "the names of the \"conditions\" this file should run __before__;"
msgstr "имена \"условий\", перед которыми должен выполняться этот файл;"

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:610
msgid ""
"additional _keywords_ that can be used to select a subset from the whole set "
"of files (man:rcorder[8] can be instructed via options to include or omit "
"the files having particular keywords listed.)"
msgstr ""
"дополнительные _ключевые слова_, которые могут использоваться для выбора "
"подмножества из всего набора файлов (man:rcorder[8] может быть настроен с "
"помощью опций для включения или исключения файлов, содержащих указанные "
"ключевые слова.)"

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:615
msgid ""
"It is no surprise that man:rcorder[8] can handle only text files with a "
"syntax close to that of man:sh[1].  That is, special lines understood by man:"
"rcorder[8] look like man:sh[1] comments.  The syntax of such special lines "
"is rather rigid to simplify their processing.  See man:rcorder[8] for "
"details."
msgstr ""
"Неудивительно, что man:rcorder[8] может обрабатывать только текстовые файлы "
"с синтаксисом, близким к man:sh[1]. То есть специальные строки, понимаемые "
"man:rcorder[8], выглядят как комментарии в man:sh[1]. Синтаксис таких "
"специальных строк довольно жёсткий, чтобы упростить их обработку. "
"Подробности см. в man:rcorder[8]."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:618
msgid ""
"Besides using man:rcorder[8] special lines, a script can insist on its "
"dependency upon another service by just starting it forcibly.  This can be "
"needed when the other service is optional and will not start by itself "
"because the system admin has disabled it mistakenly in man:rc.conf[5]."
msgstr ""
"Помимо использования специальных строк man:rcorder[8], скрипт может "
"настаивать на своей зависимости от другой службы, просто принудительно "
"запуская её. Это может быть необходимо, когда другая служба является "
"опциональной и не запускается самостоятельно, потому что системный "
"администратор ошибочно отключил её в man:rc.conf[5]."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:620
msgid ""
"With this general knowledge in mind, let us consider the simple daemon "
"script enhanced with dependency stuff:"
msgstr ""
"С учетом этих общих знаний рассмотрим простой скрипт демона, дополненный "
"зависимостями:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:629
#, no-wrap
msgid ""
"# PROVIDE: mumbled oldmumble <.>\n"
"# REQUIRE: DAEMON cleanvar frotz <.>\n"
"# BEFORE:  LOGIN <.>\n"
"# KEYWORD: nojail shutdown <.>\n"
msgstr ""
"# PROVIDE: mumbled oldmumble <.>\n"
"# REQUIRE: DAEMON cleanvar frotz <.>\n"
"# BEFORE:  LOGIN <.>\n"
"# KEYWORD: nojail shutdown <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:637
#, no-wrap
msgid ""
"command=\"/usr/sbin/${name}\"\n"
"start_precmd=\"${name}_prestart\"\n"
msgstr ""
"command=\"/usr/sbin/${name}\"\n"
"start_precmd=\"${name}_prestart\"\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:646
#, no-wrap
msgid ""
"mumbled_prestart()\n"
"{\n"
"\tif ! checkyesno frotz_enable && \\\n"
"\t    ! /etc/rc.d/frotz forcestatus 1>/dev/null 2>&1; then\n"
"\t\tforce_depend frotz || return 1 <.>\n"
"\tfi\n"
"\treturn 0\n"
"}\n"
msgstr ""
"mumbled_prestart()\n"
"{\n"
"\tif ! checkyesno frotz_enable && \\\n"
"\t    ! /etc/rc.d/frotz forcestatus 1>/dev/null 2>&1; then\n"
"\t\tforce_depend frotz || return 1 <.>\n"
"\tfi\n"
"\treturn 0\n"
"}\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:652
msgid "As before, detailed analysis follows:"
msgstr "Как и ранее, следует детальный анализ:"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:655
msgid ""
"&#10122; That line declares the names of \"conditions\" our script "
"provides.  Now other scripts can record a dependency on our script by those "
"names."
msgstr ""
"&#10122; Эта строка объявляет названия \"условий\", которые предоставляет "
"наш скрипт. Теперь другие скрипты могут указывать зависимость от нашего "
"скрипта по этим именам."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:660
msgid ""
"Usually a script specifies a single condition provided.  However, nothing "
"prevents us from listing several conditions there, e.g., for compatibility "
"reasons."
msgstr ""
"Обычно скрипт указывает одно предоставленное условие. Однако ничто не мешает "
"нам перечислить несколько условий, например, по причинам совместимости."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:662
msgid ""
"In any case, the name of the main, or the only, `PROVIDE:` condition should "
"be the same as `${name}`."
msgstr ""
"В любом случае, название основного или единственного условия `PROVIDE:` "
"должно совпадать с `${name}`."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:666
msgid ""
"&#10123;&#10124; So our script indicates which \"conditions\" provided by "
"other scripts it depends on.  According to the lines, our script asks man:"
"rcorder[8] to put it after the script(s) providing [.filename]#DAEMON# and [."
"filename]#cleanvar#, but before that providing [.filename]#LOGIN#."
msgstr ""
"&#10123;&#10124; Таким образом, наш скрипт указывает, от каких \"условий\", "
"предоставляемых другими скриптами, он зависит. Согласно строкам, наш скрипт "
"просит man:rcorder[8] разместить его после скрипта(ов), предоставляющих [."
"filename]#DAEMON# и [.filename]#cleanvar#, но перед тем, который "
"предоставляет [.filename]#LOGIN#."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:672
msgid ""
"The `BEFORE:` line should not be abused to work around an incomplete "
"dependency list in the other script.  The appropriate case for using `BEFORE:"
"` is when the other script does not care about ours, but our script can do "
"its task better if run before the other one.  A typical real-life example is "
"the network interfaces vs. the firewall: While the interfaces do not depend "
"on the firewall in doing their job, the system security will benefit from "
"the firewall being ready before there is any network traffic."
msgstr ""
"Строку `BEFORE:` не следует использовать для обхода неполного списка "
"зависимостей в другом скрипте. Правильный случай для использования `BEFORE:` "
"— когда другой скрипт не зависит от нашего, но наш скрипт может выполнить "
"свою задачу лучше, если запустится до другого. Типичный пример из реальной "
"жизни — сетевые интерфейсы и межсетевой экран: хотя интерфейсы не зависят от "
"межсетевого экрана при выполнении своей работы, безопасность системы "
"выиграет, если межсетевой экран будет готов до начала сетевого трафика."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:676
msgid ""
"Besides conditions corresponding to a single service each, there are meta-"
"conditions and their \"placeholder\" scripts used to ensure that certain "
"groups of operations are performed before others.  These are denoted by [."
"filename]#UPPERCASE# names.  Their list and purposes can be found in man:"
"rc[8]."
msgstr ""
"Помимо условий, соответствующих отдельным службам, существуют метаусловия и "
"их \"заглушки\" скриптов, используемые для обеспечения выполнения "
"определённых групп операций в заданном порядке. Они обозначаются именами в [."
"filename]#ВЕРХНЕМ РЕГИСТРЕ#. Их список и назначение можно найти в man:rc[8]."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:682
msgid ""
"Keep in mind that putting a service name in the `REQUIRE:` line does not "
"guarantee that the service will actually be running by the time our script "
"starts.  The required service may fail to start or just be disabled in man:"
"rc.conf[5].  Obviously, man:rcorder[8] cannot track such details, and man:"
"rc[8] will not do that either.  Consequently, the application started by our "
"script should be able to cope with any required services being unavailable.  "
"In certain cases, we can help it as discussed crossref:rc-"
"scripting[forcedep, below]"
msgstr ""
"Имейте в виду, что указание имени службы в строке `REQUIRE:` не гарантирует, "
"что служба действительно будет запущена к моменту старта нашего скрипта. "
"Требуемая служба может не запуститься или быть отключена в man:rc.conf[5]. "
"Очевидно, man:rcorder[8] не может отслеживать такие детали, и man:rc[8] тоже "
"этого не делает. Следовательно, приложение, запускаемое нашим скриптом, "
"должно быть способно обрабатывать ситуации, когда требуемые службы "
"недоступны. В некоторых случаях мы можем помочь ему, как описано в crossref:"
"rc-scripting[forcedep, ниже]"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:687
msgid ""
"[[keywords]]&#10125; As we remember from the above text, man:rcorder[8] "
"keywords can be used to select or leave out some scripts.  Namely any man:"
"rcorder[8] consumer can specify through `-k` and `-s` options which keywords "
"are on the \"keep list\" and \"skip list\", respectively.  From all the "
"files to be dependency sorted, man:rcorder[8] will pick only those having a "
"keyword from the keep list (unless empty) and not having a keyword from the "
"skip list."
msgstr ""
"[[keywords]]&#10125; Как мы помним из текста выше, ключевые слова man:"
"rcorder[8] могут использоваться для выбора или исключения некоторых "
"скриптов. А именно, любой потребитель man:rcorder[8] может указать с помощью "
"опций `-k` и `-s`, какие ключевые слова находятся в \"списке сохранения\" и "
"\"списке пропуска\" соответственно. Из всех файлов, подлежащих сортировке по "
"зависимостям, man:rcorder[8] выберет только те, которые имеют ключевое слово "
"из списка сохранения (если он не пуст) и не имеют ключевого слова из списка "
"пропуска."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:690
msgid ""
"In FreeBSD, man:rcorder[8] is used by [.filename]#/etc/rc# and [.filename]#/"
"etc/rc.shutdown#.  These two scripts define the standard list of FreeBSD [."
"filename]#rc.d# keywords and their meanings as follows:"
msgstr ""
"В FreeBSD, man:rcorder[8] используется [.filename]#/etc/rc# и [.filename]#/"
"etc/rc.shutdown#. Эти два скрипта определяют стандартный список ключевых "
"слов [.filename]#rc.d# FreeBSD и их значения следующим образом:"

#. type: Labeled list
#: documentation/content/en/articles/rc-scripting/_index.adoc:691
#, no-wrap
msgid "nojail"
msgstr "nojail"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:693
msgid ""
"The service is not for man:jail[8] environment.  The automatic startup and "
"shutdown procedures will ignore the script if inside a jail."
msgstr ""
"Сервис не предназначен для окружения man:jail[8]. Процедуры автоматического "
"запуска и остановки будут игнорировать скрипт, если он находится внутри "
"клетки."

#. type: Labeled list
#: documentation/content/en/articles/rc-scripting/_index.adoc:694
#, no-wrap
msgid "nostart"
msgstr "nostart"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:697
msgid ""
"The service is to be started manually or not started at all.  The automatic "
"startup procedure will ignore the script.  In conjunction with the [."
"filename]#shutdown# keyword, this can be used to write scripts that do "
"something only at system shutdown."
msgstr ""
"Служба должна запускаться вручную или не запускаться вовсе. Процедура "
"автоматического запуска проигнорирует скрипт. В сочетании с ключевым словом "
"[.filename]#shutdown# это может использоваться для написания скриптов, "
"выполняющих действия только при выключении системы."

#. type: Labeled list
#: documentation/content/en/articles/rc-scripting/_index.adoc:698
#, no-wrap
msgid "shutdown"
msgstr "shutdown"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:699
msgid ""
"This keyword is to be listed __explicitly__ if the service needs to be "
"stopped before system shutdown."
msgstr ""
"Этот ключевой параметр должен быть указан __явно__, если службу необходимо "
"остановить перед завершением работы системы."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:712
msgid ""
"When the system is going to shut down, [.filename]#/etc/rc.shutdown# runs.  "
"It assumes that most [.filename]#rc.d# scripts have nothing to do at that "
"time.  Therefore [.filename]#/etc/rc.shutdown# selectively invokes [."
"filename]#rc.d# scripts with the [.filename]#shutdown# keyword, effectively "
"ignoring the rest of the scripts.  For even faster shutdown, [.filename]#/"
"etc/rc.shutdown# passes the [.filename]#faststop# command to the scripts it "
"runs so that they skip preliminary checks, e.g., the pidfile check.  As "
"dependent services should be stopped before their prerequisites, [."
"filename]#/etc/rc.shutdown# runs the scripts in reverse dependency order.  "
"If writing a real [.filename]#rc.d# script, you should consider whether it "
"is relevant at system shutdown time.  E.g., if your script does its work in "
"response to the [.filename]#start# command only, then you need not to "
"include this keyword.  However, if your script manages a service, it is "
"probably a good idea to stop it before the system proceeds to the final "
"stage of its shutdown sequence described in man:halt[8].  In particular, a "
"service should be stopped explicitly if it needs considerable time or "
"special actions to shut down cleanly.  A typical example of such a service "
"is a database engine."
msgstr ""
"Когда система собирается завершить работу, выполняется [.filename]#/etc/rc."
"shutdown#. Предполагается, что большинству скриптов [.filename]#rc.d# в этот "
"момент нечего делать. Поэтому [.filename]#/etc/rc.shutdown# выборочно "
"запускает скрипты [.filename]#rc.d# с ключевым словом [.filename]#shutdown#, "
"фактически игнорируя остальные скрипты. Для ещё более быстрого завершения "
"работы [.filename]#/etc/rc.shutdown# передаёт команду [.filename]#faststop# "
"запускаемым скриптам, чтобы они пропускали предварительные проверки, "
"например, проверку pid-файла. Поскольку зависимые службы должны быть "
"остановлены до своих зависимостей, [.filename]#/etc/rc.shutdown# запускает "
"скрипты в обратном порядке зависимостей. Если вы пишете настоящий скрипт [."
"filename]#rc.d#, стоит подумать, актуален ли он во время завершения работы "
"системы. Например, если ваш скрипт выполняет свою работу только в ответ на "
"команду [.filename]#start#, то включать это ключевое слово не нужно. Однако "
"если ваш скрипт управляет службой, вероятно, стоит остановить её до того, "
"как система перейдёт к финальной стадии завершения работы, описанной в man:"
"halt[8]. В частности, службу следует останавливать явно, если для её "
"корректного завершения требуется значительное время или специальные "
"действия. Типичный пример такой службы — система управления базами данных."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:716
msgid ""
"[[forcedep]]&#10126; To begin with, `force_depend` should be used with much "
"care.  It is generally better to revise the hierarchy of configuration "
"variables for your [.filename]#rc.d# scripts if they are interdependent."
msgstr ""
"[[forcedep]]&#10126; Прежде всего, `force_depend` следует использовать с "
"большой осторожностью. Обычно лучше пересмотреть иерархию конфигурационных "
"переменных для ваших [.filename]#rc.d# скриптов, если они взаимозависимы."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:725
msgid ""
"If you still cannot do without `force_depend`, the example offers an idiom "
"of how to invoke it conditionally.  In the example, our `mumbled` daemon "
"requires that another one, `frotz`, be started in advance.  However, `frotz` "
"is optional, too; and man:rcorder[8] knows nothing about such details.  "
"Fortunately, our script has access to all man:rc.conf[5] variables.  If "
"`frotz_enable` is true, we hope for the best and rely on [.filename]#rc.d# "
"to have started `frotz`.  Otherwise we forcibly check the status of "
"`frotz`.  Finally, we enforce our dependency on `frotz` if it is found to be "
"not running.  A warning message will be emitted by `force_depend` because it "
"should be invoked only if a misconfiguration has been detected."
msgstr ""
"Если вам всё ещё не обойтись без `force_depend`, в примере показано, как "
"вызвать его условно. В примере наш демон `mumbled` требует, чтобы другой "
"демон, `frotz`, был запущен заранее. Однако `frotz` также является "
"опциональным, и man:rcorder[8] ничего не знает о таких деталях. К счастью, "
"наш скрипт имеет доступ ко всем переменным man:rc.conf[5]. Если "
"`frotz_enable` имеет значение true, мы надеемся на лучшее и полагаемся на [."
"filename]#rc.d#, что `frotz` был запущен. В противном случае мы "
"принудительно проверяем статус `frotz`. Наконец, мы принудительно "
"устанавливаем зависимость от `frotz`, если обнаруживаем, что он не запущен. "
"`force_depend` выдаст предупреждение, так как его следует вызывать только в "
"случае обнаружения неправильной конфигурации."

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:727
#, no-wrap
msgid "Giving more flexibility to an rc.d script"
msgstr "Придание большей гибкости скрипту rc.d"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:736
msgid ""
"When invoked during startup or shutdown, an [.filename]#rc.d# script is "
"supposed to act on the entire subsystem it is responsible for.  E.g., [."
"filename]#/etc/rc.d/netif# should start or stop all network interfaces "
"described by man:rc.conf[5].  Either task can be uniquely indicated by a "
"single command argument such as `start` or `stop`.  Between startup and "
"shutdown, [.filename]#rc.d# scripts help the admin to control the running "
"system, and it is when the need for more flexibility and precision arises.  "
"For instance, the admin may want to add the settings of a new network "
"interface to man:rc.conf[5] and then to start it without interfering with "
"the operation of the existing interfaces.  Next time the admin may need to "
"shut down a single network interface.  In the spirit of the command line, "
"the respective [.filename]#rc.d# script calls for an extra argument, the "
"interface name."
msgstr ""
"При вызове во время запуска или завершения работы скрипт [.filename]#rc.d# "
"должен воздействовать на всю подсистему, за которую он отвечает. Например, [."
"filename]#/etc/rc.d/netif# должен запускать или останавливать все сетевые "
"интерфейсы, описанные в man:rc.conf[5]. Любая из этих задач может быть "
"однозначно указана единственным аргументом команды, таким как `start` или "
"`stop`. Между запуском и завершением работы скрипты [.filename]#rc.d# "
"помогают администратору управлять работающей системой, и именно тогда "
"возникает потребность в большей гибкости и точности. Например, администратор "
"может добавить настройки нового сетевого интерфейса в man:rc.conf[5], а "
"затем запустить его, не затрагивая работу существующих интерфейсов. В "
"следующий раз администратору может потребоваться остановить отдельный "
"сетевой интерфейс. В духе командной строки, соответствующий скрипт [."
"filename]#rc.d# требует дополнительного аргумента — имени интерфейса."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:739
msgid ""
"Fortunately, man:rc.subr[8] allows for passing any number of arguments to "
"script's methods (within the system limits).  Due to that, the changes in "
"the script itself can be minimal."
msgstr ""
"К счастью, man:rc.subr[8] позволяет передавать любое количество аргументов "
"(в пределах системных ограничений) методам скрипта. Благодаря этому "
"изменения в самом скрипте могут быть минимальными."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:744
msgid ""
"How can man:rc.subr[8] gain access to the extra command-line arguments.  "
"Should it just grab them directly? Not by any means.  Firstly, an man:sh[1] "
"function has no access to the positional parameters of its caller, but man:"
"rc.subr[8] is just a sack of such functions.  Secondly, the good manner of [."
"filename]#rc.d# dictates that it is for the main script to decide which "
"arguments are to be passed to its methods."
msgstr ""
"Как man:rc.subr[8] может получить доступ к дополнительным аргументам "
"командной строки. Должен ли он просто захватывать их напрямую? Ни в коем "
"случае. Во-первых, функция man:sh[1] не имеет доступа к позиционным "
"параметрам своего вызывающего объекта, но man:rc.subr[8] — это просто набор "
"таких функций. Во-вторых, хороший стиль [.filename]#rc.d# предписывает, что "
"именно главный скрипт должен решать, какие аргументы передавать его методам."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:748
msgid ""
"So the approach adopted by man:rc.subr[8] is as follows: `run_rc_command` "
"passes on all its arguments but the first one to the respective method "
"verbatim.  The first, omitted, argument is the name of the method itself: "
"`start`, `stop`, etc.  It will be shifted out by `run_rc_command`, so what "
"is `$2` in the original command line will be presented as `$1` to the "
"method, and so on."
msgstr ""
"Итак, подход, принятый в man:rc.subr[8], следующий: `run_rc_command` "
"передаёт все свои аргументы, кроме первого, в соответствующий метод в "
"неизменном виде. Первый, опущенный аргумент — это имя самого метода: "
"`start`, `stop` и т.д. Он будет удалён с помощью `shift` в `run_rc_command`, "
"так что то, что было `$2` в оригинальной командной строке, будет "
"представлено как `$1` в методе, и так далее."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:751
msgid ""
"To illustrate this opportunity, let us modify the primitive dummy script so "
"that its messages depend on the additional arguments supplied.  Here we go:"
msgstr ""
"Чтобы проиллюстрировать эту возможность, давайте изменим примитивный скрипт-"
"заглушку так, чтобы его сообщения зависели от дополнительных переданных "
"аргументов. Вот как это выглядит:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:763
#, no-wrap
msgid ""
"name=\"dummy\"\n"
"start_cmd=\"${name}_start\"\n"
"stop_cmd=\":\"\n"
"kiss_cmd=\"${name}_kiss\"\n"
"extra_commands=\"kiss\"\n"
msgstr ""
"name=\"dummy\"\n"
"start_cmd=\"${name}_start\"\n"
"stop_cmd=\":\"\n"
"kiss_cmd=\"${name}_kiss\"\n"
"extra_commands=\"kiss\"\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:772
#, no-wrap
msgid ""
"dummy_start()\n"
"{\n"
"        if [ $# -gt 0 ]; then <.>\n"
"                echo \"Greeting message: $*\"\n"
"        else\n"
"                echo \"Nothing started.\"\n"
"        fi\n"
"}\n"
msgstr ""
"dummy_start()\n"
"{\n"
"        if [ $# -gt 0 ]; then <.>\n"
"                echo \"Greeting message: $*\"\n"
"        else\n"
"                echo \"Nothing started.\"\n"
"        fi\n"
"}\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:788
#, no-wrap
msgid ""
"dummy_kiss()\n"
"{\n"
"        echo -n \"A ghost gives you a kiss\"\n"
"        if [ $# -gt 0 ]; then <.>\n"
"                echo -n \" and whispers: $*\"\n"
"        fi\n"
"        case \"$*\" in\n"
"        *[.!?])\n"
"                echo\n"
"                ;;\n"
"        *)\n"
"                echo .\n"
"                ;;\n"
"        esac\n"
"}\n"
msgstr ""
"dummy_kiss()\n"
"{\n"
"        echo -n \"A ghost gives you a kiss\"\n"
"        if [ $# -gt 0 ]; then <.>\n"
"                echo -n \" and whispers: $*\"\n"
"        fi\n"
"        case \"$*\" in\n"
"        *[.!?])\n"
"                echo\n"
"                ;;\n"
"        *)\n"
"                echo .\n"
"                ;;\n"
"        esac\n"
"}\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:791
#, no-wrap
msgid ""
"load_rc_config $name\n"
"run_rc_command \"$@\" <.>\n"
msgstr ""
"load_rc_config $name\n"
"run_rc_command \"$@\" <.>\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:794
msgid "What essential changes can we notice in the script?"
msgstr "Какие основные изменения мы можем заметить в скрипте?"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:799
msgid ""
"&#10122; All arguments you type after `start` can end up as positional "
"parameters to the respective method.  We can use them in any way according "
"to our task, skills, and fancy.  In the current example, we just pass all of "
"them to man:echo[1] as one string in the next line - note `$*` within the "
"double quotes.  Here is how the script can be invoked now:"
msgstr ""
"&#10122; Все аргументы, которые вы вводите после `start`, могут стать "
"позиционными параметрами для соответствующего метода. Мы можем использовать "
"их любым способом в соответствии с нашей задачей, навыками и предпочтениями. "
"В текущем примере мы просто передаем все их в man:echo[1] как одну строку в "
"следующей строке — обратите внимание на `$*` в двойных кавычках. Вот как "
"теперь можно вызывать этот скрипт:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:804
#, no-wrap
msgid ""
"# /etc/rc.d/dummy start\n"
"Nothing started.\n"
msgstr ""
"# /etc/rc.d/dummy start\n"
"Nothing started.\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:807
#, no-wrap
msgid ""
"# /etc/rc.d/dummy start Hello world!\n"
"Greeting message: Hello world!\n"
msgstr ""
"# /etc/rc.d/dummy start Hello world!\n"
"Greeting message: Hello world!\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:811
msgid ""
"&#10123; The same applies to any method our script provides, not only to a "
"standard one.  We have added a custom method named `kiss`, and it can take "
"advantage of the extra arguments not less than `start` does. E.g.:"
msgstr ""
"&#10123; То же самое относится к любому методу, который предоставляет наш "
"скрипт, не только к стандартному. Мы добавили пользовательский метод с "
"именем `kiss`, и он может использовать дополнительные аргументы не меньше, "
"чем `start`. Например:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:816
#, no-wrap
msgid ""
"# /etc/rc.d/dummy kiss\n"
"A ghost gives you a kiss.\n"
msgstr ""
"# /etc/rc.d/dummy kiss\n"
"A ghost gives you a kiss.\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:819
#, no-wrap
msgid ""
"# /etc/rc.d/dummy kiss Once I was Etaoin Shrdlu...\n"
"A ghost gives you a kiss and whispers: Once I was Etaoin Shrdlu...\n"
msgstr ""
"# /etc/rc.d/dummy kiss Once I was Etaoin Shrdlu...\n"
"A ghost gives you a kiss and whispers: Once I was Etaoin Shrdlu...\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:822
msgid ""
"&#10124; If we want just to pass all extra arguments to any method, we can "
"merely substitute `\"$@\"` for `\"$1\"` in the last line of our script, "
"where we invoke `run_rc_command`."
msgstr ""
"&#10124; Если мы хотим просто передать все дополнительные аргументы любому "
"методу, мы можем просто заменить `\"$@\"` на `\"$1\"` в последней строке "
"нашего скрипта, где мы вызываем `run_rc_command`."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:828
msgid ""
"An man:sh[1] programmer ought to understand the subtle difference between `"
"$*` and `$@` as the ways to designate all positional parameters.  For its in-"
"depth discussion, refer to a good handbook on man:sh[1] scripting.  _Do not_ "
"use the expressions until you fully understand them because their misuse "
"will result in buggy and insecure scripts."
msgstr ""
"Программист man:sh[1] должен понимать тонкую разницу между `$*` и `$@` как "
"способами обозначения всех позиционных параметров. Для детального обсуждения "
"обратитесь к хорошему руководству по написанию скриптов на man:sh[1]. _Не "
"используйте_ эти выражения, пока полностью не поймёте их, так как их "
"неправильное применение приведёт к созданию ненадёжных и небезопасных "
"скриптов."

#. type: delimited block = 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:835
msgid ""
"Currently `run_rc_command` may have a bug that prevents it from keeping the "
"original boundaries between arguments.  That is, arguments with embedded "
"whitespace may not be processed correctly.  The bug stems from `$*` misuse."
msgstr ""
"В настоящее время в `run_rc_command` может присутствовать ошибка, которая "
"мешает ему сохранять исходные границы между аргументами. То есть аргументы с "
"встроенными пробелами могут обрабатываться некорректно. Ошибка возникает из-"
"за неправильного использования `$*`."

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:838
#, no-wrap
msgid "Making a script ready for Service Jails"
msgstr "Подготовка скрипта для сервисных клеток"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:841
msgid ""
"Scripts which start a long running service are suitable for service jails, "
"and should come with a suitable service jail configuration."
msgstr ""
"Скрипты, запускающие долго работающую службу, подходят для служебных клеток "
"и должны поставляться с соответствующей конфигурацией сервисной клетки."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:843
msgid ""
"Some examples of scripts which are not suitable to run in a service jail:"
msgstr ""
"Некоторые примеры скриптов, которые не подходят для запуска в сервисной "
"клетке:"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:845
msgid ""
"any script which in the start command only changes a runtime setting for "
"programs or the kernel,"
msgstr ""
"любой скрипт, который в команде start только изменяет настройки времени "
"выполнения для программ или ядра,"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:846
msgid "or tries to mount something,"
msgstr "или пытается что-то смонтировать,"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:847
msgid "or finds and deletes files"
msgstr "или находит и удаляет файлы"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:849
msgid ""
"Scripts not suitable to run in a service jail need to prevent the use within "
"service jails."
msgstr ""
"Необходимо предотвратить использование внутри сервисных клеток скриптов, не "
"предназначенных для запуска в сервисной клетке."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:851
msgid ""
"A script with a long running service which needs to do something listed "
"above before the start or after the stop, can either be split-up into two "
"scripts with dependencies, or use the precommand and postcommand parts of "
"the script to perform this action."
msgstr ""
"Скрипт с долго работающей службой, которому необходимо выполнить одно из "
"перечисленных выше действий перед запуском или после остановки, может быть "
"разделён на два скрипта с зависимостями или использовать части `precommand` "
"и `postcommand` скрипта для выполнения этого действия."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:854
msgid ""
"By default, only the start and stop parts of a script are run within a "
"service jail, the rest is run outside the jail.  As such any setting used in "
"the start/stop parts of the script can not be set from e.g. a precommand."
msgstr ""
"По умолчанию только части `start` и `stop` скрипта выполняются внутри "
"сервисной клетки, остальное выполняется вне клетки. Таким образом, любые "
"настройки, используемые в частях `start`/`stop` скрипта, не могут быть "
"заданы, например, из `precommand`."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:856
msgid ""
"To make a script ready for use with extref:{handbook}jails[Service Jails, "
"service-jails], only one more config line needs to be inserted:"
msgstr ""
"Чтобы сделать скрипт готовым к использованию с extref:{handbook}jails["
"Сервисными Клетками, service-jails], необходимо добавить всего лишь одну "
"дополнительную конфигурационную строку:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:866
#: documentation/content/en/articles/rc-scripting/_index.adoc:899
#, no-wrap
msgid ""
"name=\"dummy\"\n"
"start_cmd=\"${name}_start\"\n"
"stop_cmd=\":\"\n"
msgstr ""
"name=\"dummy\"\n"
"start_cmd=\"${name}_start\"\n"
"stop_cmd=\":\"\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:868
#, no-wrap
msgid ": ${dummy_svcj_options:=\"\"} <.>\n"
msgstr ": ${dummy_svcj_options:=\"\"} <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:873
#: documentation/content/en/articles/rc-scripting/_index.adoc:904
#, no-wrap
msgid ""
"dummy_start()\n"
"{\n"
"        echo \"Nothing started.\"\n"
"}\n"
msgstr ""
"dummy_start()\n"
"{\n"
"        echo \"Nothing started.\"\n"
"}\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:880
msgid ""
"&#10122; If it makes sense that the script runs in a jail, it must have an "
"overridable service jails configuration.  If it does not need network access "
"or access to any other resource which is restricted in jails, an empty "
"config like displayed is enough."
msgstr ""
"&#10122; Если имеет смысл, чтобы скрипт выполнялся в клетке, он должен иметь "
"переопределяемую конфигурацию сервисных клеток. Если ему не требуется доступ "
"к сети или любым другим ресурсам, которые ограничены в клетках, достаточно "
"пустой конфигурации, как показано."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:885
msgid ""
"Strictly speaking an empty config is not needed, but it explicitly describes "
"that the script is service jails ready, and that it does not need additional "
"jail permissions.  As such it is highly recommended to add such an empty "
"config in such a case.  The most common option to use is \"net_basic\", "
"which enables the use of the hosts IPv4 and IPv6 addresses.  All possible "
"options are explained in man:rc.conf[5]."
msgstr ""
"Строго говоря, пустая конфигурация не обязательна, но она явно указывает, "
"что скрипт готов к работе с сервисными клетками и не требует дополнительных "
"разрешений для клеток. Поэтому настоятельно рекомендуется добавить такую "
"пустую конфигурацию в таком случае. Наиболее распространённая опция — "
"\"net_basic\", которая позволяет использовать IPv4 и IPv6 адреса хоста. Все "
"возможные опции описаны в man:rc.conf[5]."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:887
msgid ""
"If a setting for the start/stop depends on variables from the rc-framework "
"(e.g., set inside man:rc.conf[5]), this needs to be handled by "
"``load_rc_config`` and ``run_rc_command`` instead of inside a precommand."
msgstr ""
"Если настройка запуска/остановки зависит от переменных из rc-фреймворка "
"(например, заданных в man:rc.conf[5]), это должно обрабатываться с помощью "
"``load_rc_config`` и ``run_rc_command``, а не внутри precommand."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:889
msgid ""
"If for some reason a script can not be run within a service jail, e.g., "
"because it is not possible to run or it does not make sense to run it in a "
"jail, use the following:"
msgstr ""
"Если по какой-то причине скрипт не может быть запущен внутри сервисной "
"клетки, например, потому что его невозможно запустить или нет смысла "
"запускать его в клетке, используйте следующее:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:908
#, no-wrap
msgid ""
"load_rc_config $name\n"
"dummy_svcj=\"NO\"\t\t# does not make sense to run in a svcj <.>\n"
"run_rc_command \"$1\"\n"
msgstr ""
"load_rc_config $name\n"
"dummy_svcj=\"NO\"\t\t# does not make sense to run in a svcj <.>\n"
"run_rc_command \"$1\"\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:911
msgid ""
"&#10122; The disabling needs to happen after the ``load_rc_config`` call, "
"else a man:rc.conf[5] setting may override it."
msgstr ""
"&#10122; Отключение должно происходить после вызова ``load_rc_config``, "
"иначе параметр из man:rc.conf[5] может переопределить его."

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:913
#, no-wrap
msgid "Advanced rc-scripting: Instancing"
msgstr "Продвинутые сценарии rc: запуск нескольких экземпляров"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:921
msgid ""
"Sometimes it is useful to run several instances of a service.  Typically you "
"want to be able to start/stop such instances independently, and you want to "
"have a separate config file for each instance.  Each instance should be "
"started at boot, survive updates, and benefit from updates."
msgstr ""
"Иногда полезно запускать несколько экземпляров службы. Обычно требуется "
"иметь возможность независимо запускать/останавливать такие экземпляры, а "
"также иметь отдельный файл конфигурации для каждого из них. Каждый экземпляр "
"должен запускаться при загрузке, после обновления каждый экземпляр должен "
"оставаться, и при этом должен обновиться."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:923
msgid "Here is an example of a rc script which supports this:"
msgstr "Вот пример rc-скрипта, который поддерживает это:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:941
#, no-wrap
msgid ""
"#\n"
"# PROVIDE: dummy\n"
"# REQUIRE: NETWORKING SERVERS\n"
"# KEYWORD: shutdown\n"
"#\n"
"# Add these following line to /etc/rc.conf.local or /etc/rc.conf\n"
"# to enable this service:\n"
"#\n"
"# dummy_enable (bool):\tSet it to YES to enable dummy on startup.\n"
"#\t\t\tDefault: NO\n"
"# dummy_user (string):\tUser account to run with.\n"
"#\t\t\tDefault: www\n"
"#\n"
msgstr ""
"#\n"
"# PROVIDE: dummy\n"
"# REQUIRE: NETWORKING SERVERS\n"
"# KEYWORD: shutdown\n"
"#\n"
"# Add these following line to /etc/rc.conf.local or /etc/rc.conf\n"
"# to enable this service:\n"
"#\n"
"# dummy_enable (bool):\tSet it to YES to enable dummy on startup.\n"
"#\t\t\tDefault: NO\n"
"# dummy_user (string):\tUser account to run with.\n"
"#\t\t\tDefault: www\n"
"#\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:954
#, no-wrap
msgid ""
"case $0 in <.>\n"
"/etc/rc*)\n"
"\t# during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown),\n"
"\t# so get the name of the script from $_file\n"
"\tname=$_file\n"
"\t;;\n"
"*)\n"
"\tname=$0\n"
"\t;;\n"
"esac\n"
msgstr ""
"case $0 in <.>\n"
"/etc/rc*)\n"
"\t# during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown),\n"
"\t# so get the name of the script from $_file\n"
"\tname=$_file\n"
"\t;;\n"
"*)\n"
"\tname=$0\n"
"\t;;\n"
"esac\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:959
#, no-wrap
msgid ""
"name=${name##*/} <.>\n"
"rcvar=\"${name}_enable\" <.>\n"
"desc=\"Short description of this service\"\n"
"command=\"/usr/local/sbin/dummy\"\n"
msgstr ""
"name=${name##*/} <.>\n"
"rcvar=\"${name}_enable\" <.>\n"
"desc=\"Short description of this service\"\n"
"command=\"/usr/local/sbin/dummy\"\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:961
#, no-wrap
msgid "load_rc_config \"$name\"\n"
msgstr "load_rc_config \"$name\"\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:965
#, no-wrap
msgid ""
"eval \"${rcvar}=\\${${rcvar}:-'NO'}\" <.>\n"
"eval \"${name}_svcj_options=\\${${name}_svcj_options:-'net_basic'}\" <.>\n"
"eval \"_dummy_user=\\${${name}_user:-'www'}\" <.>\n"
msgstr ""
"eval \"${rcvar}=\\${${rcvar}:-'NO'}\" <.>\n"
"eval \"${name}_svcj_options=\\${${name}_svcj_options:-'net_basic'}\" <.>\n"
"eval \"_dummy_user=\\${${name}_user:-'www'}\" <.>\n"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:970
#, no-wrap
msgid ""
"_dummy_configname=/usr/local/etc/${name}.cfg <.>\n"
"pidfile=/var/run/dummy/${name}.pid\n"
"required_files ${_dummy_configname}\n"
"command_args=\"-u ${_dummy_user} -c ${_dummy_configfile} -p ${pidfile}\"\n"
msgstr ""
"_dummy_configname=/usr/local/etc/${name}.cfg <.>\n"
"pidfile=/var/run/dummy/${name}.pid\n"
"required_files ${_dummy_configname}\n"
"command_args=\"-u ${_dummy_user} -c ${_dummy_configfile} -p ${pidfile}\"\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:978
msgid ""
"&#10122; and &#10123; make sure to set the name variable to the man:"
"basename[1] of the script name.  If the filename is [.filename]#/usr/local/"
"etc/rc.d/dummy#, name is set to [.filename]#dummy#.  This way changing the "
"filename of the rc script changes automatically the content of the name "
"variable."
msgstr ""
"&#10122; и &#10123; убедитесь, что переменная name установлена в значение "
"man:basename[1] имени скрипта. Если имя файла — [.filename]#/usr/local/etc/"
"rc.d/dummy#, то name будет установлено в [.filename]#dummy#. Таким образом, "
"изменение имени rc-скрипта автоматически изменит содержимое переменной name."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:981
msgid ""
"&#10124; specifies the variable name which is used in [.filename]#rc.conf# "
"to enable this service based upon the filename of this script.  In this "
"example this resolves to dummy_enable."
msgstr ""
"&#10124; указывает имя переменной, которая используется в [.filename]#rc."
"conf# для включения этой службы на основе имени файла этого скрипта. В "
"данном примере это преобразуется в dummy_enable."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:983
msgid "&#10125; makes sure the default for the _enable variable is NO."
msgstr ""
"&#10125; убеждается, что значение по умолчанию для переменной _enable "
"установлено в NO."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:986
msgid ""
"&#10126; is an example of having some defaults for service specific "
"framework variables, in this case the service jails options."
msgstr ""
"&#10126; Вот пример установки некоторых значений по умолчанию для переменных "
"фреймворка, специфичных для службы, в данном случае — опций клетки службы."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:988
msgid ""
"&#10127; and &#10128; set variables internal to the script (pay attention to "
"the underscore in front of _dummy_user to make it different from dummy_user "
"which can be set in [.filename]#rc.conf#)."
msgstr ""
"&#10127; и &#10128; устанавливают переменные, внутренние для скрипта "
"(обратите внимание на подчёркивание в начале _dummy_user, чтобы отличать её "
"от dummy_user, которая может быть задана в [.filename]#rc.conf#)."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:991
msgid ""
"The part in &#10126; is for variables which are not used inside the script "
"itself but in the rc framework.  All the variables which are used as "
"parameters somewhere in the script are assigned to a generic variable like "
"in &#10128; to make it more easy to reference them (no need to eval them at "
"each place of use)."
msgstr ""
"Часть в &#10126; предназначена для переменных, которые не используются "
"внутри самого скрипта, но используются в рамках rc. Все переменные, которые "
"используются как параметры в скрипте, присваиваются общей переменной, как в "
"&#10128;, чтобы упростить их использование (нет необходимости выполнять eval "
"при каждом обращении)."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:994
msgid ""
"This script will now behave differently if the start script has a different "
"name.  This allows to create symlinks to it:"
msgstr ""
"Этот скрипт теперь будет вести себя по-другому, если скрипт запуска имеет "
"другое имя. Это позволяет создавать символьные ссылки на него:"

#. type: delimited block . 4
#: documentation/content/en/articles/rc-scripting/_index.adoc:1000
#, no-wrap
msgid ""
"# ln -s dummy /usr/local/etc/rc.d/dummy_foo\n"
"# sysrc dummy_foo_enable=YES\n"
"# service dummy_foo start\n"
msgstr ""
"# ln -s dummy /usr/local/etc/rc.d/dummy_foo\n"
"# sysrc dummy_foo_enable=YES\n"
"# service dummy_foo start\n"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:1005
msgid ""
"The above creates an instance of the dummy service with the name dummy_foo.  "
"It does not use the config file [.filename]#/usr/local/etc/dummy.cfg# but "
"the config file [.filename]#/usr/local/etc/dummy_foo.cfg# (&#10128;), and it "
"uses the PID file [.filename]#/var/run/dummy/dummy_foo.pid# instead of [."
"filename]#/var/run/dummy/dummy.pid#."
msgstr ""
"Вышеприведенное создает экземпляр службы dummy с именем dummy_foo. Он "
"использует не файл конфигурации [.filename]#/usr/local/etc/dummy.cfg#, а "
"файл конфигурации [.filename]#/usr/local/etc/dummy_foo.cfg# (&#10128;), и "
"использует PID-файл [.filename]#/var/run/dummy/dummy_foo.pid# вместо [."
"filename]#/var/run/dummy/dummy.pid#."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:1012
msgid ""
"The services dummy and dummy_foo can be managed independently of each other, "
"while having the start script update itself on package update (due to the "
"symlink).  This does not update the REQUIRE line, as such there is no easy "
"way of depending on a specific instance.  To depend upon a specific instance "
"in the startup order a copy needs to be made instead of using a symlink.  "
"This prevents the automatic pick-up of changes to the start script when an "
"update is installed."
msgstr ""
"Сервисы dummy и dummy_foo могут управляться независимо друг от друга, при "
"этом скрипт запуска обновляется автоматически при обновлении пакета "
"(благодаря символьной ссылке). Это не обновляет строку REQUIRE, поэтому нет "
"простого способа зависеть от конкретного экземпляра. Чтобы зависеть от "
"конкретного экземпляра в порядке запуска, необходимо создать копию вместо "
"использования символьной ссылки. Это предотвращает автоматическое применение "
"изменений в скрипте запуска при установке обновления."

#. type: Title ==
#: documentation/content/en/articles/rc-scripting/_index.adoc:1014
#, no-wrap
msgid "Further reading"
msgstr "Дополнительная литература"

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:1018
msgid ""
"[[lukem]]http://www.mewburn.net/luke/papers/rc.d.pdf[The original article by "
"Luke Mewburn] offers a general overview of [.filename]#rc.d# and detailed "
"rationale for its design decisions.  It provides insight on the whole [."
"filename]#rc.d# framework and its place in a modern BSD operating system."
msgstr ""
"[[lukem]]http://www.mewburn.net/luke/papers/rc.d.pdf[Оригинальная статья "
"Люка Мьюберна] предлагает общий обзор [.filename]#rc.d# и подробное "
"обоснование принятых при его проектировании решений. В ней представлено "
"понимание всего фреймворка [.filename]#rc.d# и его места в современной BSD-"
"системе."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:1021
msgid ""
"[[manpages]]The manual pages man:rc[8], man:rc.subr[8], and man:rcorder[8] "
"document the [.filename]#rc.d# components in great detail.  You cannot fully "
"use the [.filename]#rc.d# power without studying the manual pages and "
"referring to them while writing your own scripts."
msgstr ""
"[[manpages]]Руководства man:rc[8], man:rc.subr[8] и man:rcorder[8] подробно "
"описывают компоненты [.filename]#rc.d#. Без изучения этих руководств и "
"обращения к ним при написании собственных скриптов невозможно в полной мере "
"использовать возможности [.filename]#rc.d#."

#. type: Plain text
#: documentation/content/en/articles/rc-scripting/_index.adoc:1025
msgid ""
"The major source of working, real-life examples is [.filename]#/etc/rc.d# in "
"a live system.  Its contents are easy and pleasant to read because most "
"rough corners are hidden deep in man:rc.subr[8].  Keep in mind though that "
"the [.filename]#/etc/rc.d# scripts were not written by angels, so they might "
"suffer from bugs and suboptimal design decisions.  Now you can improve them!"
msgstr ""
"Основным источником рабочих, жизненных примеров является [.filename]#/etc/rc."
"d# в работающей системе. Его содержимое легко и приятно читать, поскольку "
"большинство сложных моментов скрыто глубоко в man:rc.subr[8]. Однако "
"помните, что скрипты в [.filename]#/etc/rc.d# были написаны не ангелами, "
"поэтому они могут содержать ошибки и неоптимальные решения. Теперь вы можете "
"их улучшить!"