Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: FreakWent on January 29, 2011, 01:58:40 PM
-
Look here at what I did and what happened:
bash-3.00# /sbin/e-smith/db configuration show squid
EnforceSafePorts=no
SafePorts=21,70,80,81,119,210,443,563,980,1024-65535
TCPPort=3128
TCPProxyPort=80:3128
Transparent=no
TransparentPort=3128
access=private
status=disabled
bash-3.00# /sbin/e-smith/db configuration set squid enabled
bash-3.00# /sbin/e-smith/db configuration show squid
squid=enabled
How do I get squid's config back in the config db?
-
the correct command should be:
/sbin/e-smith/db configuration set squid status enabled
note you missed the word status in your command!
I'm not sure how to go back... maybe
/sbin/e-smith/db configuration delprop squid
followed by a "signal-event post-upgrade" and "signal-event restart" so template are rebuilt.
anyone can confirm this BEFORE FreakWent test it ?
EDIT: FreakWent: because you have all information requested to go back to previous state, you can issue a long db command with all those parameters... or use one each time.
/sbin/e-smith/db configuration setprop squid
EnforceSafePorts no
SafePorts 21,70,80,81,119,210,443,563,980,1024-65535
TCPPort 3128
TCPProxyPort 80:3128
Transparent no
TransparentPort 3128
access private
status enabled
-
How do I get squid's config back in the config db?
You can get the default configuration back by doing:
/sbin/e-smith/config delete squid
/sbin/e-smith/signal-event post-upgrade
/sbin/e-smith/signal-event reboot
-
the correct command should be:
/sbin/e-smith/db configuration set squid status enabled
No, that's not correct. The correct command would have been:
/sbin/e-smith/db configuration setprop squid status enabled
-
I'm not sure how to go back... maybe
/sbin/e-smith/db configuration delprop squid
followed by a "signal-event post-upgrade" and "signal-event restart" so template are rebuilt.
anyone can confirm this BEFORE FreakWent test it ?
You would use 'delete' rather than 'delprop' to delete the whole record.
-
EDIT: FreakWent: because you have all information requested to go back to previous state, you can issue a long db command with all those parameters... or use one each time.
/sbin/e-smith/db configuration setprop squid
EnforceSafePorts no
SafePorts 21,70,80,81,119,210,443,563,980,1024-65535
TCPPort 3128
TCPProxyPort 80:3128
Transparent no
TransparentPort 3128
access private
status enabled
No, this is close, but won't work, because the type of the record (currently 'enabled') must be set to 'service'. So you would need:
/sbin/e-smith/config set squid service \
EnforceSafePorts no \
SafePorts 21,70,80,81,119,210,443,563,980,1024-65535 \
TCPPort 3128 \
TCPProxyPort 80:3128 \
Transparent no \
TransparentPort 3128 \
access private \
status enabled
-
So in general my tip was correct but the sintax was wrong. Good to know.
I'd love to use this opportunity to understand and later document differences between set setprop del delprop get getprop show ...
In the http://wiki.contribs.org/Db_command_tutorial this is not clear and I have problems to understand where/when to use each one. Wouldn't be nice to make a lemonade with this lemon ? ;)
-
I'd love to use this opportunity to understand and later document differences between set setprop del delprop get getprop show ...
It all seems pretty straight forward and I am unsure if this really needs additional documentation. The internal configuration database is described in detail in the SME Server Developers Guide which can be found in the wiki.
In principle every database has a key of a certain type, with zero or more properties. To delete a whole key one would use:
db database delete key
To delete a property one would select the key from the database which is the parent of the property and select which property of that key to delete:
db database delprop key property
To set values the same analogy applies, specify the database and the key and state the propery and the value you would like to set:
db database setprop key property value
-
Wow, great replies everyone, thanks a lot!
I won't do a signal-event post-upgrade because I suspect that this will alter values other than squid, and I have some other changes in the db too.
I have enough here to fix this, so thanks again!
-
I won't do a signal-event post-upgrade because I suspect that this will alter values other than squid, and I have some other changes in the db too.
Normally it should not. It will only effectuate the changes made in the configuration database(s). Eventually you will have to do a signal-event post-upgrade after installing updates. It is better not to wait with this after updates in order to keep the system functioning stable and properly.
Other configuration changes through server manager might lead to undesired effects as well, if you fail to do the signal-event post-upgrade when required.