{"id":482,"date":"2018-11-14T12:45:11","date_gmt":"2018-11-14T15:45:11","guid":{"rendered":"http:\/\/www.bfnetworks.com.br\/?p=482"},"modified":"2022-07-15T10:18:34","modified_gmt":"2022-07-15T13:18:34","slug":"como-adicionar-habilitar-rc-local-debian-9","status":"publish","type":"post","link":"https:\/\/bfnetworks.com.br\/como-adicionar-habilitar-rc-local-debian-9\/","title":{"rendered":"COMO ADICIONAR \/ HABILITAR RC.LOCAL – DEBIAN 9"},"content":{"rendered":"

O famoso arquivo rc.local tem sido descontinuado no Debian 9, ele iniciava junto com o sistema, aqui mostrarei uma das maneiras de reativar usando-o como servi\u00e7o no SystemD.
\nEdite o arquivo com o comando abaixo, e adicione as linhas seguintes do comando:
\n

\n
vi \/etc\/systemd\/system\/rc-local.service<\/div> <\/div><\/p>\n
[Unit]<\/strong>\nDescription=\/etc\/rc.local\nConditionPathExists=\/etc\/rc.local\n[Service]<\/strong>\nType=forking\nExecStart=\/etc\/rc.local start\nTimeoutSec=0\nStandardOutput=tty\nRemainAfterExit=yes\nSysVStartPriority=99\n[Install]<\/strong>\nWantedBy=multi-user.target\n<\/pre>\n

Crie e edite o arquivo rc.local como abaixo:
\n

\n
vi \/etc\/rc.local<\/div> <\/div><\/p>\n
#!\/bin\/sh -e\nexit 0\n<\/pre>\n

Ajustando permiss\u00f5es do arquivo, para executar:
\n

\n
chmod +x \/etc\/rc.local<\/div> <\/div>
\nHabilitando servi\u00e7o na inicializa\u00e7\u00e3o, iniciando e verificando status:
\n
\n
systemctl enable rc-local<\/div>
systemctl start rc-local<\/div>
systemctl status rc-local<\/div> <\/div><\/p>\n
\u25cf rc-local.service<\/strong> - \/etc\/rc.local\n   Loaded: loaded (\/etc\/systemd\/system\/rc-local.service; enabled; vendor preset: enabled)\n  Drop-In: \/lib\/systemd\/system\/rc-local.service.d\n           \u2514\u2500debian.conf\n   Active: active (exited)<\/strong> since Fri 2018-11-16 14:44:58 UTC; 3min 37s ago\n  Process: 673 ExecStart=\/etc\/rc.local start (code=exited, status=0\/SUCCESS)\n    Tasks: 0 (limit: 4915)\n   CGroup: \/system.slice\/rc-local.service\nNov 16 14:44:58 sanji systemd[1]: Starting \/etc\/rc.local...\nNov 16 14:44:58 sanji systemd[1]: Started \/etc\/rc.local.\n<\/pre>\n

FONTE<\/h3>\n

Linux : How to add rc.local in Debian 9<\/a><\/p><\/blockquote>\n