Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 1175 - Update for /etc/init.d/scripts
Summary: Update for /etc/init.d/scripts
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Donny Davies (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-16 08:07 UTC by phoen][x
Modified: 2003-02-04 19:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description phoen][x 2002-03-16 08:07:37 UTC
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-
Comment 1 phoen][x 2002-03-16 08:42:20 UTC
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
+}
Comment 2 Daniel Robbins (RETIRED) gentoo-dev 2002-03-16 09:09:41 UTC
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.
Comment 3 phoen][x 2002-03-16 10:40:25 UTC
but samba has not to be restarted in order to reload the configuration file.
or did i get your comment wrong?
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-03-21 04:11:07 UTC
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.
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2002-04-25 15:46:17 UTC
Ill see if i can get to this.
Comment 6 phoen][x 2002-04-26 00:25:00 UTC
thx azarah. i'd be glad to help. 

-phoen][x-
Comment 7 Donny Davies (RETIRED) gentoo-dev 2002-04-26 12:41:34 UTC
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 :(
Comment 8 phoen][x 2002-04-26 16:21:16 UTC
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-