📄 hup.inetd
字号:
#! /bin/csh -f# script to send the HUP signal to inetd, which causes it# to re-read /etc/inetd.conf (its configuration file)# assumes the existence of psall, a script to get the# list of processes# Note: Inetd often has to be hup'ed at least twice when it# must rebind ports, due to TCP un-listen semantics.# in SafeTP, this script lives in the same directory as psallset path = ($path .)# make up a temporary file name (the '$$' expands to current pid)set tmp = /tmp/hup.inetd.temp.$$# find the pid of the inetd processpsall | grep inetd | grep root | grep -v grep | grep -v hup.inetd > $tmpif ( `wc -l < $tmp` == "0" ) then echo "error: I didn't find any process that appears to be" echo " inetd. Maybe the psall script isn't working?" rm $tmp exit 2endifif ( `wc -l < $tmp` != "1" ) then echo "error: I am confused as to which of these is inetd:" cat $tmp # don't remove tmp because it may be useful diagnostically exit 2endifset line = `cat $tmp`set pidtokill = ${line[2]}echo sending HUP to process $pidtokillif ( ! { kill -HUP $pidtokill } ) then# hopefully 'kill' already reported the failure exit 2endifrm $tmp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -