无法正确运行 rc.local

无法正确运行 rc.local

我尝试将其作为启动项运行,但似乎什么也没发生。在终端中执行的相同命令运行完美。

#!/bin/sh -e
#
# rc.local
#

cd /root/open/ && screen -dm python fn_tcp2.py
exit 0

重启后

systemctl status rc-local.service

回复

● 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: active (exited) since Sat 2017-05-20 13:28:12 EDT; 13min ago
  Process: 811 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
 Main PID: 821 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/rc-local.service

May 20 13:28:12 ubuntu16 systemd[1]: Starting /etc/rc.local Compatibility...
May 20 13:28:12 ubuntu16 systemd[1]: Started /etc/rc.local Compatibility.

感谢您的帮助

相关内容