systemctl enable rc-local.service error
/*******************************************************************************
* systemctl enable rc-local.service error
* 说明:
* 在YOCTO中使能rc.local发现无法enable;
*
* 2019-6-10 深圳 宝安西乡 曾剑锋
******************************************************************************/ 一、Error
root@zengjf:/etc/systemd/system# systemctl enable rc-local.service
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
) In case of template units, the unit is meant to be enabled with some
instance name specified. 二、错误原因
. 无Install字段;
. 添加Install字段:
root@zengjf:/lib/systemd/system# cat rc-local.service
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version. # This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
Documentation=man:systemd-rc-local-generator()
ConditionFileIsExecutable=/etc/rc.local
After=network.target [Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=
RemainAfterExit=yes
GuessMainPID=no [Install]
WantedBy=multi-user.target
. 重新enable:
root@zengjf:/etc/systemd/system# systemctl enable rc-local.service
Created symlink /etc/systemd/system/multi-user.target.wants/rc-local.service → /lib/systemd/system/rc-local.service.
. 查看生成文件:
root@zengjf:/etc/systemd/system/multi-user.target.wants# ls -al rc-local.service
lrwxrwxrwx root root Apr : rc-local.service -> /lib/systemd/system/rc-local.service
root@zengjf:/etc/systemd/system/multi-user.target.wants#
. 创建/etc/rc.local,并赋予执行权限;
root@zengjf:~# cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
# echo "-------------------------------" >> /etc/zengjf
echo rc.local >> /etc/zengjf
echo "-------------------------------" >> /etc/zengjf exit
. 重启查看输出;
root@zengjf:~# cat /etc/zengjf
-------------------------------
rc.local
-------------------------------
systemctl enable rc-local.service error的更多相关文章
- 曹工改bug:centos下,mongodb开机不能自启动,systemctl、rc.local都试了,还是不行,要不要放弃?
问题背景 最近装个centos 7.6的环境,其中,基础环境包括,redis.nginx.mongodb.fastdfs.mysql等,其中,自启动使用的是systemctl,其他几个组件,都没啥问题 ...
- Ubuntu 18.04 设置开机启动脚本 rc.local systemd
ubuntu18.04不再使用initd管理系统,改用systemd. ubuntu-18.04不能像ubuntu14一样通过编辑rc.local来设置开机启动脚本,通过下列简单设置后,可以使rc.l ...
- debian9 开启rc.local服务
由于某些软件并没有增加开启启动的服务,很多时候需要手工添加,一般我们都是推荐添加命令到 /etc/rc.local 文件,但是 Debian 9 默认不带 /etc/rc.local 文件,而 rc. ...
- Debian 9.x "stretch" 解决 /etc/rc.local 开机启动问题
由于某些软件并没有增加开启启动的服务,很多时候需要手工添加,一般我们都是推荐添加命令到 /etc/rc.local 文件,但是 Debian 9 默认不带 /etc/rc.local 文件,而 rc. ...
- rc.local(ubuntu18.04)
系统自带服务/lib/systemd/system/rc-local.service 软连接为 /lib/systemd/system/rc.local.service -> rc-local. ...
- Arch下systemd无法开机执行rc.local之解决方法
早就发现了,Arch的systemd提供的那个 rc-local.service 貌似有问题,rc.local不会执行.因为没用rc.local,一直没管. 解决方法源自这里,需要稍加改动: http ...
- 没有rc.local的解决办法
转载请注明来源https://www.cnblogs.com/sogeisetsu/p/11395098.html linux 开机自启动 我是小白,最近在想如何使用linux开机自启动,有一个办法是 ...
- centos7 /etc/rc.local需要chmod +x /etc/rc.d/rc.local
Centos 7.0设置/etc/rc.local无效问题解决 安装centos7以后按照以往习惯修改rc.local添加开机启动命令,但重启后发现无效,再次重启发现依然如故 检查系统rc.local ...
- Centos 7.0设置/etc/rc.local无效问题解决
安装centos7以后按照以往习惯修改rc.local添加开机启动命令,但重启后发现无效,再次重启发现依然如故 检查系统rc.local服务运行情况 systemctl | grep "rc ...
随机推荐
- 在Node.js中使用ejsexcel输出EXCEL文件
1.背景 在Nodejs应用程序中输出Excel,第一印象想到的一般是node-xlsx,这类插件不仅需要我们通过JS写入数据,还需要通过JS进行EXCEL显示样式的管理. 这是个大问题,不仅代码冗余 ...
- Easy2game使用
每个独享IP服务器,开设3-5个高速接口IP,用户可自行选择当地连接速度快的接口接入服务器,服务器再为用户自动分配所绑定的独享IP连接至游戏服务器,可保证连接的稳定性,统一性 打开软件 添加程序 服务 ...
- react的事件处理为什么要bind this 改变this的指向?
react的事件处理会丢失this,所以需要绑定,为什么会丢失this? 首先来看摘自官方的一句话: You have to be careful about the meaning of this ...
- Protobuf协议应用干货
Protobuf应用广泛,尤其作为网络通讯协议最为普遍.本文将详细描述几个让人眼前一亮的protobuf协议设计,对准备应用或已经应用protobuf的开发者会有所启发,甚至可以直接拿过去用. 这里描 ...
- Jmeter CSV参数带汉字处理
问题1:请求参数中有汉字,在windows上调测压测没有问题,直接把参数文件上传到linux 服务器上进行分布式压测时发现参数取出后为乱码,linux上后台查看文件也是乱码 处理方法: 初步想到是因为 ...
- anaconda更新tensorflow
在anaconda prompt中,输入: pip install --upgrade --ignore-installed tensorflow gpu版本输入: pip install --upg ...
- git设置本地账户
问题描述: git很方便,git本地如果记住账户信息 问题解决: vscode Git 全局设置: git config --global user.name "mvpbang" ...
- 【Spring Boot】Spring Boot之利用Logstash将日志转换成以JSON的格式存储和输出
一.Logstash的作用 Logstash是一个完全开源的工具,它可以对日志进行收集.过滤,能非常方便地将日志转换成以JSON的格式存储和输出,并将其存储供以后使用. 二.整合Logstash的步骤 ...
- VUE 动态菜单管理
业务场景 不同的用户登录,看到的菜单会不一样,因此需要根据不同人登录的身份去后端获取菜单. 实现思路 1.构建路由 2.从后端构建菜单 3.前端获取菜单 4.前端渲染菜单 1.构建路由. export ...
- mysql显示一张表的索引
show index from tm_show.fulfillment_order;show index from tm_show.express_verify;show index from tra ...