Changes to Linux issues-centos7 and previous versions

Source: Internet
Author: User
Tags message queue

1, SYSTEMD Service management procedures:
Systemctl is the primary tool that integrates the functionality of the previous service and Chkconfig. You can use it to enable/disable the service either permanently or only in the current session.
Systemctl can list the status of the service that is running, as follows:

UNIT LOAD ACTIVE SUB descriptionproc-Sys...t_misc.automount loaded active waiting arbitrary executable File Fosys-devi...block-Sr0.device loaded active plugged Vmware_virtual_ide_cdrom_drisys-devi...block-Sr1.device loaded active plugged Vmware_virtual_ide_cdrom_drisys-devi...-sda-Sda1.device loaded active plugged Vmware_virtual_ssys-devi...-sda-Sda2.device loaded active plugged Vmware_virtual_ssys-devi...-sda-Sda3.device loaded active plugged Vmware_virtual_ssys-devi...block-Sda.device loaded active plugged Vmware_virtual_ssys-devi...o16777736.device Loaded Active plugged pro/1000MT single Port Adapsys-devi...und-card0.device loaded Active plugged AudioPCI 64v/128/Creative SYS-devi...block-fd0.device Loaded Active plugged/sys/devices/platform/Floppysys-devi...tty-ttys1.device Loaded Active plugged/sys/devices/platform/Serialsys-devi...tty-ttys2.device Loaded Active plugged/sys/devices/platform/Serialsys-devi...tty-ttys3.device Loaded Active plugged/sys/devices/platform/Serialsys-devi...tty-ttys0.device Loaded Active plugged/sys/devices/pnp0/00:08/tty/SYS-module-configfs.device Loaded Active plugged/sys/module/Configfssys-module-fuse.device Loaded Active plugged/sys/module/Fusesys-subs ... O16777736.device Loaded Active plugged pro/1000MT single Port Adap-.mount loaded Active mounted/Boot.mount loaded Active mounted/Bootdev-Hugepages.mount loaded active mounted Huge Pages File Systemdev-Mqueue.mount loaded active mounted POSIX Message Queue File sysrun-user-1000-gvfs.mount Loaded Active Mounted/run/user/1000/Gvfs ... LOAD=reflects whether the unit definition was properly loaded. ACTIVE= The high-Level Unit activation state, i.e. generalization of SUB. SUB= The low-Level Unit activation state, values depend on unit type.133 loaded units listed. Pass--All to see loaded but inactive units, too. To show all installed unit files use ' Systemctl list-unit-files '.

SYSTEMD-CGLS lists the running processes in a tree, which can recursively display control group content. As follows:

[[email protected] CONF.D]#Systemd-cgls├─1/usr/lib/systemd/systemd--system--deserialize 23├─user.slice│└─user-1000. Slice│└─session-1. scope│├─12192 Gdm-session-worker [pam/gdm-password]│├─12203/usr/bin/gnome-keyring-daemon--daemonize--login│├─12205 gnome-session--session gnome-classic│├─12213 Dbus-launch--sh-syntax--exit-with-session│├─12214/bin/dbus-daemon--fork--print-pid 4--print-address 6--session│├─12279/usr/libexec/gvfsd│├─12320/usr/libexec//gvfsd-fuse/run/user/1000/gvfs- F-o big_writes│├─12357/usr/bin/ssh-agent/bin/sh-c exec-l/bin/bash-c "env gnome_shel│├─12373/usr/libexec/at-spi-bus-launcher│ ├─12377/bin/dbus-daemon--config-file=/etc/at-spi2/accessibility.conf--n│├─12381/usr/libexec/at-spi2-registryd- -use-gnome-session│├─12393/usr/libexec/gnome-settings-daemon│├─12400/usr/bin/pulseaudio--start│├─12458/ Usr/libexec/gvfs-udisks2-volume-monitor│├─12471/usr/libexec/gvfs-mtp-volume-monitor│├─12476/usr/libexec/gvfs-a Fc-volume-monitor│├─12482/usr/libexec/gvfs-goa-volume-monitor│├─12485/usr/libexec/goa-daemon│├─12492/usr  /libexec/goa-identity-service ...   ├─chronyd.service│└─813/usr/sbin/chronyd-u Chrony├─libstoragemgmt.service│└─795/usr/bin/lsmd-d├─dbus.service │├─833/bin/dbus-daemon--system--address=systemd:--nofork--nopidfile--│└─84571/usr/libexec/packagekitd└─fi Rewalld.service└─793/usr/bin/python-es/usr/sbin/firewalld--nofork--nopid

2. How to start/Turn off, enable/disable the service?
Start a service:systemctl start postfix.service
To close a service:systemctl stop postfix.service
To restart a service:systemctl restart postfix.service
Displays the status of a service:systemctl status postfix.service
Enable a service at boot time:systemctl enable postfix.service
Disable a service at boot time:systemctl disable postfix.service
To see if the service is booting up:systemctl is-enabled postfix.service;echo $?
To view a list of services that have been started:systemctl list-unit-files|grep enabled

Description: The Enable service is in the current "runlevel" configuration file directory/etc/systemd/system/multi-user.target.wants/, establish/usr/lib/systemd/ A soft link within the system that corresponds to the service profile; Disabling the service is removing the soft link. As follows:

  │├─  833/bin/dbus-daemon--system--address=systemd:--nofork--nopidfile--  │└─84571/usr/libexec/< C4>PACKAGEKITD  └─firewalld.service    └─793/usr/bin/python-es/usr/sbin/firewalld--nofork--nopid[ Root@localhost conf.d]#  systemctl disable Postfix.servicerm '/etc/systemd/system/ Multi-user.target.wants/postfix.service '

Viewed the files in/usr/lib/systemd/system, the syntax is completely different from the system service scripts in the old version of/etc/init.d/.

Second, modify the system operating level:

1. SYSTEMD uses a more free target replacement than the Sysvinit run level. The 3rd run level is replaced with Multi-user.target. The 5th run level is replaced with Graphical.target. Runlevel3.target and Runlevel5.target are symbolic links that point to Multi-user.target and Graphical.target, respectively.
You can use the following command to switch to run Level 3:
systemctl isolate multi-user.target或systemctl isolate runlevel3.target
You can use the following command to switch to run Level 5:
systemctl isolate graphical.target或systemctl isolate runlevel5.target

2. How do I change the default runlevel?
SYSTEMD uses links to point to the default runlevel. Before creating a new link, you can delete the existing link by following the command: Rm/etc/systemd/system/default.target
Default startup Run Level 3:
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
Default startup Run Level 5:
ln -sf /lib/systemd/system/graphical.target/etc/systemd/system/default.target
SYSTEMD does not use/etc/inittab files.

3. How do I check the current runlevel?
The old RunLevel command can still be used under SYSTEMD. You can continue to use it, although SYSTEMD replaces the previous system's runlevel with the ' target ' concept (multiple ' target ' can be activated simultaneously).
The equivalent SYSTEMD command is Systemctl list-units–type=target

Third, other configuration tools:

1, Setup and NTSYSV tools are still retained, but the function has been greatly weakened, previously NTSYSV tools can control all system services from the start, now only control a small portion of the service.
2,/etc/resolv.conf This DNS configuration file has not changed.
3,/etc/sysconfig/network-scripts/ifcfg-ens192 NIC configuration file name and some options have changed.
4, the guidance mode to use GRUB2 guidance, GRUB2 has the following features: 1, modular design, 2, support multi-system hardware architecture, 3, support international multi-language, 4, independent memory management, 5, Support scripting language.

Attached: systemd Introduction
SYSTEMD is an init software under Linux that was developed by Lennart Poettering and released under LGPL 2.1 and its subsequent release license. Its development goal is to provide a better framework to represent the dependencies between system services, and to implement the parallel startup of the service when the system is initialized, and to reduce the overhead of the shell, and eventually replace the System V and BSD-style init programs commonly used today.
Compared to the System V style init used in most distributions, SYSTEMD uses the following new technologies:
Using socket-activated and bus-activated services to improve the performance of parallel operation of each dependent service;
Use cgroups instead of PID to track the process so that the daemons generated even after two fork are not out of systemd control.
From the design concept, because SYSTEMD uses components such as cgroup and fanotify to achieve its characteristics, it is only applicable to Linux.

For a more detailed description of Systemd, please refer to: HTTP://EN.WIKIPEDIA.ORG/WIKI/SYSTEMD

October 16, 2015 21:29:10

Changes to Linux issues-centos7 and previous versions

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.