首页 > 其他分享 >/etc/profile, rc.local等文件的执行顺序

/etc/profile, rc.local等文件的执行顺序

时间:2023-04-21 18:35:52浏览次数:33  
标签:profile 脚本 etc rc 自启动 local

1、各初始化文件执行流程
以下是/etc/rc.local 与 /etc/profile .bash_profile .bashrc 等文件的执行顺序。

1)通过/boot/vm进行启动 vmlinuz

2)init /etc/inittab

3)启动相应的脚本,并且打开终端

rc.sysinit
rc.d(里面的脚本)
rc.local
4)启动login登录界面 login

5)在用户登录的时候执行sh脚本的顺序,每次登录的时候都会完全执行的

/etc/profile.d/file
/etc/profile
/etc/bashrc
/root/.bashrc
/root/.bash_profile
2、应用案例
一般建议将环境变量(需要export)放置于/etc/profile里,当需要实现开机自启动脚本时,可以在/etc/rc.local文件中加载该开机自启动脚本。

注:实现自启动脚本时可能需要先让环境变量生效,建议添加如下命令:

. /etc/profile
## 上述命令等价于source /etc/profile,但是该source命令在ubuntu系统中不可用,因为其默认是dash执行,dash不认识source命令,因此建议用"."代替
 

标签:profile,脚本,etc,rc,自启动,local
From: https://www.cnblogs.com/lidabo/p/17341375.html

相关文章

  • Unity Resources.Load
    图片路径必须是Assets\Resources目录下面的,并且不能带扩展名//E:\Assets\Resources\img\abc.jpgstringfilePath="img/abc";vartexture=Resources.Load<Texture2D>(filePath);GameObjectobj=newGameObject("newname",typeof(SpriteRenderer));Spr......
  • 蓝牙Sig Mesh 概念入门③——分层结构Layered architecture
    文章目录一、Modellayer二、FoundationModellayer三、Accesslayer四、Transportlayer五、Networklayer六、Bearerlayer一、Modellayermodel定义了一个节点支持的功能特性,每一个model都定义了自己的opcode和status。比如genericonoffmodel,定义了GenericON/OFF/G......
  • 【总结】浅刷leetcode,对于位运算提高性能的一些总结
    目录什么是位运算?位运算技巧1.判断奇偶性2.交换两个数3.判断一个数是否是2的幂次方4.取绝对值5.计算平均数结论位运算技巧是计算机科学中非常重要的一部分,它可以用来解决很多实际问题。在本篇博客中,我们将介绍一些常见的位运算技巧,以及它们在实际应用中的使用。什......
  • _sys_exit和_ttywrch,explicit type is missing (“int“ assumed)
    报错..\SYSTEM\usart\usart.c(64):error:#260-D:explicittypeismissing("int"assumed)_sys_exit(intx)..\SYSTEM\usart\usart.c(69):error:#260-D:explicittypeismissing("int"assumed)_ttywrch(intch)原本_sys_exit(intx......
  • 下载服务器resources文件
    @GetMapping("download")@ApiOperation(value="下载标准库板块excel")publicvoiddownload(HttpServletRequestrequest,HttpServletResponseresponse){OutputStreamos=null;InputStreaminputStream=null;B......
  • DVWA Brute Force爆破
    1、介绍该功能演示的是账号密码场景,对密码的爆破,对账号是已知的。本章仅进行简单记录,相关技术在其他文章整理。比如burp使用,php代码,python脚本。2、简单型没有做任何处理,可以爆破掉,但实际也可以sql注入。(burp爆破由中等演示,sql注入在sql注入模块演示)3、中等做了sql注入预防,b......
  • Parcel E Class not found when unmarshalling 问题
    aidl传递bundle参数,bundle中又包含Parcel类,在调用bundle.getParcelable(key)时会有如下log报错,此时需要在调用bundle获取Parcel类的前调用bundle.setClassLoader(类对象.class.getClassLoader());================2023-04-2111:05:18.2023597-3597Parcel......
  • 在idea中查看源码时 download source failed的处理办法
    检查ideamaven配置切换路径BuildTools->Maven->Importing勾选前两个执行maven命令:mvndependency:resolve-Dclassifier=sources执行完后,再次打开源码类就能看到源码了。......
  • leetcode_打卡10
    leetcode_打卡10题目:283.移动零思路:双指针,数值互相交换,不是复制覆盖代码:classSolution{publicvoidmoveZeroes(int[]nums){intn=nums.length;intl=0,r=0;while(r<n){if(nums[r]!=0){swap(nums,l,r);......
  • leetcode_打卡09
    leetcode_打卡09题目:443.压缩字符串思路:双指针代码:classSolution{publicintcompress(char[]chars){intn=chars.length;intwrite=0,left=0;for(intread=0;read<n;read++){if(read==n-1||chars[r......