zoukankan      html  css  js  c++  java
  • 树莓派开机启动

    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  

  • 相关阅读:
    Java的值传递机制
    面向对象
    java中static关键字的作用
    方法的重载和重写
    this和super的用法
    Java中关于return的理解
    java经典的内存图 (数据结构)
    java IO最让初学者误解的取名方式
    UDP 与 TCP简单入门理解示例
    Shiro简单入门
  • 原文地址:https://www.cnblogs.com/ahuo/p/10913079.html
Copyright © 2011-2022 走看看