archlinux 的一些自动加载项

来源:互联网 发布:淘宝店铺标志怎么删除 编辑:程序博客网 时间:2024/04/28 06:30

参考 http://wiki.archlinux.org

 

一、开机自动加载

1、udev

这个我基本不用。

详细请点击

 

2、fstab

文件/etc/fstab包含了静态文件系统信息,定义了存储设备和分区整合到整个系统的方式。开机启动时mount 命令会读取这个文件,确定设备和分区的挂载选项。

fstab文件的每一行内容的格式为:

<file system> <dir> <type> <options> <dump> <pass>

例如

# <file system>        <dir>         <type>    <options>             <dump> <pass>/dev/sda1              /             ext4      defaults,noatime      0      1

意思是挂载硬盘分区  /dev/sda1  到   /  目录下,/dev/sda1 分区的文件系统为 ext4。

详细请点击

 

3、systemd

目前archlinux已经用systemd替代了initscripts,尽管还可以模拟一些initscripts,但是今后archlinux将逐渐不再支持initscripts。

①原生的systemd配置文件,诸如/etc/hostname ,/etc/locale.conf,/etc/localtime等等

②systemctl,例如 systemctl  enable xxxx,systemctl  start xxxx等等

详细请点击

 

二、登录自动加载

1、shell登录

archlinux的默认shell是bash。shell登录后,会加载 ~/.bash_profile文件(当然还有其他自动加载的文件)。例如

#~/.bash_profiledhcpcd -b

上面代码是当用户shell登录时会自动运行dhcpcd请求ip地址

既然shell登录会自动加载一些文件,那么shell登出也会加载文件,详细请点击

2、X登录

使用显示管理器登录后启动加载的文件与具体的桌面有关,以lxde为例,运行lxde后会自动加载 /etc/xdg/lxsession/LXDE/autostart。例如

#/etc/xdg/lxsession/LXDE/autostart    注意大小写@fcitx

lxde自启动详细请点击

使用startx运行桌面环境时,一般情况下会自动加载 ~/.xinitrc 文件(具体路径可以参考startx脚本)

原创粉丝点击