PS netstat pid to save service status

Source: Internet
Author: User

To move some servers to a different cabinet and not know which services to restart after rebooting, you can save the service status and path and execute commands in the following ways 1, psps f -eo pid,tty,stat,time,command  > ${hostname}_$ (date +%y%m%d) _PS2, netstatnetstat -tupnl > ${hostname}_$ (date  +%y%m%d) _NETSTAT3, cmdlinecat /proc/2644/cmdline/usr/bin/redis-server /etc/redis/redis.conf/ proc/$pid/cwd4, cwdll /proc/2644/cwdlrwxrwxrwx 1 redis redis 0 2015-05-12  14:05 /proc/2644/cwd -> /var/lib/redis/proc/pid/Directory and file description (section) 1, cmdline the command executed when the process was started ( Contains run-time parameter information)  2, cmd links to the current working directory of the process  3, the Environ process executes the environment variable 4, the FD contains the process-related file descriptor 5, limits the file stores the process soft limit, hard limit and other information.  6, maps and process-related memory mapping information address                    perms offset   dev   inode    pathname7fc234be2000-7fc234bee000 r-xp  00000000 08:01 1198370 /lib/libnss _FILES-2.11.3.SO1) Address: Process occupancy's address space. 2) perms: Permission set r = readw = writex = executes = sharedp = private   (copy on write) 3) Offset: file offset. 4) Dev: for Device (Major:minor) 5) Inode: Inode on device. 0 is an inter-memory area that has no inode associated, typically: BSS (uninitialized data)  7, exe links to the basic state of the execution command file 8, status (STAT STATM) process of the process

This article is from the "7928217" blog, please be sure to keep this source http://7938217.blog.51cto.com/7928217/1650601

PS netstat pid to save service status

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.