install.sh improvements for Debian

Hello,
At first, congratulations for an amazing software as Virtualmin GPL.
I have been using it for 2 weeks now, and still thinks it took the right approach to solve many sysadmin tasks.
Having used, for years, cPanel, Plesk and IspConfig, I can compare its features and approach.
But it still has some improvements to be made.
Installation and configuration at a Virtuozzo VPS running Debian 4.0 was difficult to accomplish correctly.
I intend to write a detailed step by step about it at my blog.
For now, I have a few suggestions to install.sh.
Generaly speaking, a sysadmin chooses Debian BECAUSE of its superb package management, not despite of it.
So, at the install.sh, modifications should be done to LEVERAGE it instead of trying to circumvent it.
There are some dangerous decisions at the install.sh and apt.conf.noninteractive approaches that caused problems when I installed Virtualmin.
As I have to use a Virtuozzo VPS, provisioned by a template from the hosting company, there were many packages installed beyond the Debian basic install.
Cyrus, Apache2 and php among them.
I did not read your apache2 debian source files, but the install.sh did not remove all the official debian apache2 packages already installed. This resulted in a mixed installation, wich did not work and gave weird effects, for sure.
If before installation of custom virtualming apache2 packages, all the previous related ones were removed, problems could be avoided.
Also, conflicting packages like Cyrus were left, causing conflicting servers at ports…
One possible quick fix could be using "–assume-yes" instead of the dangerous "–force-yes" apt-get paremeter.
Better could be to left the sysadmin choose actions regarding conflicting packages and old configuration files.
Regarding configuration files, the apt.conf.noninteractive uses dangerous options "–force-confmiss";"–force-confold".
This could lead to ugly problems too.
A "soft" approach could be to use "–force-confdef" or at least only "–force-confold". Or leave to the sysadmin to decide.
Instead of forcing things over dpkg and apt-get, a dangerous approach, a preseeding for extra packages file could be used instead.

http://www.debian-administration.org/articles/394
http://reductivelabs.com/trac/puppet/wiki/Recipes/DebianPreseed
http://www.debian.org/releases/stable/i386/apb.html.en
http://www.debian.org/releases/stable/i386/apbs04.html.en#preseed-other

I hope these suggestions help to Virtualmin become an even better software.
Regards.
Andre Felipe Machado
http://www.techforce.com.br

Hello,
As a further suggestion suitable for Debian systems, you could configure Virtualmin repositories like http://www.backports.org did.
Also, using apt pinning technique through /etc/apt/preferences file, the install script could better solve dependencies, maybe using
apt-get -t virtualminrepository install package1 package2 package3
Hope this helps.
Regards.
Andre Felipe Machado
http://www.techforce.com.br<br><br>Post edited by: afmachado, at: 2009/05/22 09:20

Thanks for the links.

We actually do take working with the system rather than against it very seriously (have a look at the vast array of $osname.config files in the Webmin source tree…we’ve put thousands of hours into working with your specific OS over the past 11+ years). It is core to everything we do. However, I found getting things to actually work non-interactively with apt-get was atrociously difficult. A requirement of many of our hosting provider customers (and our own new cloud computing system) is that the install script can run completely without human involvement. apt-get makes that very very very difficult, unfortunately. And, when I asked questions of Debian users, nobody knew how to use apt-get non-interactively.

But, if there are better ways to do it, then I am all for it. I actually spent several days fighting with pinning before giving up. It never seemed to actually do anything when used the way I wanted to use it…so I gave up and punted. :wink:

I’m going to add this to my todo list, and I’ll be back in a week or two to bug you about making all of this stuff work. I have a real hard time with the Debian documentation, particularly with the repository management tools…there are never any useful examples! It sounds like you know how it all works, so I’m going to question you mercilessly about it.

Hello,
Feel free to post questions. I hope to be able to answer some of them and will try to call for help at the debian-user lists.
The Debian Wiki also contains useful hints.
http://wiki.debian.org
When you make the virtualmin packages, you could find useful the advanced packaging techniques described and with many further Debian bibliography at
http://wiki.debian.org/PkgSplit
Debian has a vast array of useful tools at sysadmin and developer hands.
Almost all problems could be solved using some clever tool.
So, for example, if you HAVE to get some non-interactive installation, you could leverage the preseeding and debconf selections file.
Debconf is the tool used by packagers to create those installation dialogs (graphical and terminal).
The sysadmin can create a file containing pre-filled answers to standard repository packages.
At another approach, a sysadmin could REPACKAGE (to its own non-official repository) a standard package, embedding those pre-filled answers. But this leads to more work to maintain all packages syncd with official security updates and versions.
Yet another approach is to prepare a file with debconf selections containing DESIRED installation status of each package.
So, you could specify what packages should be installed or deinstalled to reach a specified group of packages. But this implies that all virtualmin servers will become exactly equal during the installation process (good or bad?)
Read my examples and links at
http://www.techforce.com.br/news/linux_blog/oracle_10g_r2_in_debian_domu_into_debian_dom0
You could also realize some clever hints reading about massive scale installation tools for Debian:
http://www.techforce.com.br/news/linux_blog/massive_installation_management_tools_p_1
http://www.techforce.com.br/news/linux_blog/massive_installation_management_tools_p_2
http://www.techforce.com.br/news/linux_blog/massive_installation_management_tools_p_3
These tools also need to execute automated installations and many of them actually use the native tools under the hood.
For the virtualmin purposes, I guess good options could be evaluate pkgsync, jablicator, debconf preseeding and even some Debian Pure Blends tools. Debian Pure Blend Tools create metapackages containing dependencies and preconfigurations for OTHER official packages.
http://wiki.debian.org/DebianPureBlends
From an initial look, one or two of these should be enough (each has its scope, complexity and flexibility), in cooperation with the cited http://www.backports.org repository techniques and apt pinnning.
http://wiki.debian.org/AptPinning

Regards.
Andre Felipe Machado
http://www.techforce.com.br

Hello,
A second look at the problem, and thinking more about using
http://packages.debian.org/lenny/dpkg-repack
or
http://packages.debian.org/lenny/jablicator
I realized they should not be enough for the Virtualmin purposes and would create more maintenance work in the future, despite being simpler for beginners.
A more flexible approach, and using official packages (leaving the security updates to Debian Project Team), could be using
http://packages.debian.org/stable/admin/pkgsync
and debconf preseeding
http://packages.debian.org/etch/debconf-utils
explained with examples at
http://www.techforce.com.br/news/linux_blog/oracle_10g_r2_in_debian_domu_into_debian_dom0
following documentation at
http://www.debian.org/doc/manuals/reference/ch-package.en.html#s-record
and still using the dpkg variable preconfiguration you alread use
http://www.debian.org/doc/manuals/reference/ch-package.en.html#s-apt-get-auto
leveragin debconf preseeding
http://packages.debian.org/etch/debconf-utils
explained at
http://www.techforce.com.br/news/linux_blog/massive_installation_management_tools_p_2
I guess creating metapackages with Debian Pure Blend tools could be an overkill for this problem and too complex to manage for pre-installed systems with unknown set of installed packages. But maybe after carefull investigation, could be the solution needed…
Given that Virtualmin keeps own repository, you will still need http://www.backports.org repository techniques and already cited (with links)
Apt Pinning configurations.
http://wiki.debian.org/AptPinning
http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html
http://jaqque.sbih.org/kplug/apt-pinning.html
http://www.howtoforge.com/a-short-introduction-to-apt-pinning
http://www.besy.co.uk/debian/howto_setup_apt-pinning_so_you_can_install_specific_packages_from_unstable
http://backports.org/dokuwiki/doku.php?id=instructions
http://backports.org/dokuwiki/doku.php?id=faq
Beware of the magic number 1000. Using numbers a bit lower or a bit higher is tricky. Read the docs linked. The debian wiki is very good.

Regards.
Andre Felipe Machado
http://www.techforce.com.br

Hello,
By reading the
http://www.virtualmin.com/forums/help-home-for-newbies/cron-problems%3A-time-server-different.html
I saw that my system did not have ntpdate installed.
But as stated at
http://packages.debian.org/etch/ntpdate
It may be not enough for long term accuracy.
Should ntp be installed instead of ntpdate? What about the webmin commands?
One of them should be added as a package to be installed at install.sh.
Regards.
Andre Felipe Machado

Should ntp be installed instead of ntpdate?

Either one works. ntpdate sets it once and exits. If you run it via cron every day or every few hours, you’ll never drift more than a few milliseconds off (assuming your system isn’t crazy or broken). ntpdate is lighter weight, since it starts and then goes away when it’s done. This is probably preferable for most web servers where memory is the most precious resource.

What about the webmin commands?

Webmin uses ntpdate, and can optionally setup a cronjob for you.

One of them should be added as a package to be installed at install.sh.

I’m hesitant to add more dependencies to the install. It’s actually installed by default on some systems (and/or can be configured during install), and so if we did it it’d just kinda be redundant for those systems.

I dunno. I’ll think on it.

Good thread. I just added ntpdate a couple of days ago due to some errors I was receiving from cron. Ever since then my error log files have been completely clean. I just checked them and they are EMPTY! All without any manual configuration at all since running install.sh

Simply amazing. The only bad thing about it is that I’ll never learn to be a better administrator since Webmin/Virtualmin does everything for me that I need! I’d better make a new virtual machine and learn how to break/troubleshoot/repair my system. There have been worse things in life! :wink: