hup.inetd

来自「伯克利做的SFTP安全文件传输协议」· INETD 代码 · 共 40 行

INETD
40
字号
#! /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 + =
减小字号Ctrl + -
显示快捷键?