Linux shutdown
Shutdown Command shutdown
such as Shutdown-h now is the command to shut down immediately, but Linux sometimes does not turn off when running such a command on a terminal
Shutdown command:
1, halt immediately shut down the machine
2, Poweroff immediately shut down the machine
3, Shutdown-h now shut down immediately (root user use)
4, shutdown-h 10 10 minutes after automatic shutdown
If you are setting the shutdown via the shutdown command, you can cancel the reboot with the SHUTDOWN-C command
Shutdown parameter Description:
Turn off the computer, send a signal to the root process init, change runlevel to 0 (halt)
-H Power off
-R reboot
-N Force shutdown, do not send signal to INIT process
-K analog shutdown, send a shutdown warning to the logged-on player
-T < sec > N-second shutdown EG:-T 60//60 seconds later shutdown
Time < timing > Timing shutdown
-C [Explanatory information] canceling shutdown
Ignore detection file system when-F reboot
Force detect file system when-F reboot
Halt----The simplest shutdown command
In fact, halt is called shutdown-h. Halt execution? Kill the application process? Perform the sync system call?
The kernel is stopped when the file system write operation is complete.
Parameter description:
[-n] to prevent sync system calls? It is used after patching the root partition with fsck to prevent the kernel from using the old version of the super
Block (superblock) overwrite the patched super block.
[-W] is not a real reboot or shutdown? Just write Wtmp(/var/log/wtmp) records.
[-d] does not write Wtmp records (already included in options [-n]).
[-f] forced shutdown or reboot without invoking shutdown.
[i] turn off all network interfaces before shutting down (or rebooting).
[-p] This option is the default option. is to call Poweroff when shutdown.
Note: The Linux shutdown command is not valid and returns a hint: command not found.
This is because the normal user does not have permission to shutdown and must call the administrator user. And while you're using root, you still can't use shutdown.
Shutdown command, you must use the SU command in the shell to invoke the root user and execute the command.
Linux reboot
Reboot command: There are a number of types including
The code is as follows |
Copy Code |
1, shutdown 2, Poweroff 3. Init 4, reboot 5, halt 1, reboot |
Reboot's work process is almost the same as Halt's? But does it trigger a host reboot? And halt is shutdown. Its parameters are not much different from the halt
2. shutdown-r now reboot (root user)
3, Shutdown-r 10 over 10 minutes automatic restart (root user use)
4, Shutdown-r 20:35 reboot at 20:35 time (root user)
If you set the reboot through the shutdown command, you can cancel the reboot with the SHUTDOWN-C command
Linux under the Restart Network Service command with the NIC, the following command
The command to restart the Network service is the service network restart
or/etc/init.d/network restart.
Changing IP under Linux does not actually change if the network service is not restarted
Restart Apache
The code is as follows |
Copy Code |
[Root@test bin]# httpd restart -bash:httpd:command not found Obviously bash can't find httpd in the directory under path, try to find it, and then use the absolute path. For example, we are here /home/service/apache/bin/httpd-k restart |
Restart Oracle databases and listeners under Linux:
Method 1:
Log on to Linux with root, open the terminal and enter the following command:
The code is as follows |
Copy Code |
CD $ORACLE _home #进入到oracle的安装目录 Dbstart #重启服务器 Lsnrctl Start #重启监听器 CD $ORACLE _home #进入到oracle的安装目录 Dbstart #重启服务器 Lsnrctl Start #重启监听器 |
-----------------------------------
Method 2:
SQL code
code is as follows |
copy code |
CD $ORACLE _ home/bin #进入到oracle的安装目录 ./dbstart #重启服务器 ./lsnrctl start #重启监听器 |