Solaris config files syntax

I have recently been told that on a Solaris 10 system # means default settings, and that ## indicates a comment.

Therefore, the following setting in the etc/default/login file

#RETRIES=5

indicates that the number of failed login attempts allowed is 5.

Is this true or false? Should the # be removed to enable the setting?

There is no such convention. However, it is true in some configuration files like the one you refer to, the default values are commented out. There is no requirement to explicitly set a parameter to its default value so you can leave RETRIES as it is, that will have the same effect than uncommenting the line.

It's also worth remembering that someone else could have edited this value, then later commented it out :wink:

I have seen that convention used in a number of places but mostly on Linux systems. One place where I came across that convention recently was the preseed file for syslinux.

Can you point us at any Solaris configuration files that appear to use that convention?

That's true but in this particular case, the comments explaining the RETRIES setting usage are quite explicit:

(from OpenSolaris /etc/default/login file)
# RETRIES determines the number of failed logins that will be
# allowed before login exits. Default is 5 and maximum is 15.
# If account locking is configured (user_attr(4)/policy.conf(4))
# for a local user's account (passwd(4)/shadow(4)), that account
# will be locked if failed logins equals or exceeds RETRIES.
#
#RETRIES=5

Note also that the "##" convention the OP is talking about isn't used in that file.

Ah, what I was getting at is that sometimes an admin comes along and uncomments RETRIES, sets it to what they want and goes away, then comes back later (or someone else does) and comments it out to return it to default, now the "#RETRIES=some number" is just what it was last set to rather than the default.
Shared systems and all, I become rather paranoid :wink:

But also, your emboldened bit above is about the only "standard" I ever use - if the default is explicitly named in the comments or man, it's a fair bet that you can assume that's the default. Otherwise, don't expect a standard :slight_smile:

(Half answering jlliagre as to what I was rambling on about, half answering the OP with more info)