In this post, we’ll see the Linux process system management of Linux, Linux boot up system, enable/disable/status of a service.
Linux process system discussion
Lets 1st login as root user.
[ece@localhost Desktop]$ su –Password:
Last login: Sun May 8 22:59:38 EDT 2016 on pts/0
[root@localhost ~]# ps [root@localhost ~]# ps –au ; to see the pid, mem, cpu, process, cmd, tty [root@localhost ~]# ps -u root ; List of process for specific user. [root@localhost ~]# ps –ef [root@localhost ~]# pidof systemd
1
[root@localhost ~]# firefox ; Open firefox [root@localhost ~]# jobs
Suppose that, you are going to execute a command, then you are showing a message, that is, “another process is running”. And the process id is shown. So to continue your work, you need to stop the process through this command.
[root@localhost ~]# kill 3670 ; kill <process id>
Sometimes, there is needed to force kill the process id. Then you need to write “kill -9 <process id>”
[root@localhost ~]# kill -9 3670
==> CMD (tty)
BIOS/UEFI => MBR/GPT => GRUB2 => Kernel => systemd => Target =>
==> GUI (pts)
systemd:
One of the major changes in RHEL/CentOS 7.0 is the swtich to systemd, Which a system and service manager, that replaces SysV and Upstart, which was used in previous releases of Red Hat Enterprise Linux. The systemd is compatible with SysV and also with Linux Standard Base init scripts.
=> Fedora 17/RHEL/CentOS6 = SystemV/init
=> Ubuntu/SUSE/Debian = upstart
=> Fedora 18+/RHEL/CentOS7/Ubuntu-15 = systemd
Change Default Boot Time:
[root@serverX ~]# vim /boot/grub2/grub.cfg:set nu
63 set timeout=40
[root@serverX ~]# reboot
Grub Entry Customize:
[root@serverX ~]# vim /boot/grub2/grub.cfg
In OLD system:
76 menuentry ‘CentOS Linux, with Linux 3.10.0-123.el7.x86_64’
91 menuentry ‘CentOS Linux, with Linux 0-rescue-fdbe8dca6eb044b6895149fc28e4a871’
In new system:
76 menuentry ‘Linux Server’
91 menuentry ‘CentOS Recovery mode’
[root@serverX ~]# reboot
[root@serverX ~]# vim /etc/motd
[root@serverX ~]# logout ;logout
Working with Linux Kernel:
[root@serverX ~]# uname -r [root@serverX ~]# yum list installed kernel-* [root@serverX ~]# yum update kernel -y [root@serverX ~]# yum list installed kernel-*
RHEL6 or Older Version:
[root@serverX ~]# ls /etc/init.d/
RHEL7 or more new version:
[root@serverX ~]# ls /lib/systemd/system/*.service[root@serverX ~]# systemctl -t service
Start/Stop/Restart/status Services with systemctl:
[root@desktopX ~]# systemctl start crond.service [root@desktopX ~]# systemctl status crond.service
[root@desktopX ~]# systemctl stop crond.service [root@desktopX ~]# systemctl status crond.service
[root@desktopX ~]# systemctl restart crond.service [root@desktopX ~]# systemctl reload XXXX.service
Enable / Disable services to run at boot time:
[root@desktopX ~]# systemctl enable crond.service [root@desktopX ~]# systemctl disable crond.service [root@desktopX ~]# systemctl status crond.service
Working with Restart/Poweroff/Hibernate/halt:
[root@desktopX ~]# systemctl halt [root@desktopX ~]# systemctl reboot [root@desktopX ~]# systemctl poweroff [root@desktopX ~]# systemctl hibernate [root@desktopX ~]# systemctl suspend
Working with Runlevels:
[root@desktopX ~]# systemctl get-defaultgraphical.target
[root@desktopX ~]# systemctl set-default multi-user.target [root@desktopX ~]# systemctl get-default
multi-user.target
[root@desktopX ~]# reboot
[root@desktopX ~]# systemctl get-default
multi-user.target
[root@desktopX ~]# systemctl set-default graphical.target
[root@desktopX ~]# reboot
Leave a Reply