zoukankan      html  css  js  c++  java
  • Ubuntu18添加开机启动项

    因为ubuntu18已经没有用rc.local,因为日常用的习惯所以我们下面进行创建

    1.创建rc.local软链接(因为system只会读取/etc/systemd/system下的文件)

    ln -fs /lib/systemd/system/rc-local.service /etc/systemd/system/rc-local.service

    2.修改/lib/systemd/system/rc-local.service文件

    [Install]
    WantedBy=multi-user.target #运行级别
    Alias=rc-local.service

    3.创建rc.local

    touch /etc/rc.local
    chmod 755 /etc/rc.local #添加权限

    4. vi  /etc/rc.local

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
     
    cd /opt/phphome/zdtp
    ./zdtpServer &
    cd /opt/phphome/pm1
    ./pm1Server &
    cd /opt/phphome/beijing
    ./BJServer &
    exit 0
  • 相关阅读:
    Git 之 git原理简介
    Django 之 富文本编辑器-tinymce
    Django 之 Ajax
    Django 之 分页
    Django 之 用redis存储session
    Django 之 自定义中间件
    python 之 多线程、多进程代码
    反转字符串
    青蛙跳台阶
    pandas 之 concat
  • 原文地址:https://www.cnblogs.com/sankye/p/15527446.html
Copyright © 2011-2022 走看看