Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is rc.local in Debian 9 (Debian Stretch)

Tags:

debian

It seems there is no /etc/rc.local in the latest stable version of Debian, Debian Stretch. Where is it? Is /etc/rc.local obsolete?

like image 407
Omidreza Bagheri Avatar asked Jun 28 '17 08:06

Omidreza Bagheri


1 Answers

rc.local is being deprecated.

It seems you can still have one though:

cat <<EOF >/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 EOF chmod +x /etc/rc.local systemctl daemon-reload systemctl start rc-local systemctl status rc-local ● rc-local.service - /etc/rc.local Compatibility    Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset: enabled)   Drop-In: /lib/systemd/system/rc-local.service.d            └─debian.conf    Active: inactive (dead) Condition: start condition failed at Wed 2017-06-28 11:32:36 UTC; 3min 13s ago 

The vendor preset should be enabled. You can add some echo 123 >/proof to your rc.local and reboot, making sure it works - I confirm it does, using the last Debian Stretch AMI on EC2, ...

like image 58
SYN Avatar answered Sep 23 '22 05:09

SYN