Difference between revisions of "Package:Webmin"

From Funtoo
Jump to navigation Jump to search
(Added OpenRC script to enable package to be controlled by openrc)
Line 83: Line 83:
# cp webmin /etc/init.d/
# cp webmin /etc/init.d/
# chmod +x /etc/ini.d/webmin
# chmod +x /etc/init.d/webmin
Next step is to add the service webmin to openrc:
Next step is to add the service webmin to openrc:

Latest revision as of 09:27, February 27, 2021



We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Webmin is a web-based interface for system administration on Unix and Linux systems.


Webmin uses Perl, so

root # emerge perl


There are 2 methods of installing Webmin on your Funtoo server: emerging it from the Gentoo ebuild or manual installation. By default Webmin installs itself in /etc/webmin.


Gentoo has version 1.730 in the repository so installing that is fairly straightforward:

root # emerge webmin

After installation Webmin needs to be started manually with the following command:

root # sh ./etc/webmin/start

Next, start a browser and go to the Webmin page at https://localhost:10000 if you accepted all default settings. Go to the Webmin configuration pages in the menu and tell Webmin to start at boot. Make sure you save the new settings!

Manual Installation

Although the 1.730 version offered by the Gentoo ebuild will suffice for most users, it does keeps nagging about a newer version available. Manually installing from the source tar ball resolves that, at least until the next release. ;-) Webmin has documented the process on their own wiki: http://doxfer.webmin.com/Webmin/Installation_-_the_old_fashioned_way

As above, start Webmin manually then ensure it does so from boot.

By default, when Webmin is installed directly from source, OpenRC doesn't know about it and thus, cannot control it. By adding a openrc boot-script to /etc/init.d/ openrc regains control over Webmin.

Create a text file, named webmin, then copy the following:


#depend () {
#	perl

start() {
	echo Starting Webmin server in /etc/webmin
	trap '' 1
	export LANG
	unset PERLIO
	export PERLIO
	export PERLLIB
	exec '/etc/webmin/miniserv.pl' $* /etc/webmin/miniserv.conf

restart() {
	/etc/webmin/stop --kill && /etc/webmin/start

stop() {
	echo Stopping Webmin server in /etc/webmin
	pidfile=`grep "^pidfile=" /etc/webmin/miniserv.conf | sed -e 's/pidfile=//g'`
	pid=`cat $pidfile`
	if [ "$pid" != "" ]; then
  	kill $pid || exit 1
  	touch /var/webmin/stop-flag
  	if [ "$1" = "--kill" ]; then
    	sleep 2
    	(kill -9 -- -$pid || kill -9 $pid) 2>/dev/null
  	exit 0
  	exit 1

Save the file. Copy or move the file to /etc/init.d/ then make it executable:

root # cp webmin /etc/init.d/
root # chmod +x /etc/init.d/webmin

Next step is to add the service webmin to openrc:

root # rc-update add webmin default

Now Webmin starts at boot, directly via OpenRC.



This section is in need of updates.