Arch Linux operating system setup boot boot configuration

Source: Internet
Author: User
Tags chmod arch linux egrep


By the way, the rc.local in CentOS 7 is still available, and the reason for the inability to use it is because there is no X permission in/etc/rc.d/rc.local, you can add one execution permission.

Since the CentOS can be used, which arch Linux is actually also available. The data in the direct Copycentos can be.

[Root@arch ~]# egrep-v "#"/usr/lib/systemd/system/rc-local.service
[Unit]
description=/etc/rc.local compatibility
Conditionfileisexecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
Execstart=/etc/rc.local start
Timeoutsec=0
Remainafterexit=yes
sysvstartpriority=99
[Install]
Wantedby=multi-user.target
[Root@arch ~]# touch/etc/rc.local
[Root@arch ~]# chmod +x/etc/rc.local
[Root@arch ~]# Systemctl Enable Rc-local.service
Created symlink From/etc/systemd/system/multi-user.target.wants/rc-local.service to/usr/lib/systemd/system/ Rc-local.service.
[Root@arch ~]# cat/etc/rc.local
ULIMIT-HSN 30961 && Echo ' right ' >>/tmp/right.txt | | echo ' wrong ' >>/tmp/wrong.txt
printf $ (ulimit-n) >>/tmp/ulimit1.txt 2>&1
ULIMIT-HSN 3096
printf $ (ulimit-n) >>/tmp/ulimit.txt 2>&1

Test:

[Root@arch ~]# Ls-al/usr/lib/systemd/system/rc-local.service
-rw-r--r--1 root root 675 Apr 5 23:24//usr/lib/systemd/system/rc-local.service
[Root@arch ~]# chmod +x/usr/lib/systemd/system/rc-local.service
[Root@arch ~]# Ls-al/usr/lib/systemd/system/rc-local.service
-rwxr-xr-x 1 root root 675 Apr 5 23:24//usr/lib/systemd/system/rc-local.service
[Root@arch ~]# systemctl start Rc-local.service
Job for Rc-local.service failed. "Systemctl status Rc-local.service" and "Journalctl-xe" for details.
[Root@arch ~]# systemctl status Rc-local.service
Rc-local.service-/etc/rc.local Compatibility
Loaded:loaded (/usr/lib/systemd/system/rc-local.service; enabled; vendor preset:disabled)
Active:failed (Result:exit-code) since Sun 2015-04-05 23:30:27 UTC; 9s ago
process:246 execstart=/etc/rc.local Start (code=exited, status=203/exec)
APR 23:30:27 Arch systemd[1]: Rc-local.service:control process exited, code=exited status=203
APR 23:30:27 Arch systemd[1]: Failed to start/etc/rc.local compatibility.
APR 23:30:27 Arch systemd[1]: unit Rc-local.service entered failed state.
APR 23:30:27 Arch systemd[1]: Rc-local.service failed.
[Root@arch ~]# Ls-al/usr/lib/systemd/system/sshd.service #排除权限原因
-rw-r--r--1 root root 410 Mar 04:52/usr/lib/systemd/system/sshd.service
[Root@arch ~]# Journalctl-xe
APR 23:29:34 Arch systemd[1]: Configuration file/usr/lib/systemd/system/rc-local.service is marked executable. Please remove exec
APR 23:29:38 Arch systemd[1]: Rc-local.service:control process exited, code=exited status=203
--Subject:unit Rc-local.service has failed
--Unit Rc-local.service has failed.
APR 23:29:38 Arch systemd[1]: unit Rc-local.service entered failed state.
APR 23:29:38 Arch systemd[1]: Rc-local.service failed.
[Root@arch ~]# systemctl start Rc-local.service
Warning:unit file of Rc-local.service changed on disk, ' Systemctl daemon-reload ' recommended.
Job for Rc-local.service failed. "Systemctl status Rc-local.service" and "Journalctl-xe" for details.
[Root@arch ~]# Systemctl | grep Rc-loca
Rc-local.service Loaded Active exited/etc/rc.local Compatibility
[Root@arch ~]# cat/etc/rc.local
#!/bin/sh
[Root@arch ~]# egrep-v "#"/etc/systemd/system/multi-user.target.wants/rc-local.service
[Unit]
description=/etc/rc.local compatibility
Conditionfileisexecutable=/etc/rc.local
After=network.target

[Service]
Type=forking
Execstart=/etc/rc.local start
Timeoutsec=0
Standardoutput=tty
Remainafterexit=yes
sysvstartpriority=99
[Install]
Wantedby=multi-user.target

Rc.loca's inability to start in arch is due to the fact that I did not set #!/bin/sh!!! in Rc.loca

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.