check configure file

sshd -t

apachectl -t

lighttpd -t

squid -k check

postfix [-v] [-c config_dir] check                <-- Warn  about  bad  directory/file ownership or permissions


Samba

testparm -v

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[FolderA]"
Processing section "[FolderB]"
Processing section "[DFS]"
Unknown parameter encountered: "read-only"
Ignoring unknown parameter "read-only"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

 


DNS

 

 

/usr/sbin/named -u named -t /var/named/chroot

OR

named-checkconf

named-checkconf /etc/named.conf

# chrooted named

named-checkconf -t /var/named/chroot /etc/named.conf

no output ==> configuration is considered correct (只代表 named.conf 沒問題而已)

-z
           Perform a test load of all master zones found in named.conf.

Centos 上的方法:

service named configtest   <-- 同時做了 -t -z

 


nagios -v nagios.cfg

proftpd -t

rsyslogd -N 1                 <-- higher levels will mean more verbosity

rsnapshot configtest