0

When I am sending HUP signal to inetd so that it rereads the new inetd.conf file, what I want is, the processes controlled by the inetd process should also restart, so that it can read the new command line parameters added to the inetd.conf file as part of the change.

I know I can search for the running process and kill it, but is there a standard way to do this. I could not find anything over the Internet.

Haris
  • 12,120
  • 6
  • 43
  • 70
  • 2
    A bit of clarity: You're asking if inetd will kill and restart processes it started before you asked it to reload it's configuration file? Short answer, no. New processes will get your new arguments, but existing processes will be unchanged until they exit normally. – Eric Schnoebelen Aug 12 '17 at 04:17
  • @EricSchnoebelen, Thanks for the reply. So, is there a standard way to killing those processes, so that they can restart with the new config – Haris Aug 16 '17 at 05:25

1 Answers1

0

The standard inetd included in NetBSD does not manage the processes it starts (except for single-threaded services, i.e. those with "wait" flags) -- it just starts them. Each child process services one active connection and then exits when done (i.e. when the connection is closed). In the general case it would be very unwise to kill such processes early without very good reason -- for example consider the case where your current login session (where you tell inetd to reload) was opened to a service controlled by inetd (e.g. sshd).

If you really want to kill processes handling active current connections then you will have to write some helper script of your own to do that, though perhaps pkill will suffice.

Greg A. Woods
  • 2,663
  • 29
  • 26