About nixCraft

Topics

Test your Samba server for configuration errors

Posted by Vivek Gite [Last updated: September 28, 2006]

You can easily test your Samba server for configuration errors. It check an smb.conf configuration file for internal correctness.

If this program reports no problems, you can use the configuration file with confidence that smbd will successfully load the configuration file.

Open a shell prompt. And type the following command:
# testparmOR# testparm /etc/samba/smb.conf

The program will issue a message saying whether the configuration file loaded OK or not. This message may be preceded by errors and warnings if the file did not load. If the file was loaded OK, the program then dumps all known service details to screen.

If testparm finds an error in the smb.conf file it returns an exit code of 1 to the calling program, else it returns an exit code of 0. This allows shell scripts to test the output from testparm.

For example:
testparm
if [ $? -eq 0 ]; then
echo "Syntax OK"
else
echo "Syntax Error"
fi

E-mail this to a Friend    Printable Version

You may also be interested in other helpful articles:

Discussion on This Article:

  1. ken Says:

    That’s extremely OK!

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Powered by Open source software.