PDA

View Full Version : [SOLVED] Samba Options



Oxwivi
October 18th, 2010, 01:45 PM
How do I run Samba with a different option, specifically -D? Can I do it from the GUI (system-config-samba)?

Also, how do I ensure it runs and startup?

Oxwivi
October 19th, 2010, 06:13 AM
<snip>
Bump

luvshines
October 19th, 2010, 12:26 PM
See if this file helps:
/etc/init/smbd.conf

It has exec smbd -F in the end. Maybe -D will do the trick.
This file itself is the one which make Smdb an upstart job and defines the run-levels on which it should be running on system startup.

Oxwivi
October 19th, 2010, 05:07 PM
On 10.10 Samba runs as a service, no longer from init.

Morbius1
October 19th, 2010, 05:44 PM
On 10.10 Samba runs as a service, no longer from init.
It never ran from init, It ran from init.d. It still does ( sort of ) only now there's a symlink there to show it's now controlled by upstart.

Do as luvshines says and go to /etc/init/smbd.conf. What you will see this:

description "SMB/CIFS File Server"
author "Steve Langasek <steve.langasek@ubuntu.com>"

start on (local-filesystems and stopped rc)
stop on runlevel [!2345]

respawn

pre-start script
RUN_MODE="daemons"

[ -r /etc/default/samba ] && . /etc/default/samba

[ "$RUN_MODE" = inetd ] && { stop; exit 0; }

install -o root -g root -m 755 -d /var/run/samba
end script

exec smbd -F
I have no idea if that will answer your question but I beleive that is what luvshines is referring to.

Oxwivi
October 19th, 2010, 05:52 PM
I see, sorry I don't know too much about how it works, I was arrogant. I'll do as you say.

Oxwivi
October 19th, 2010, 06:33 PM
Okay, it successfully runs in the option of my choice, thank you very much!

But my printer I'm sharing from Ubuntu doesn't show up on Windows even if the Ubuntu system is visible on network. Only after I run the Samba GUI, system-config-samba, the printer shows up. Any ideas?

Morbius1
October 19th, 2010, 07:32 PM
I had the same problem. It's caused by smbd starting before cups starts instead of the other way around like it should. As it turns out I inadvertently posted the solution I use above. That is not the default /etc/init/smbd.conf , it is is the workaround for your problem:

description "SMB/CIFS File Server"
author "Steve Langasek <steve.langasek@ubuntu.com>"

start on (local-filesystems and stopped rc)
stop on runlevel [!2345]

respawn

pre-start script
RUN_MODE="daemons"

[ -r /etc/default/samba ] && . /etc/default/samba

[ "$RUN_MODE" = inetd ] && { stop; exit 0; }

install -o root -g root -m 755 -d /var/run/samba
end script

exec smbd -F

Oxwivi
October 20th, 2010, 06:37 AM
Banzai! Finally! Finally I can print freely (as long as the Ubuntu system is on)! Thank you - thank you very much! You have my utmost gratitude!

Oxwivi
October 20th, 2010, 11:37 AM
By the way, can anyone tell me how to restart services? Obviously init.d et al doesn't work...

Morbius1
October 20th, 2010, 12:06 PM
sudo service smbd restart

As it turns out smbd is a tricky one.

If smbd is not running then "sudo service smbd restart" will fail.

To start it if it's not running: "sudo service smbd start"

If smbd is running and you want to restart it: "sudo service smbd restart"

Oxwivi
October 20th, 2010, 12:20 PM
So Samba always runs at the root level?