• 树莓派开机启动


    vi /etc/init.d/sss

    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides: tpl
    # Required-Start:    $local_fs $syslog $remote_fs dbus
    # Required-Stop:     $local_fs $syslog $remote_fs
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Start tpl daemons
    ### END INIT INFO
    #
    # bluez    Bluetooth subsystem starting and stopping
    #
    # originally from bluez's scripts/bluetooth.init
    #
    # Edd Dumbill <ejad@debian.org>
    # LSB 3.0 compilance and enhancements by Filippo Giunchedi <filippo@debian.org>
    #
    # Updated for bluez 4.7 by Mario Limonciello <mario_limonciello@dell.com>
    # Updated for bluez 5.5 by Nobuhiro Iwamatsu <iwamatsu@debian.org>
    #
    # Note: older daemons like dund pand hidd are now shipped inside the
    # bluez-compat package
    
    PIDFILE=/var/tmp/tpl.pid
    
    case $1 in
      start)
    	  fdate=$(date +%Y%m%d)
    
    python -u /home/pi/py/TPL.py >> /home/pi/py/log${fdate}.log  & echo $! > $PIDFILE &
    
      ;;
      stop)
    	pid=$(cat $PIDFILE)
    	kill -9 ${pid}  
    	log_daemon_msg "Stopping tpl"
    	log_end_msg 0
      ;;
      restart|force-reload)
    	$0 stop
    	sleep 1
    	$0 start
      ;;
      status)
    	status_of_proc "$DAEMON" "$DESC" && exit 0 || exit $?
      ;;
      *)
    	N=/etc/init.d/tpl
    	echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
    	exit 1
    	;;
    esac
    
    exit 0
    
    # vim:noet
    

      

     

    sudo update-rc.d   sss defaults  

  • 相关阅读:
    TypeError: Cannot destructure property `compile` of 'undefined' or 'null'
    关于Django多变关联查询的orm操作
    面试概念题
    飞机大战项目开发
    scrapy爬取的数据异步存储至MySQL
    卷积神经网络数据识别
    深度学习之TensorFlow
    随机森林的使用
    kaggle平台的配置与使用
    机器学习
  • 原文地址:https://www.cnblogs.com/ahuo/p/10913079.html
Copyright © 2020-2023  润新知