Debian 9中的rc.local在哪里(Debian Stretch)

Omi*_*eri 35 debian

似乎Debian Stretch/etc/rc.local的最新稳定版Debian中没有.它在哪里?/etc/rc.local是否已过时?

SYN*_*SYN 56

rc.local 正在被弃用.

看来你仍然可以拥有一个:

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
Run Code Online (Sandbox Code Playgroud)

应启用供应商预设.你可以echo 123 >/proof在你的rc.local中添加一些并重启,确保它有效 - 我确认它,使用EC2上的最后一个Debian Stretch AMI,...

  • 它实际上是一个很大的错误,它贬低了rc.local这样一个经过验证的系统部分!如果你转向另一个像systemd这样的东西 - 好的,只是*不要使用*旧的部分,但为什么删除它? (42认同)
  • 被弃用有利于什么? (9认同)