求问安完之后/etc目录下为什么没有rc.local
Tofloor
poster avatar
mrdoubleu
deepin
2017-11-02 07:16
Author
目前只有,rc0.d到rc6.d文件夹,还有rcS.d这8个文件夹,没有rc.local,为什么会这样呢?
Reply Favorite View the author
All Replies
avatar
36******12@qq.com
deepin
2017-11-02 07:33
#1
同问下,哈哈
Reply View the author
avatar
mrdoubleu
deepin
2017-11-02 07:45
#2
我现在需要增加下开机启动的命令,为什么找不到这个文件呢?求大神
Reply View the author
avatar
jingle
deepin
2017-11-02 16:33
#3
Reply View the author
avatar
jingle
deepin
2017-11-02 16:33
#4
https://bbs.deepin.org/post/147581
我现在需要增加下开机启动的命令,为什么找不到这个文件呢?求大神

https://bbs.deepin.org/post/139321 4楼
Reply View the author
avatar
134******40
deepin
2017-11-02 22:47
#5
上面已经回答了,deepin使用了新的systemd的方式管理这些开机启动命令,默认是没有这个文件夹,不过按照3楼的做法也能启动老的方式。
Reply View the author
avatar
billy123456
deepin
2017-11-03 00:51
#6
现在的操作系统基本都没有这个文件,你是不是看了太早发布的文章?
Reply View the author
avatar
icelee123
deepin
2017-11-03 04:08
#7
之所以还能用rc.local 是systemd为了兼容刻意做了一个service
  1. ● rc-local.service - /etc/rc.local Compatibility
  2.    Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset: enabled)
  3.   Drop-In: /lib/systemd/system/rc-local.service.d
  4.            └─debian.conf
  5.    Active: inactive (dead)
Copy the Code


服务如下
  1. #  This file is part of systemd.
  2. #
  3. #  systemd is free software; you can redistribute it and/or modify it
  4. #  under the terms of the GNU Lesser General Public License as published by
  5. #  the Free Software Foundation; either version 2.1 of the License, or
  6. #  (at your option) any later version.

  7. # This unit gets pulled automatically into multi-user.target by
  8. # systemd-rc-local-generator if /etc/rc.local is executable.
  9. [Unit]
  10. Description=/etc/rc.local Compatibility
  11. ConditionFileIsExecutable=/etc/rc.local
  12. After=network.target

  13. [Service]
  14. Type=forking
  15. ExecStart=/etc/rc.local start
  16. TimeoutSec=0
  17. RemainAfterExit=yes
  18. GuessMainPID=no
Copy the Code
Reply View the author