如何在ubuntu16.04上添加开机自启动的python脚本
复制脚本到/目录/etc/init.d/下,并赋予脚本执行权限
示例bash脚本如下所示
#!/bin/sh ### BEGIN INIT INFO # Provides: monitor-agent # Short-Description: Start and stop monitor-agent # Description: monitor is the monitoring agent component for vinzor # Required-Start: $remote_fs $local_fs # Required-Stop: $remote_fs $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 ### END INIT INFO . /lib/lsb/init-functions PATH=$PATH:/sbin #