yum install -y epel-release glibc.i686 libtools vim clang git autoconf automake w3m glibc screen

the most import sentence I learned in meeting compiling prerequisites:

yum whatprovides */libcap* | grep dev

in *nix systems, the concept of runlevel is always met, and some softwares needs to do some changes in the relative folders.. /etc/rc3.d/..

here are some quotes from askubuntu..:

<QUOTE>{

To see the current (and previous) runlevel:

runlevel

To switch runlevels:

sudo init $runlevel

For example, to reboot:

sudo init 

The init you are reading about was replaced by upstart starting with Edgy Eft 6.10; and, one of the programs provided by upstart is its own implementation of init. Here are the docs for 10.04.

To change the default runlevel, use your favorite text editor on /etc/init/rc-sysinit.conf...

sudo vim /etc/init/rc-sysinit.conf

Change this line to whichever runlevel you want...

env DEFAULT_RUNLEVEL=

Then, at each boot, upstart will use that runlevel.

}</QUOTE>

and note that the default runlevel of systems is 3 usually..

some init files..

~/.profile /etc/profile ~/.xprofile : things to do when login in graphical mode, /etc/profile is for all users

~/.bash_profile         :things to do when login as personal user in bash/sh/rxvt/urxvt.

~/.bashrc              : things to do when opening new bash/sh/rxvt/urxvt, open ssh, scp, sudo

~/.xinitrc            : things to do when starting x server

~/.i3/config            : things to do when starting i3

----orignal file above-- here are contents updated Sept. 26, 2017----

to start something while startup have several ways, one is to add a service at path /usr/lib/systemd/system/

a service file usually seems like:

[Unit]
Description=...
Documentation=man:..(id) man:..(id)
After=
Wants= [Service]
Type=
PIDFile=
EnvironmentFile
ExecStart=
ExecReload=
KillMode=
Restart=on-failure
RestartSec= [Install]
WantedBy=

to know more about the [Service] part of a service file, see man systemd.service. Other parts contains: man systemd.unit, man systemd.exec, man systemd.kill, man systemd.resource-control

some interesting [Service] settings:

Type, here specifies type of the service. Choices can be one of: simple, forking, oneshot, notify, dbus, idle.

quote from here, types have the following meaning:

  • Type=simple (default): systemd considers the service to be started up immediately. The process must not fork. Do not use this type if other services need to be ordered on this service, unless it is socket activated.
  • Type=forkingsystemd considers the service started up once the process forks and the parent has exited. For classic daemons use this type unless you know that it is not necessary. You should specify PIDFile= as well so systemd can keep track of the main process.
  • Type=oneshot: this is useful for scripts that do a single job and then exit. You may want to set RemainAfterExit=yes as well so that systemd still considers the service as active after the process has exited.
  • Type=notify: identical to Type=simple, but with the stipulation that the daemon will send a signal to systemd when it is ready. The reference implementation for this notification is provided by libsystemd-daemon.so.
  • Type=dbus: the service is considered ready when the specified BusName appears on DBus's system bus.
  • Type=idlesystemd will delay execution of the service binary until all jobs are dispatched. Other than that behavior is very similar to Type=simple.

ExecStart, ExecStop (either one should be specified, or the service file is illegal) is executable is prefixed with '-', then an exit code of command usually is considered as failure is ignored and considered success. If prefixed with '+', then it is executed with full privilege. If file prefixed with '@', then second token be passed as argv[0] to process. All the three prefixes can be used together.

ExecStartPre, ExecStartPost (any of the above commands fails, the service is stopped heresince and considered a failure, and continues with commands specified in ExecStopPost. ExecStop commands will also be skipped. (It is not started)

ExecStop, this command should be one that synchronously stops the process running.

RuntimeMaxSec, WatchdogSec(this should be used together with Type=Notify, NotifyAccess=main/all/.., otherwise it is defaults to 0/forever)

Restart, on-success, on-failure, no, on-abnormal, on-watchdog, on-abort, always.

RestartSec, specifies the seconds that waits before restart the service.

Some [Unit] settings:

Wants, Requires, Requisite, BindsTo: services Requires will be started as well when this service is started(list order is of-no-importance when being started), however, if services Requisite not running while starting this service, the start process will be failed. Wants services will also be started when this service starts, but this service will not be failed immediately when wanted services fails. When BindsTo services stopped, this service will be stopped also.

PartOf: when the specified services being started, this service will also be started, similar to Requires

Before, After, this service is before/after the mentioned services when being started, and also when stops, the inverse ordering is applied

OnFailure, services to be run when fails

ConditionArchitecture, ConditionVirtualization, ConditionHost, ConditionKernelCommandLine, ConditionPathExists, ConditionFileNotEmpty,

Some [Install] settings: the settings here be affecting systemctl enable commands

Alias,

WantedBy, RequiredBy, reverse form of Wants, Requires. But in order to take effect, this service should be enabled by systemctl enable and thus symlinks is created in the wants folder.

some services can be started as multiple instances, these are services end up like "name@.service", when start an instance of such service, use systemctl start name@helloworld1.service, where the helloworld1 part is the name of the instance.. and can be reached inside the service file by using %i. Here are all the escapers listed in man systemd.unit..

Service variables:

$MAINPID, $SERVICE_RESULT, $EXIT_CODE, $EXIT_STATUS

Newly Setting up a CentOS-7 system的更多相关文章

  1. 编写CentOS的System V init启动脚本

    系统本身自带了说明,在/usr/share/doc/initscripts-(*)/sysvinitfiles,内容如下: 所有System V init脚本都命名为/etc/rc.d/init.d/ ...

  2. linux mysql无故无法启动了,centos 7

    转自: http://support.moonpoint.com/software/database/mysql/not-running-centos7.php 下面简单翻译一下. 详细内容可以阅读英 ...

  3. centos 7 上安装 testlink 1.9.15/1.9.16/1.9.17/1.9.18 (mysql/php/httpd)

    1.9.18 的System Requirements - server.注意,适用于 1.9.15 及以后. Server environment should consist of: web-se ...

  4. CentOS 7上更改MySQL数据库存储目录浅析

      个人之前总结过两篇文章"MySQL更改数据库数据存储目录"和"Ubuntu上更改MySQL数据库数据存储目录",都是在工作中遇到相关案例后的一个简单总结.当 ...

  5. 转:CentOS/Debian/Ubuntu一键安装LAMP(Apache/MySQL/PHP)环境

    CentOS/Debian/Ubuntu一键安装LAMP(Apache/MySQL/PHP) 今天遇到一个网友提到需要在Linux VPS服务器中安装LAMP(Apache/MySQL/PHP)网站环 ...

  6. 使用dnsmasq来提升CentOS上网速度

    1. 安装dnsmasq dnsmasq的官方网址是:http://www.thekelleys.org.uk/dnsmasq/doc.html.利用里面的下载链接下载dnsmasq-2.72.tar ...

  7. Install FFMPEG and FFMPEG-PHP in CentOS 6 with Virtualmin

    Install FFMPEG and FFMPEG-PHP in CentOS 6 with Virtualmin  1 year ago -  by Daniel -  howto centos v ...

  8. CentOS 7 install slurm cluster

    //slurm install //CentOS 7 system //192.168.159.141 node01 //192.168.159.142 node02 systemctl stop f ...

  9. CentOS 7 单用户模式+救援模式

    CentOS 7 单用户模式+救援模式 CentOS 7 单用户模式+救援模式.有时候大家可能会忘记自己的root密码,或者错误(命令输入错误,命令位置输入有误等)编辑了一个/etc目录下的核心文件导 ...

随机推荐

  1. 1、SpringMVC+MyBaits实现查询所有

    1.创建如下所示项目 2.在src下的com.entity包下创建 Emp.java package com.entity; /** * * @author Holly老师 * */ public c ...

  2. 【笔记】虚拟机用Xshell登陆报错“ssh服务器拒绝了密码”解决方法

    自己本地安装了VMware Workstation之后,创建虚拟机,一开始是可以用Xshell登陆的,几天后,重启了电脑以及虚拟机,发现无法登陆了,还没有输入密码就有如下报错信息 这时候开始排查原因, ...

  3. Xcode7修改模块生成网络权限(ATS配置)

    直接找    前往->前往文件夹->然后复制下面的路径填入框内,回车就能看到想要替换的文件夹了 /Applications/Xcode.app/Contents/Developer/Pla ...

  4. 万航单位换算器 V1.0 绿色版

    软件名称: 万航单位换算器软件语言: 简体中文授权方式: 免费软件运行环境: Win 32位/64位软件大小: 347KB图片预览: 软件简介:万航单位换算器是一个可以随意转换单位的绿色软件,这个软件 ...

  5. Excel补全日期(日期按顺序补全)

    1.给出的数据 2.想补全缺失的日期,比如2015/3/1,2015/3/2,... 1)在D列输入完整的日期,如下图所示: 2)在E2处写函数“=IF(ISERR(VLOOKUP(D2,B:C,2, ...

  6. insertAdjacentHTML方法详解

    添加HTML内容与文本内容以前用的是innerHTML与innerText方法, 最近发现还有insertAdjacentHTML和 insertAdjacentText方法, 这两个方法更灵活,可以 ...

  7. 浅谈C/C++结构体内存分配问题

    .wiz-todo, .wiz-todo-img {width: 16px; height: 16px; cursor: default; padding: 0 10px 0 2px; vertica ...

  8. MySQL python组件安装

    可使用pip进行安装 pip install MySQL-python 如出现以下错误 _mysql.c::: 错误:my_config.h:没有那个文件或目录 _mysql.c::: 错误:mysq ...

  9. IP子网掩码划分及设置

    IP子网掩码划分及设置 定长子网掩码: 一.子网掩码的计算 TCP/IP网间网技术产生于大型主流机环境中,它能发展到今天的规模是当初的设计者们始料未及的.网间网规模的迅速扩展对IP地址模式的威胁并不是 ...

  10. JTAG上有多个设备时,该如何接呢?

    首先要了解JTAG管脚相关定义,具有JTAG口的芯片都有如下JTAG引脚定义(是相对芯片): TCK——测试时钟输入: TDI——测试数据输入: TDO——测试数据输出: TMS——测试模式选择,TM ...