«Debian - установка rc.local» и «Файл:Bcm43142-2.png»: разница между страницами

Материал из support.qbpro.ru
(Различия между страницами)
imported>Vix
(Новая страница: « == Установка службы авто-запуска в системе rc.local == * Создаем файл: /etc/rc.local :>/etc/rc.local * Содер…»)
 
imported>Supportadmin
(Supportadmin загружена новая версия «Файл:Bcm43142-2.png»)
 
Строка 1: Строка 1:


== Установка службы авто-запуска в системе rc.local ==
* Создаем файл: /etc/rc.local
:>/etc/rc.local
* Содержимое:
#!/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.
 
exit 0
* Создаем файл: /etc/systemd/system/rc-local.service
:>/etc/systemd/system/rc-local.service
* Содержимое:
[Unit]
  Description=/etc/rc.local Compatibility
  ConditionPathExists=/etc/rc.local
[Service]
  Type=forking
  ExecStart=/etc/rc.local start
  TimeoutSec=0
  StandardOutput=tty
  RemainAfterExit=yes
  SysVStartPriority=99
[Install]
  WantedBy=multi-user.target
* Даем права на запуск: /etc/rc.local
chmod +x /etc/rc.local
* Включаем сервис rc-local:
systemctl enable rc-local
systemctl start rc-local.service
* Проверяем работу:
systemctl status rc-local.service
* Вывод правильный:
● rc-local.service - /etc/rc.local Compatibility
  Loaded: loaded (/etc/systemd/system/rc-local.service; enabled; vendor preset:
  Drop-In: /lib/systemd/system/rc-local.service.d
          └─debian.conf
  Active: active (exited) since Tue 2017-07-25 11:10:09 EEST; 7s ago
  Process: 1148 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
Июл 25 11:10:09 webserver systemd[1]: Starting /etc/rc.local Compatibility...
Июл 25 11:10:09 webserver systemd[1]: Started /etc/rc.local Compatibility.
<hr>
Ресурсы:
* [https://softnastroy.com/content/vklyuchaem-rclocal-v-debian-9-stretch.html Спасибо Автору!]

Версия от 11:41, 1 октября 2017