Rc.local

rc.local – jeden ze skryptów startowych w systemach uniksopodobnych, takich jak Linux, FreeBSD[1], OpenBSD[2] itp. Najczęściej występuje on w katalogu /etc/, bądź /etc/rc.d/. Podczas uruchamiania systemu operacyjnego skrypt rc.local jest wywoływany jako ostatni.

Podejście do skryptów uruchomieniowych różni się między poszczególnymi odmianami systemów, dlatego rc.local ze względu na swoją prostotę zyskał uniwersalny wymiar. Administratorzy często używają tego skryptu do wykonania drobnych poleceń organizacyjnych już po uruchomieniu kluczowych programów usługowych serwera.

W nowszych systemach (m.in. takich które używają systemu Systemd) widoczne jest odchodzenie od użycia skryptu rc.local. Dla wstecznej kompatybilności, istnieje możliwość przywrócenia uwzględniania skrypt podczas bootowania systemu[3].

Przykłady

Komunikat wywołania rc.local w Ubuntu Linux

* Running local boot scripts (/etc/rc.local)                            [ OK ]

Zwyczajowo podczas instalacji systemu tworzony rc.local jest pusty, bądź zawiera komentarze:

Fragment rc.local w Ubuntu

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

Fragment rc.local w OpenBSD

#       $OpenBSD: rc.local,v 1.39 2006/07/28 20:19:46 sturm Exp $
# Site-specific startup actions, daemons, and other things which
# can be done AFTER your system goes into securemode.  For actions
# which should be done BEFORE your system has gone into securemode
# please see /etc/rc.securelevel.

Przypisy

  1. BSD System Manager's Manual rc(8) - rc.local [online], www.freebsd.org [dostęp 2019-10-04].
  2. rc.local - OpenBSD [online], nixdoc.net [dostęp 2019-10-04].
  3. Przywrócenie działania rc.local w Debianie 9 i nowszych [online], Blog.Kowalsio.com, 19 kwietnia 2018 [dostęp 2019-10-11] (pol.).

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.
Kembali kehalaman sebelumnya