[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Automatically restart daemons

Matt Kern <mwk20@cam.ac.uk> writes:

> It might be a nice idea if we put the code to restart various daemons into
> their config files.
> e.g.	# /etc/inetd.conf:  see inetd(8) for further informations. 
> 	# 
> 	# Internet server configuration database 
> 	...
> 	# Local variables: 
> 	# mode: text 
> 	# compile-command: "kill -HUP `cat /var/run/inetd.pid`" 
> 	# End: 
> This is a very useful feature and can really help the turnaround time for
> adding new services manually.  Any thoughts?

I do similiar things for some local files that require very special
commands to take effect. But:
- I put the commands on top of the file. (Matter of taste.)
- I use vi as root, hence I execute them via cut-and-paste.

- Above message might help new Debian users.
- Stores the "make the system use in data" command near the relevant data.

- It promotes using Emacs as root.
- Some people may dislike such texts.
- This entry has to be recognized by scripts that automatically
  append new antries.

IMHO the real solution is to make all the daemons check themselves
whether their config files have changed. This obsoletes the whole
problem, but it is contrary to Unix tradition. 

Implementation: If you seldomly receive requests the daemon could stat
the config files on every request. Otherwise you have to do the same
thing time driven. A better approach were a select(2) extension that
informs you whenever a file was modified.

Sven Rudolph <sr1@sax.de>		http://www.sax.de/~sr1/

Reply to: