i already argued with seemant about this issue: some daemons -including samba- kill all connections on restart. (sshd doesnt do it, so you can restart it while connected with ssh (nice)) for example samba: a windows guy copies stuff from your box and you restart samba (cause you changed the conf). his transfer will break immediately, and he has to retransmit cause windows cant resume (lol). i grabbed through my old debian init.d scripts and saw a line which takes care of it: "start-stop-daemon --stop --signal HUP --exec <daemon>" it would be pretty nice if somebody could include this in the init.d scripts. (the init.d scripts arent a big issue, but you have to modify /sbin/runscript, too - otherwise it tells you that it doesnt now "reload") i'll take a look at /sbin/runscript myself and post the diffs if i can make them myself. so long -phoen][x-
ahh now i know how the scripts work. well this should allow reloading without restarting, but reload doesnt work if samba isnt started. :/ maybe somebody else has a clue how to write this. i'll ask woodchip to check this as soon as i see him. the other scripts should be similar, i'll only take care of the samba script (and thats no personal grudge against you, woodchip). here's the diff: (btw, i have samba 2.2.3a-r1 installed) --- samba.orig 2002-03-16 16:35:05.000000000 +0100 +++ samba.new 2002-03-16 16:48:42.000000000 +0100 @@ -2,6 +2,7 @@ # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # /space/gentoo/cvsroot/gentoo-x86/net-fs/samba/files/samba.rc6,v 1.6 2002/03/11 03:56:49 woodchip Exp +opts="start stop reload restart" depend() { need net @@ -24,3 +25,13 @@ result=$(( $result + $? )) eend $result } + +reload() { + ebegin "Reloading samba" + start-stop-daemon --stop --signal HUP --exec /usr/sbin/nmbd + result=$? + start-stop-daemon --stop --signal HUP --exec /usr/sbin/smbd + result=$(( $result + $? )) + eend $result +}
This could also be the restart() method too. Samba connections *will* blow up if smbd is stopped and restarted; there's not much you can do about it.
but samba has not to be restarted in order to reload the configuration file. or did i get your comment wrong?
My opinion is that restart and reload is two entirely different things. Restart: kill the deamon, then start it again (even with connections running) Reload: Just reload the config sshd is the exception to this, as the main daemon spawns other processes, thus the children do not get restarted.
Ill see if i can get to this.
thx azarah. i'd be glad to help. -phoen][x-
reload in the rc-scripts might not be such a bad idea. thing is, theres lot of them. doing it for all would be a nice touch, but thats a lot of boring work.. kind of a drag :(
woodchip: tell me which one the interesting are, and i'll do the reload diff and submit it. or should it be done for all daemons? -phoen][x-