<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[[实践OK]Linux后台服务启动方式systemd、daemon、nohup大比拼之lsof查看错误输出和日志等。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Sat, 25 Jan 2020 03:26:39 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	#lsof -p 2072&nbsp;&nbsp;#PID<br/>php-fpm 2072 root&nbsp;&nbsp;DEL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0,5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 22380 /dev/zero<br/>php-fpm 2072 root&nbsp;&nbsp;&nbsp;&nbsp;0u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CHR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1,3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0t0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7732 /dev/null<br/>php-fpm 2072 root&nbsp;&nbsp;&nbsp;&nbsp;1u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CHR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1,3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0t0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7732 /dev/null<br/><br/>查看：<br/><textarea name="code" class="php" rows="15" cols="100">
lsof&nbsp;&nbsp;-p 2072 &#124;egrep &#039;cwd&#124;rtd&#124;CHR&#124;unix&#039;&nbsp;&nbsp;
php-fpm 2072 root&nbsp;&nbsp;cwd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;253,0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 236&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;64 /
php-fpm 2072 root&nbsp;&nbsp;rtd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;253,0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 236&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;64 /
php-fpm 2072 root&nbsp;&nbsp;&nbsp;&nbsp;0u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CHR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1,3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0t0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7732 /dev/null
php-fpm 2072 root&nbsp;&nbsp;&nbsp;&nbsp;1u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CHR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1,3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0t0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7732 /dev/null
php-fpm 2072 root&nbsp;&nbsp;&nbsp;&nbsp;6u&nbsp;&nbsp;&nbsp;&nbsp; unix 0x00000000bc0f81d9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0t0&nbsp;&nbsp;&nbsp;&nbsp; 22381 socket
php-fpm 2072 root&nbsp;&nbsp;&nbsp;&nbsp;8u&nbsp;&nbsp;&nbsp;&nbsp; unix 0x00000000cfca06c8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0t0&nbsp;&nbsp;&nbsp;&nbsp; 22382 socket
</textarea><br/><br/><br/>ps -o &#039;pid,ppid,pgid,sid,comm&#039; -C nohup<br/>&nbsp;&nbsp;PID&nbsp;&nbsp;PPID&nbsp;&nbsp;PGID&nbsp;&nbsp; SID COMMAND<br/> 7478 32279&nbsp;&nbsp;7478 32251 nohup<br/><br/>cat nohup.c<br/><textarea name="code" class="php" rows="15" cols="100">
#include &lt;stdio.h&gt;
int main()&#123;
 while(1)&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep(1);
 &#125;
 return 1;
&#125;
</textarea><br/>make nohup<br/>cc&nbsp;&nbsp;&nbsp;&nbsp; nohup.c&nbsp;&nbsp; -o nohup<br/><br/><br/>#ps -C nohup s<br/>&nbsp;&nbsp;UID&nbsp;&nbsp; PID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PENDING&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BLOCKED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IGNORED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CAUGHT STAT TTY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIME COMMAND<br/>&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;2072 0000000000000000 0000000000000000 00000000000000001 0000000180014a06 Ss&nbsp;&nbsp; ?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0:07 php-fpm: master process (<br/><br/>屏蔽了SIGHUP，终端关闭的时候，会忽略终端发送的SIGHUP信号，继续运行服务。<br/><br/>#kill -l<br/> 1) SIGHUP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2) SIGINT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3) SIGQUIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4) SIGILL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5) SIGTRAP<br/> 6) SIGABRT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7) SIGBUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8) SIGFPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9) SIGKILL&nbsp;&nbsp;&nbsp;&nbsp; 10) SIGUSR1<br/>11) SIGSEGV&nbsp;&nbsp;&nbsp;&nbsp; 12) SIGUSR2&nbsp;&nbsp;&nbsp;&nbsp; 13) SIGPIPE&nbsp;&nbsp;&nbsp;&nbsp; 14) SIGALRM&nbsp;&nbsp;&nbsp;&nbsp; 15) SIGTERM<br/>16) SIGSTKFLT&nbsp;&nbsp; 17) SIGCHLD&nbsp;&nbsp;&nbsp;&nbsp; 18) SIGCONT&nbsp;&nbsp;&nbsp;&nbsp; 19) SIGSTOP&nbsp;&nbsp;&nbsp;&nbsp; 20) SIGTSTP<br/>21) SIGTTIN&nbsp;&nbsp;&nbsp;&nbsp; 22) SIGTTOU&nbsp;&nbsp;&nbsp;&nbsp; 23) SIGURG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;24) SIGXCPU&nbsp;&nbsp;&nbsp;&nbsp; 25) SIGXFSZ<br/>26) SIGVTALRM&nbsp;&nbsp; 27) SIGPROF&nbsp;&nbsp;&nbsp;&nbsp; 28) SIGWINCH&nbsp;&nbsp;&nbsp;&nbsp;29) SIGIO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 30) SIGPWR<br/>31) SIGSYS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;34) SIGRTMIN&nbsp;&nbsp;&nbsp;&nbsp;35) SIGRTMIN+1&nbsp;&nbsp;36) SIGRTMIN+2&nbsp;&nbsp;37) SIGRTMIN+3<br/>38) SIGRTMIN+4&nbsp;&nbsp;39) SIGRTMIN+5&nbsp;&nbsp;40) SIGRTMIN+6&nbsp;&nbsp;41) SIGRTMIN+7&nbsp;&nbsp;42) SIGRTMIN+8<br/>43) SIGRTMIN+9&nbsp;&nbsp;44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13<br/>48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12<br/>53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9&nbsp;&nbsp;56) SIGRTMAX-8&nbsp;&nbsp;57) SIGRTMAX-7<br/>58) SIGRTMAX-6&nbsp;&nbsp;59) SIGRTMAX-5&nbsp;&nbsp;60) SIGRTMAX-4&nbsp;&nbsp;61) SIGRTMAX-3&nbsp;&nbsp;62) SIGRTMAX-2<br/>63) SIGRTMAX-1&nbsp;&nbsp;64) SIGRTMAX<br/><br/>IGNORED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0000000000001000 <br/><br/>来自：<a href="https://mp.weixin.qq.com/s/hMXwg9yUSN8rC12HeVp2RA" target="_blank">https://mp.weixin.qq.com/s/hMXwg9yUSN8rC12HeVp2RA</a>
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]Linux后台服务启动方式systemd、daemon、nohup大比拼之lsof查看错误输出和日志等。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>