I find myself on a regular basis looking for various debconf variables to set before installing packages on Ubuntu. This is typically to not have to type in the answers on the various configuration screens or because I want to script an install of some package. If the package has never been installed before on that specific server then the debconf variables will not display. You can always login to another server where the package is installed to see the variables but I am going to start posting information for common packages here so others can easily find them when searching.
Listed below are the debconf variables for snort-mysql on Ubuntu 12.04. (Precise Pangolin).
Ubuntu snort-mysql debconf Variables:
- snort-mysql snort-mysql/db_pass password
- snort-mysql snort-mysql/interface string eth0
- snort-mysql snort-mysql/disable_promiscuous boolean false
- snort-mysql snort-mysql/options string
- snort-mysql snort-mysql/config_parameters error
- snort-mysql snort-mysql/needs_db_config note
- snort-mysql snort-mysql/address_range string 192.168.0.0/24
- snort-mysql snort-mysql/send_stats boolean true
- snort-mysql snort-mysql/please_restart_manually note
- snort-mysql snort-mysql/db_database string
- snort-mysql snort-mysql/stats_treshold string 1
- snort-mysql snort-mysql/stats_rcpt string root
- # Set up a database for snort-mysql to log to?
- snort-mysql snort-mysql/configure_db boolean false
- snort-mysql snort-mysql/db_host string
- snort-mysql snort-mysql/db_user string
- snort-mysql snort-mysql/invalid_interface error
- snort-mysql snort-mysql/startup select boot
The snort-mysql debconf variables that need to be set to not interact with the installation include address_range and configure_db. If the configure_db boolean is set to true then you will also need to set db_host and db_user. A debconf snort-mysql variable can be set using the below command to set the snort-mysql address_range as an example.
Set snort-mysql debconf address_range Variable:
- echo snort-mysql snort-mysql/address_range string 192.168.0.0/24 | debconf-set-selections
Going a little but further you might also want to obtain the IP address of the Ethernet interface and only allow that IP to be part of Snort’s $HOME_NET. To do this you could set an environment variable such as $SNORTIP which would allow you to script the entire snort-mysql installation process. Below this environment variable is set and then echo’d to show you it exists.
Create $SNORTIP Environment Variable:
- root@ubuntu-dev:~# SNORTIP=$(/sbin/ifconfig eth1 | grep 'inet addr:' | cut -d: -f2| cut -d' ' -f1)
- root@ubuntu-dev:~# echo $SNORTIP
So now that the $SNORTIP environment variable is set you could update the debconf snort-mysql variable address_range which is needed for the installation of snort-mysql on Ubuntu Linux as shown in the below example.
Set snort-mysql debconf Variable address_range After Setting $SNORTIP:
- echo snort-mysql snort-mysql/address_range string $SNORTIP/32 | debconf-set-selections
After setting the necessary debconf variables you should now be able to install Snort using a script or from the Linux command line without any interaction.