Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to restart Samba after editing smb.conf

4,584 views
Skip to first unread message

e892...@stud1.tuwien.ac.at

unread,
Apr 11, 1999, 3:00:00 AM4/11/99
to
Hello,
i have read somewhere that smbd reads smb.conf every minute.
But that doesn't seem to work everytime. My changes to smb.conf
yesterday took more than one hour to be updated (so, that i could see
the new shares on my win95 pc).
However, how can i make Samba to read smb.conf manually. I have
already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.
Could some1 give me any hints, please.
Thanx,
Arash :-)

Erik Vellmete

unread,
Apr 11, 1999, 3:00:00 AM4/11/99
to
e8925920, (what a funny name)

e892...@stud1.tuwien.ac.at wrote:
>
> Hello,
> i have read somewhere that smbd reads smb.conf every minute.
> But that doesn't seem to work everytime. My changes to smb.conf
> yesterday took more than one hour to be updated (so, that i could see
> the new shares on my win95 pc).

It works but you have to close the connection to your client (logout or
kill the connection using swat). Only new connections get the new
parameters.

> However, how can i make Samba to read smb.conf manually. I have
> already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.

Restart it (that means kill *all* connections), that's the only way I
know.

Erik

--
Erik Vellmete, maito: erik.v...@dignos.com
Dignos EDV-GmbH, Heidelberg, Germany

John Woodward

unread,
Apr 11, 1999, 3:00:00 AM4/11/99
to
Try reboot

e892...@stud1.tuwien.ac.at wrote in article
<37106d78...@news.tuwien.ac.at>...


> Hello,
> i have read somewhere that smbd reads smb.conf every minute.
> But that doesn't seem to work everytime. My changes to smb.conf
> yesterday took more than one hour to be updated (so, that i could see
> the new shares on my win95 pc).

> However, how can i make Samba to read smb.conf manually. I have
> already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.

Arash

unread,
Apr 11, 1999, 3:00:00 AM4/11/99
to
On Sun, 11 Apr 1999 14:42:27 +0200, Erik Vellmete
<erik.vellm...@dignos.com> wrote:

>e8925920, (what a funny name)
>
>e892...@stud1.tuwien.ac.at wrote:
>>

>> Hello,
>> i have read somewhere that smbd reads smb.conf every minute.
>> But that doesn't seem to work everytime. My changes to smb.conf
>> yesterday took more than one hour to be updated (so, that i could see
>> the new shares on my win95 pc).

>It works but you have to close the connection to your client (logout or
>kill the connection using swat). Only new connections get the new
>parameters.

And what is swat? I have no man entry for swat.

>
>> However, how can i make Samba to read smb.conf manually. I have
>> already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.

>Restart it (that means kill *all* connections), that's the only way I
>know.
>
>Erik
>
>--
>Erik Vellmete, maito: erik.v...@dignos.com
>Dignos EDV-GmbH, Heidelberg, Germany


Thanks for your help,
Arash :-)

Jeroen Zonneveld

unread,
Apr 11, 1999, 3:00:00 AM4/11/99
to
Why don't you use 'smbd restart' ? (This works fine if you did not change
network related settings). If you change the network related settings like
'interfaces = 145.1.100.201/24' (select networkcard in your Linux-server) or
'host allow = 145.1.100. (space) 127.' (only the local LAN @ 145.1.100.0 wil
be served by Samba). You better use:

smbd stop
nmbd stop
smbd start

e892...@stud1.tuwien.ac.at wrote in message
<37106d78...@news.tuwien.ac.at>...


>Hello,
> i have read somewhere that smbd reads smb.conf every minute.
>But that doesn't seem to work everytime. My changes to smb.conf
>yesterday took more than one hour to be updated (so, that i could see
>the new shares on my win95 pc).

>However, how can i make Samba to read smb.conf manually. I have
>already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.

markus

unread,
Apr 11, 1999, 3:00:00 AM4/11/99
to
In article <3710aebe...@news.tuwien.ac.at>, Arash wrote:
>And what is swat? I have no man entry for swat.
>

Swat is a www-interface to samba (smb.conf) and is
distributed with samba since version 2.x i think..

However you should stick to the latest release
2.0.3 which comes with swat which in turn is
automatically installied if you follow the
default procedure.

sincerly,
Markus

ps: 2.0.3 kannst vom gd.tuwien saugen ;)

Erik Vellmete

unread,
Apr 12, 1999, 3:00:00 AM4/12/99
to
Arash,

Arash wrote:
>
[...]


>
> And what is swat? I have no man entry for swat.

It is a web administration tool for samba included in samba-2.0.3-1 rpm
package on my linux box (Suse 6.0, kernel 2.0.36). man swat returns
SWAT(8) SWAT(8)


NAME
swat - swat - Samba Web Administration Tool
and so on

[...]
Hope this helps.

Erik
--
mailto: erik.v...@dignos.com
Dignos EDV-GmbH, Heidelberg, Germany

Saeser

unread,
Apr 12, 1999, 3:00:00 AM4/12/99
to e892...@stud1.tuwien.ac.at
e892...@stud1.tuwien.ac.at wrote:

> Hello,
> i have read somewhere that smbd reads smb.conf every minute.
> But that doesn't seem to work everytime. My changes to smb.conf
> yesterday took more than one hour to be updated (so, that i could see
> the new shares on my win95 pc).
> However, how can i make Samba to read smb.conf manually. I have
> already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.
> Could some1 give me any hints, please.
> Thanx,
> Arash :-)

The RIGHT answer to this question is to issue the following command:

/etc/rc.d/init.d/smb stop

to restart you can then issue:

/etc/rc.d/init.d/smb start

In fact, you may wish to edit your /etc/bashrc file and add these as
alias' so that you can just issue:

smbstop to stop
smbstart to start
e.g.

alias smbstop="/etc/rc.d/init.d/smb stop"
alias smbstart="/etc/rc.d/init.d/smb start"

While rebooting will *technically* work, it's asinine. That suggestion
was not worth the bandwidth it took to post.

sae...@ibm.net


Scott Knight

unread,
Apr 13, 1999, 3:00:00 AM4/13/99
to
> i have read somewhere that smbd reads smb.conf every minute.
> But that doesn't seem to work everytime. My changes to smb.conf
> yesterday took more than one hour to be updated (so, that i could see
> the new shares on my win95 pc).
> However, how can i make Samba to read smb.conf manually. I have
> already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.
> Could some1 give me any hints, please.

doesn't the command 'samba restart' work? It does on my machines.

'samba status' gives the pid's

later dates.
--
Scott Knight mailto:skn...@mich.com
http://www.mich.com/~sknight

Serge Dutremble

unread,
Apr 13, 1999, 3:00:00 AM4/13/99
to
I usually just run testparm and see all my changes appear in the stats. It
usually takes a few minutes to have the shares appear on my network but I
believe it is more related with the frequency of the browser than anything
else.

I could be wrong though as I am a newbe myself.

Serge.

Scott Knight <skn...@mich.com> wrote in message
news:37133861...@mich.com...

Wayne Mews

unread,
Apr 13, 1999, 3:00:00 AM4/13/99
to
I use the following to restart my SAMBA after a configuration change

/etc/rc.d/init.d/smb restart

works for me every time

sincerely

Wayne

John Woodward wrote:

> Try reboot
>
> e892...@stud1.tuwien.ac.at wrote in article
> <37106d78...@news.tuwien.ac.at>...
> > Hello,

> > i have read somewhere that smbd reads smb.conf every minute.
> > But that doesn't seem to work everytime. My changes to smb.conf
> > yesterday took more than one hour to be updated (so, that i could see
> > the new shares on my win95 pc).
> > However, how can i make Samba to read smb.conf manually. I have
> > already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.
> > Could some1 give me any hints, please.

> > Thanx,
> > Arash :-)
> >


Bob Farmer

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to
That only works, of course, if you actually have setup an
/etc/rc.d/init.d/smb script. That's not installed as part of a normal
Samba setup, and sounds like a Linux-package-specific thing.

Additionally, the original poster wanted to just make it re-read the
config, not restart it. Big difference.

The best way is probably:
kill -HUP `cat /usr/local/samba/var/locks/smbd.pid`
kill -HUP `cat /usr/local/samba/var/locks/nmbd.pid`

Adjust /usr/local/samba to the proper directory location as necessary.

Bob


In article <37140C27...@dlcwest.com>,


--
Bob Farmer ucs...@shsu.edu
Computer Services, Sam Houston State University; Huntsville, TX

boney_stew

unread,
Apr 14, 1999, 3:00:00 AM4/14/99
to
I use sambaconfig

It shuts the service down, reads the changed smb.conf and restarts with a
question of inetd or daemon

Alex


scott

unread,
Apr 18, 1999, 3:00:00 AM4/18/99
to
To restart smb
type smbd stop
then type smbd start


Thomas M. Scorpa

unread,
Apr 18, 1999, 3:00:00 AM4/18/99
to
Ok,
Here's how to reboot your samba....

/etc/rc.d/init.d/smb restart

This reboots the server without rebooting everything else = )

-Scorp


Gonzalo Torres

unread,
Apr 22, 1999, 3:00:00 AM4/22/99
to

boney_stew wrote:

utiliza samba restaart en la linea de comandos

U.K.

unread,
Apr 25, 1999, 3:00:00 AM4/25/99
to
There is a Script named rcsmb
Use it as rcsmb restart

scott schrieb in Nachricht <371A22D9...@isd.pen.net>...

Bob Farmer

unread,
Apr 25, 1999, 3:00:00 AM4/25/99
to
Neither of these items, the script called "rcsmb", or the "smbd" script
(probably RedHat's /etc/rc.d/init.d/smbd) the other poster speaks of are
part of Samba, they are part of your specific operating system's
configuration.

Bob

In article <92505541...@home.gelsen-net.de>,

R Mercado

unread,
Apr 26, 1999, 3:00:00 AM4/26/99
to

kill -HUP <PID>

is all that you need. I read it somewhere in the documentation.

ccmo...@my-dejanews.com

unread,
Apr 26, 1999, 3:00:00 AM4/26/99
to
The best way to restart is to issue the following command:

ps -ef |grep mbd |grep -v grep |awk '{print $2}' |xargs kill -1

This works better than anything else for Solaris boxes, as users stay
connected while Samba re-reads.

-CM


In article <37106d78...@news.tuwien.ac.at>,


e892...@stud1.tuwien.ac.at wrote:
> Hello,
> i have read somewhere that smbd reads smb.conf every minute.
> But that doesn't seem to work everytime. My changes to smb.conf
> yesterday took more than one hour to be updated (so, that i could see
> the new shares on my win95 pc).
> However, how can i make Samba to read smb.conf manually. I have
> already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.
> Could some1 give me any hints, please.
> Thanx,
> Arash :-)
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Dave Barr

unread,
Apr 26, 1999, 3:00:00 AM4/26/99
to
In article <7g2he3$1ot$1...@nnrp1.dejanews.com>,

<ccmo...@my-dejanews.com> wrote:
>The best way to restart is to issue the following command:
>
> ps -ef |grep mbd |grep -v grep |awk '{print $2}' |xargs kill -1

This works up until you have other processes with "mbd" in their name.

I cringe everytime I see people post shoddy hacks like this.

--Dave
--
http://www.cis.ohio-state.edu/~barr/
ba...@cis.ohio-state.edu

Andrew Perrin

unread,
Apr 26, 1999, 3:00:00 AM4/26/99
to
Indeed. Samba has a very pleasant habit of putting its current process
id's (the parents, that is) in /usr/LOCAL/samba/var/locks/?mbd.pid which
means you can just do (depending on your scripting language) kill `cat
/usr/LOCAL/samba/var/locks/?mbd.pid`; or something similar.

ap

Dave Barr wrote:

--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting - (650)938-4740
ape...@mcmahon.qal.berkeley.edu (Remove the Junk Mail King)
http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------

Dion Rivera [ESRI-Redlands]

unread,
Apr 26, 1999, 3:00:00 AM4/26/99
to
R Mercado wrote:

I agree with R. Mercado

kill -HUP <PID> will work, this is what I use.

-Dion


Sparkzz

unread,
Apr 27, 1999, 3:00:00 AM4/27/99
to
I think Samba rereads the smb.conf file
every minute or so.

I just leave mine alone, and it picks up the
smb.conf edits just fine.

.
.
....Ken

Roumen Petrov

unread,
Apr 27, 1999, 3:00:00 AM4/27/99
to
In article <37106d78...@news.tuwien.ac.at>,
e892...@stud1.tuwien.ac.at wrote:
> Hello,
> i have read somewhere that smbd reads smb.conf every minute.
> But that doesn't seem to work everytime. My changes to smb.conf
> yesterday took more than one hour to be updated (so, that i could see
> the new shares on my win95 pc).
> However, how can i make Samba to read smb.conf manually. I have
> already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.
> Could some1 give me any hints, please.
> Thanx,
> Arash :-)
>
I expected this is samba bug. I use samba-2.0.2 from original source code.
I am set in global section:

log file = /usr/local/samba/var/log.%m
debuglevel = 3

, then edit smb.conf (delete old share) and after 5 min run
grep -n param/loadparam.c:init /usr/local/samba/var/log.<my_win95>
Samba read again smb.conf. O.K.
On my win95 pc i see this old share.
I kill all smbd and nmbd process and run samba. This old share don`t exist.
=> HOWTO restart samba:
1. kill samba.
#!/bin/sh

echo kill all connections
#ps x |grep -w [sn]mbd
smbcon=`smbstatus -p 2>/dev/null`
for p in $smbcon; do
kill $p;
done

echo kill daemons
#ps x |grep -w [sn]mbd
#my samba is instaled in /usr/local/samba !
kill `cat /usr/local/samba/var/locks/smbd.pid`
kill `cat /usr/local/samba/var/locks/nmbd.pid`

echo end
#ps x |grep -w [sn]mbd

2. start samba

If an user is connected W95 restore connection automaticali.
I don`t have problem with aplication running from samba share, when restart
samba.

Roumen Petrov

unread,
Apr 28, 1999, 3:00:00 AM4/28/99
to
In article <7g50qn$915$1...@nnrp1.dejanews.com>,

Roumen Petrov <roumen...@my-dejanews.com> wrote:
> In article <37106d78...@news.tuwien.ac.at>,
> e892...@stud1.tuwien.ac.at wrote:
> > Hello,
> > i have read somewhere that smbd reads smb.conf every minute.
> > But that doesn't seem to work everytime. My changes to smb.conf
> > yesterday took more than one hour to be updated (so, that i could see
> > the new shares on my win95 pc).
> > However, how can i make Samba to read smb.conf manually. I have
> > already tried "kill -1 smbd" and "kill -1nmbd" which didn't help.
> > Could some1 give me any hints, please.
> > Thanx,
> > Arash :-)
> >
...my old message
>
Don`t restart samba !!!
#!/bin/sh
#
# /usr/local/sbin/smbdisconnect
# Run this script after change of smb.conf
#

echo kill all smb user connections...


smbcon=`smbstatus -p 2>/dev/null`
for p in $smbcon; do
kill $p;
done

-----------== Posted via Deja News, The Discussion Network ==----------

Larry Clay

unread,
May 4, 1999, 3:00:00 AM5/4/99
to
I find that simply issuing the following commands works just fine. I am
running Redhat 5.2.

/etc/rc.d/init.d/smb stop
/etc/rc.d/init.d/smb start

Of course your path to smb may be different.

Andrew Perrin <ape...@mcmahon.qal.berkeley.edu> wrote in message
news:3724DCDC...@mcmahon.qal.berkeley.edu...

Thomas Angst

unread,
May 7, 1999, 3:00:00 AM5/7/99
to
more comfortable:
/sbin/init.d/smb restart

Roumen Petrov <roumen...@my-dejanews.com> schrieb in im Newsbeitrag:
7g79kt$90k$1...@nnrp1.dejanews.com...

0 new messages