FEDORA20 Add boot program and add sudo user

Source: Internet
Author: User
Tags chmod

1./etc/rc.local is actually a soft connection of/etc/rc.d/rc.local, then:


# cat/etc/rc.d/rc.local
#! /bin/sh

/usr/bin/offlineimap &
/usr/bin/echo "ABDC" >/root/test-lili &

--------
chmod +x/etc/rc.d/rc.local ln-s/etc/rc.d/rc.local/etc/rc.local 2. Restart the machine to see if there is more than one file/root under Test-lili, and Offlineimap is already running, This means that our boot script is already running.

***

Note:

When writing a/etc/rc.d/rc.local file,

Commands are best used with full path names and can be written in the background, which speeds up the boot speed.

--------------------------------------------

Add sudo user

# echo "Lijun all= (All) all" >>/etc/sudoers.d/lijun

------------------

REF:

http://blog.csdn.net/lingfong_cool/article/details/8861020

=============================================================

Method Two:

CD/ETC/INIT.D
VI youshell.sh   #将youshell. SH modified to your own foot name

Write your own script and save the exit. When writing a script, please add the following comments first

#add for Chkconfig
#chkconfig: 2345
#description: The description of the shell   #关于脚本的简短描述
# Processname:servicename                    #第一个进程名, the rear settings will be used when the boot

Description
2345 refers to the running level of the script, that is, in 2345 of the 4 modes can be run, 234 are text interface, 5 is the graphical interface x
70 refers to the future startup sequence number of the script, if the start sequence number of other programs is smaller than 70 (such as 44, 45), the script needs to wait until these programs are started before starting.
30 refers to the stop order number of the script when the system shuts down.

----

e.g:

Cat youshell.sh

#! /bin/sh
#add for chkconfig
#chkconfig: 2345
#description: The description of the Shell
# Processname:servicename_li
/usr/bin/offlineimap &

----


Add executable permissions to the script:

chmod +x youshell.sh

Chkconfig--level 2345 youshell.sh on
-----------
Ok! success!

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.