Bug 3444 - webmin is not properly configured by default
: webmin is not properly configured by default
Status: RESOLVED FIXED
Product: Mageia
Classification: Unclassified
Component: RPM Packages
: Cauldron
: All Linux
: Normal Severity: minor
: ---
Assigned To: Mageia Bug Squad
:
:
: MGA2TOO
:
: 7803
:
  Show dependency treegraph
 
Reported: 2011-11-25 05:46 CET by Alexandr Bezenkov
Modified: 2013-05-04 21:39 CEST (History)
10 users (show)

See Also:
Source RPM: webmin
CVE:


Attachments
webmin patch for mageia (956 bytes, patch)
2012-10-15 23:33 CEST, Derek Jennings
Details | Diff
script to fix webmin in mga1/2 (1.15 KB, text/plain)
2012-10-18 09:13 CEST, Derek Jennings
Details
net/mageia-linux-lib.pl (28.31 KB, text/plain)
2012-12-14 01:24 CET, Derek Jennings
Details

Description Alexandr Bezenkov 2011-11-25 05:46:01 CET
Description of problem:

Settings of modules Apache and MySQL are not correct for Apache and MySQL installations. By default settings of Webmin modules point to another directories.
For example:
httpd_path is /usr/local/bin/httpd in Webmin, while httpd is installed in /usr/sbin
Same for MySQL module: settings of the module points to another directories than MySQL installed to.
I suspect same thing is for all other modules. Of course it is not very big trouble as you may change settings in module config through Webmin, but this issue did not present in Mandriva 2010. By default modules config pointed to right directories.

Version-Release number of selected component (if applicable):

webmin-1.550-2.mga1.noarch.rpm
apache-base-2.2.17-4.mga1.i586.rpm
mysql-5.5.10-7.mga1.i586.rpm

How reproducible:


Steps to Reproduce:
1.Install modules listed above with all dependencies
2.Launch Webmin(by default https://localhost:10000)
3.Go to Servers tab and select Apache, webmin will say that httpd.conf file not found.

As I mentioned this issue did not present in Mandriva 2010.2. Everything pointed to right directories by default.
Comment 1 Manuel Hiebel 2011-11-25 08:51:20 CET
Hi, thanks for reporting this bug.
As there is no maintainer for this package I added the committers in CC.
Comment 2 Alexandr Bezenkov 2011-11-28 07:29:50 CET
Same issue for squid: after installation of squid you have to manually setup webmin module to be able to control squid through webmin :(
squid version 3.1.15-1.2.mga1
Comment 3 Manuel Hiebel 2012-01-31 22:54:03 CET
*** Bug 4363 has been marked as a duplicate of this bug. ***
Comment 4 Derek Jennings 2012-04-19 14:00:43 CEST
On looking at this problem I see it is caused because webmin does not recognise Mageia as a supported OS

The problem affects both Mageia 1 and Cauldron 

The problem is caused because Mageia does not appear in the file /usr/share/webmin/os_list.txt

Adding the lines
Mageia Linux			1	mandrake-linux	1	 `cat /etc/mageia-release 2>/dev/null` =~ /Mageia\s+release\s+1/i
Mageia Linux			2	mandrake-linux	2	 `cat /etc/mageia-release 2>/dev/null` =~ /Mageia\s+release\s+1/i


allows the postinstall script /usr/share/webmin/postinstall.sh  to detect Mageia correctly
Comment 5 Derek Jennings 2012-04-19 14:03:13 CEST
I forgot to add
To test the fix described in Comment 4

1/ Stop webmin service
2/ Delete the directory /etc/webmin
3/ Edit /usr/share/webmin/os_list.txt as in Comment 4
4/ Run the script /usr/share/webmin/postinstall.sh
5/ Start webmin
Comment 6 Derek Jennings 2012-04-19 15:21:52 CEST
Correction to the edit in Comment 4

Mageia Linux            1    mandrake-linux    1     `cat /etc/mageia-release
2>/dev/null` =~ /Mageia\s+release\s+1/i
Mageia Linux            2    mandrake-linux    2     `cat /etc/mageia-release
2>/dev/null` =~ /Mageia\s+release\s+2/i

Also even after this fix there is still another problem with webmin configuration.

When installing packages with webmin it tries to use the non existent 'main' repository.  For Mageia the repository should not be specified to allow installation from both 'core' and 'core_updates'

Editing /usr/share/webmin/software/urpmi-lib.pl

Change line 15 from
local $cmd = "urpmi --force --auto --media main";
to

local $cmd = "urpmi --force --auto";
Comment 7 claire robinson 2012-04-19 16:25:31 CEST
Specifying --media Core allows any Core media I think Derek.
Comment 8 Derek Jennings 2012-04-20 00:15:51 CEST
A user has confirmed in the forum this fix has worked for them, but the fields in os_list.txt  have to be separated by TABS not spaces.

https://forums.mageia.org/en/viewtopic.php?f=7&t=2257#p16813
Comment 9 Marja van Waes 2012-05-26 13:03:51 CEST
Hi,

This bug was filed against cauldron, but we do not have cauldron at the moment.

Please report whether this bug is still valid for Mageia 2.

Thanks :)

Cheers,
marja
Comment 10 William Kenney 2012-05-26 16:00:31 CEST
I have changed the status of this bug to RESOLVED.

Thanks
Comment 11 Derek Jennings 2012-05-26 16:11:24 CEST
Are you sure William? It is still broken for me.
If you have pre existing /etc/webmin files it will work OK. 
It fails where there is no /etc/webmin before webmin is installed.
Comment 12 William Kenney 2012-05-26 17:28:28 CEST
(In reply to comment #11)
> Are you sure William? It is still broken for me.
> If you have pre existing /etc/webmin files it will work OK. 
> It fails where there is no /etc/webmin before webmin is installed.

The next few days I'm transferring my repos to
a new hard drive. When I'm finished with that
I do another new install and see how this plays.

Last install I did a couple days ago on Wed 23rd
it was ok.

More testing on my part.
Comment 13 Alexandr Bezenkov 2012-05-26 20:13:51 CEST
(In reply to comment #9)
> Hi,
> 
> This bug was filed against cauldron, but we do not have cauldron at the moment.
> 
> Please report whether this bug is still valid for Mageia 2.
> 
> Thanks :)
> 
> Cheers,
> marja

Yep, I can confirm that you need tambourine dancing from comments 4 and 5 to make webmin see configs of apache and mysql severs in Cauldron.
Comment 14 Derek Jennings 2012-05-27 01:34:16 CEST
Thanks Alexandr
Setting status to Reopened and version to Mageia 2
Comment 15 William Kenney 2012-05-28 00:10:43 CEST
Today I executed a complete from the
ground up install of Mageia 2. First
thing that got installed was webmin.
Here's what happened.

MCC -> Software Management -> Install & Remove Software
MCC: webmin

Application went in without a problem.
I immediately went to:

MCC -> System -> Manage system services

webmin is in fact listed as the last service
in this listing. On boot is not ticked and
webmin is stopped. Tick the On boot box
and click on Start. Webmin starts and is now
listed as running and opening a browser and
entering:

https://localhost:10000

Gets you the cert accept process and eventually
the webmin enter ID & PW page. Rebooting the
system webmin starts automatically.

This is the process that I am used to in Mandriva.
Same thing, I've just gotten used to going into

MCC -> System -> Manage system services

making the change and starting webmin. Is this
what we expect it to do? It's ok for me.
Comment 16 Derek Jennings 2012-05-28 00:43:49 CEST
re comment 15-  Starting webmin is not the problem. it is when you try to use specific webmin modules such as apache and mysql as described in the original bug report you realize it is broken.
Comment 17 William Kenney 2012-05-28 02:32:38 CEST
(In reply to comment #16)
> re comment 15-  Starting webmin is not the problem. it is when you try to use
> specific webmin modules such as apache and mysql as described in the original
> bug report you realize it is broken.

Got it, sorry.
Comment 18 Roberth Gianella 2012-10-15 16:43:57 CEST
Hey guys, can you make a script file to fix this problem, some newbies like me don't understand well hoy to fix it. Please!!!
Comment 19 Roberth Gianella 2012-10-15 21:15:10 CEST
Guys, i wrote to webmin to include mageia in the compatibility, and they ask me for some things that i don't understand, this is the email.


>>Sure .. I just need to know how to identify which Mageia version a system is running.

>>What does the /etc/issue file contain on your system? Also, how to Mageia versions relate to Mandriva versions?

please send this information to :
jcameron
notifications@github.com
Comment 20 claire robinson 2012-10-15 22:10:35 CEST
On Mageia it is /etc/release I think he will want.

$ cat /etc/release
Mageia release 2 (Official) for x86_64
Comment 21 Derek Jennings 2012-10-15 23:33:29 CEST
Created attachment 2950 [details]
webmin patch for mageia

patch to enable webmin to recognise a mageia installation

Should work with any release of mageia. Tested with Cauldron (Mageia 3 )
Comment 22 Derek Jennings 2012-10-15 23:50:43 CEST
I have emailed the webmin project with this information

Hi

I think you have been in contact with one of my fellow Mageia users Roberth Gianella regarding getting webmin to recognise a mageia OS.

In answer to your questions  a Mageia OS can be identified by for example

$ cat /etc/mageia-release
Mageia release 2 (Official) for x86_64

$ cat /etc/issue
Mageia release 2 (Official) for x86_64
Kernel 3.3.8-desktop-2.mga2 on a 4-processor x86_64 / \l


As far as webmin is concerned it can be treated the same as mandrake-linux

I attach a patch for os_list.txt which I have tested with current Mageia releases and seems to work OK

Thanks for your help

Derek Jennings
Comment 23 Derek Jennings 2012-10-18 09:13:00 CEST
Created attachment 2962 [details]
script to fix webmin in mga1/2

Roberth
You asked for a script to fix webmin for you.
Here it is.  Download this script, save it as mageia_webmin.sh
Open a terminal, use su to become root user, then cd to the download directory
Make the script executable with
chmod +x mageia_webmin.sh
Then give the command
sh mageia_webmin.sh

Webmin should then work OK and you will see the Operating System in the webmin welcome page is Mageia Linux
Comment 24 Derek Jennings 2012-10-24 09:50:37 CEST
webmin Git has been updated to support Mageia

https://github.com/webmin/webmin/commit/1fde465a42b17278f5b6e5b647907f47538bdacd
Comment 25 Anne Nicolas 2012-10-24 09:52:05 CEST
Wrongly... It's Mageia not Mageia Linux
Comment 26 David Walser 2012-12-12 22:18:07 CET
Should be fixed in webmin-1.610-1.mga3.  Please confirm.
Comment 27 William Kenney 2012-12-12 23:21:44 CET
(In reply to comment #26)
> Should be fixed in webmin-1.610-1.mga3.  Please confirm.

I can confirm that my testing today of M3B1 prerelease ISO's
that webmin installed and started correctly. Also working
after reboot. Many thanks for your efforts.
Comment 28 David Walser 2012-12-13 00:03:51 CET
Is it running webmin-1.610-1.mga3?  Can you confirm it fixes the Apache and MySQL modules that people were complaining about not working?
Comment 29 William Kenney 2012-12-13 00:57:01 CET
Hold the phone, I tried it again and it wouldn't start.
I'm trying the i586 32-bit version as my 64-bit machine
is off for now. I'll put some time into this tomorrow.
The MCC is saying version 1.550-2.mga1. At least on
this 32-bit install.
Comment 30 David Walser 2012-12-13 01:12:45 CET
You will need to make sure you have enabled the repositories and installed the updates to get the updated package.
Comment 31 William Kenney 2012-12-13 01:31:40 CET
Sorry, somehow I did get my repos messed up. I updated my local
repo from mirrors.kernel.org then updated my M3B1 i586 32-bit
test install against that and sure enough it updated to
webmin-1.610-1.mga3 and started just fine.

I'm looking for the Apache and MySQL modules and can't find
them. Apache used to be in the servers section. Where would
you expect them to be?
Comment 32 Derek Jennings 2012-12-13 01:50:04 CET
You have to use the search box to find apache and mysql servers. I do not know why they do not appear in the list of servers. This new layout does not seem to be very user friendly :-(

I can confirm that webmin-1.610-1.mga3  works as expected.  It recognises the Mageia Operating system.
As for the apache and mysql servers, it is not possible to use webmin to install the packages because of 
a/ the package names have changed, apache instead of apache2, and mariadb instead of mysql
b/ webmin still tries to download from a repository called 'main' as for Mandriva
See Comment 6

If I use mcc to install apache  using drakwizard to set up the server, then webmin can control the apache server OK. The problems reported in Comment 1 are not present.

If I install mariadb with mcc then webmin can control mariadb OK without the problems mentioned in Comment 1
Comment 33 Derek Jennings 2012-12-13 01:55:05 CET
The mystery of apache and mysql not showing in the list of servers is resolved.
The server list only shows installed servers. If apache and mariadb are not installed they do not appear in the list. Click on 'Refresh modules' at the bottom and it will rescan for installed servers.
Comment 34 William Kenney 2012-12-13 02:03:23 CET
Tried the "Refresh modules" thing and that didn't
put the apache and mysql modules in. I'll try this
again tomorrow. I've always installed webmin first
before apache and proftp. I'll reverse the process
tomorrow and see what happens.

Thanks.
Comment 35 Derek Jennings 2012-12-13 02:42:58 CET
William. The servers have to be installed first with MCC before webmin will find them.

David. I have found one serious problem with webmin-1.610-1.mga3 which will have to be fixed.

When I first installed webmin the webmin server started OK, but after a reboot webmin server would not start. The log contained an error message about 
"/var/run/webmin/miniserv.pid does not exist"

On checking I found the /var/run/webmin directory did not exist.  I created the directory and then webmin started OK, but then on the next reboot /var/run/webmin was missing again.  I have not yet worked out what is deleting the directory.


Another minor issue is that webmin is unable to start and stop the apache server because apache is now fully a systemctl service.
Comment 36 Derek Jennings 2012-12-13 03:06:40 CET
OK The problem with starting webmin is because /run is a tmpfs in mageia 3
We will have to create the /var/run/webmin directory on starting webmin. 

If we add a line to /etc/webmin/start  near the start

if [ ! -d /var/run/webmin ]; then mkdir /var/run/webmin ; fi

that works OK.
Comment 37 David Walser 2012-12-13 03:19:04 CET
(In reply to comment #36)
> OK The problem with starting webmin is because /run is a tmpfs in mageia 3
> We will have to create the /var/run/webmin directory on starting webmin. 
> 
> If we add a line to /etc/webmin/start  near the start
> 
> if [ ! -d /var/run/webmin ]; then mkdir /var/run/webmin ; fi
> 
> that works OK.

systemd has a way of handling that.  I think there's a tmpfiles.d directory that you drop a file into saying what directory to create and the permissions.

Maybe Colin can help us.

Is this something that would affect Mageia 2?
Comment 38 David Walser 2012-12-13 03:19:59 CET
(In reply to comment #35)
> Another minor issue is that webmin is unable to start and stop the apache
> server because apache is now fully a systemctl service.

That's strange.  Even if it's using the old "service" command, that should still work.  Do you have any idea why it isn't working or what it's doing?
Comment 39 David Walser 2012-12-13 03:21:21 CET
(In reply to comment #32)
> You have to use the search box to find apache and mysql servers. I do not know
> why they do not appear in the list of servers. This new layout does not seem to
> be very user friendly :-(
> 
> I can confirm that webmin-1.610-1.mga3  works as expected.  It recognises the
> Mageia Operating system.
> As for the apache and mysql servers, it is not possible to use webmin to
> install the packages because of 
> a/ the package names have changed, apache instead of apache2, and mariadb
> instead of mysql
> b/ webmin still tries to download from a repository called 'main' as for
> Mandriva
> See Comment 6
> 
> If I use mcc to install apache  using drakwizard to set up the server, then
> webmin can control the apache server OK. The problems reported in Comment 1 are
> not present.
> 
> If I install mariadb with mcc then webmin can control mariadb OK without the
> problems mentioned in Comment 1

The package names and repository name should be easy enough to fix.

Derek, do you think you could find where these are hardcoded in the code and whip up a patch?
Comment 40 Derek Jennings 2012-12-13 03:24:07 CET
(In reply to comment #38)
> (In reply to comment #35)
> > Another minor issue is that webmin is unable to start and stop the apache
> > server because apache is now fully a systemctl service.
> 
> That's strange.  Even if it's using the old "service" command, that should
> still work.  Do you have any idea why it isn't working or what it's doing?

It is attempting to use /etc/rc.d/init.d/httpd which does not exist
Comment 41 Derek Jennings 2012-12-13 03:26:02 CET
>Derek, do you think you could find where these are hardcoded in the code and
>whip up a patch?

Sure thing. Give me a day or two. Time for sleep now.
Comment 42 William Kenney 2012-12-13 20:52:34 CET
I can confirm that installing Webmin after Apache
and ProFTP are installed that Webmin installs those
two modules. Thanks
Comment 43 David Walser 2012-12-13 21:01:53 CET
(In reply to comment #39)
> (In reply to comment #32)
> > You have to use the search box to find apache and mysql servers. I do not know
> > why they do not appear in the list of servers. This new layout does not seem to
> > be very user friendly :-(
> > 
> > I can confirm that webmin-1.610-1.mga3  works as expected.  It recognises the
> > Mageia Operating system.
> > As for the apache and mysql servers, it is not possible to use webmin to
> > install the packages because of 
> > a/ the package names have changed, apache instead of apache2, and mariadb
> > instead of mysql
> > b/ webmin still tries to download from a repository called 'main' as for
> > Mandriva
> > See Comment 6
> > 
> > If I use mcc to install apache  using drakwizard to set up the server, then
> > webmin can control the apache server OK. The problems reported in Comment 1 are
> > not present.
> > 
> > If I install mariadb with mcc then webmin can control mariadb OK without the
> > problems mentioned in Comment 1
> 
> The package names and repository name should be easy enough to fix.
> 
> Derek, do you think you could find where these are hardcoded in the code and
> whip up a patch?

OK these issues should be fixed in webmin-1.610-2.mga3.
Comment 44 David Walser 2012-12-13 21:02:22 CET
(In reply to comment #40)
> (In reply to comment #38)
> > (In reply to comment #35)
> > > Another minor issue is that webmin is unable to start and stop the apache
> > > server because apache is now fully a systemctl service.
> > 
> > That's strange.  Even if it's using the old "service" command, that should
> > still work.  Do you have any idea why it isn't working or what it's doing?
> 
> It is attempting to use /etc/rc.d/init.d/httpd which does not exist

Oh my.  That will not be easy to fix!
Comment 45 Derek Jennings 2012-12-13 21:08:06 CET
(In reply to comment #44)
> (In reply to comment #40)
> > (In reply to comment #38)
> > > (In reply to comment #35)
> > > > Another minor issue is that webmin is unable to start and stop the apache
> > > > server because apache is now fully a systemctl service.
> > > 
> > > That's strange.  Even if it's using the old "service" command, that should
> > > still work.  Do you have any idea why it isn't working or what it's doing?
> > 
> > It is attempting to use /etc/rc.d/init.d/httpd which does not exist
> 
> Oh my.  That will not be easy to fix!

Actually it is quite easy. I have created a set of Mageia specific configuration files for each module. The files dictate the method used to start and stop the service. Where systemctl is supported in both mga2 and mga3 the config file specifies systemctl. For those modules not supporting systemctl the config file uses the service command.
I am just testing it all out at the moment and should have a patch for you by tomorrow.
Comment 46 David Walser 2012-12-13 22:42:15 CET
Thanks Derek.

I have a question for you.  When you first installed the package, what are the ownership and permissions of the /var/run/webmin directory that got created automatically?
Comment 47 David Walser 2012-12-13 22:45:54 CET
(In reply to comment #45)
> (In reply to comment #44)
> > (In reply to comment #40)
> > > (In reply to comment #38)
> > > > (In reply to comment #35)
> > > > > Another minor issue is that webmin is unable to start and stop the apache
> > > > > server because apache is now fully a systemctl service.
> > > > 
> > > > That's strange.  Even if it's using the old "service" command, that should
> > > > still work.  Do you have any idea why it isn't working or what it's doing?
> > > 
> > > It is attempting to use /etc/rc.d/init.d/httpd which does not exist
> > 
> > Oh my.  That will not be easy to fix!
> 
> Actually it is quite easy. I have created a set of Mageia specific
> configuration files for each module. The files dictate the method used to start
> and stop the service. Where systemctl is supported in both mga2 and mga3 the
> config file specifies systemctl. For those modules not supporting systemctl the
> config file uses the service command.
> I am just testing it all out at the moment and should have a patch for you by
> tomorrow.

Actually everything should work with systemctl when running under systemd, but alternatively, everything should work with the service command all the time.

Do you think doing this in the webmin directory would work?

perl -pi -e 's|/etc/(rc.d/)*init.d/([^ ]*)|service \2|g' */config-mandrake-linux */config-\*-linux net/mandrake-linux-lib.pl
Comment 48 Derek Jennings 2012-12-13 23:17:35 CET
>Do you think doing this in the webmin directory would work?

>perl -pi -e 's|/etc/(rc.d/)*init.d/([^ ]*)|service \2|g'
>*/config-mandrake-linux */config-\*-linux net/mandrake-linux-lib.pl

No. Several of the mandrake config files are out of date and do not actually work. We could fix them in the spec file, but after looking at how many needed work I concluded it was simpler to define a new OS called mageia-linux and provide config files specifically for mageia. We then do not have to worry about what Mandriva might do in the future. The same files can be provided upstream

>I have a question for you.  When you first installed the package, what are the
>ownership and permissions of the /var/run/webmin directory that got created
>automatically?

root bin 0700

So we need something like
if [ ! -x /usr/lib/tmpfiles.d/webmin ]; then
    echo "d /var/run/webmin 0700 root bin -" > /usr/lib/tmpfiles.d/webmin
fi

in %post
Comment 49 Derek Jennings 2012-12-13 23:41:24 CET
David - Here is the patch I came up with to fix the outstanding issues in webmin. I have provided it as a src.rpm so I could check it worked.

https://dl.dropbox.com/u/285824/webmin-1.610-2dj2.src.rpm


Changes are
Patch41:	webmin-urpmi-lib.patch  - fixes issues with installing package with urpmi

Patch42:	webmin-urpmi_upgrade.patch - fixes issues with upgrading packages with urpmi

Patch43:	webmin-os_list.patch  - allows webmin to detect mageia as mageia-linux OS and to use the mageia config files

Source16:	webmin-mageia-config.tar.bz2  - Contains a config file for modules that need mageia customisation

Spec file  - Removed some lines that edited files now covered by Source16
Removed some modules not supported in mageia
Added a file to tmpfiles.d

Some modules that did not work in mandriva such as grub now work OK.
Comment 50 David Walser 2012-12-13 23:48:21 CET
(In reply to comment #48)
> >Do you think doing this in the webmin directory would work?
> 
> >perl -pi -e 's|/etc/(rc.d/)*init.d/([^ ]*)|service \2|g'
> >*/config-mandrake-linux */config-\*-linux net/mandrake-linux-lib.pl
> 
> No. Several of the mandrake config files are out of date and do not actually
> work. We could fix them in the spec file, but after looking at how many needed
> work I concluded it was simpler to define a new OS called mageia-linux and
> provide config files specifically for mageia. We then do not have to worry
> about what Mandriva might do in the future. The same files can be provided
> upstream

Ahh, cool.  So I guess you had to edit their OS definition in os_list.txt so it would use its own set of files instead of using the mandrake ones.  I'll commit your patch once you have it ready.  That'd be great to have upstreamed.

In the meantime, I fixed the service names it uses to stop/start the nfs, mysql, and pptp services:
http://svnweb.mageia.org/packages/cauldron/webmin/current/SOURCES/webmin-1.610-service-names.patch?revision=330513&view=markup

I also fixed the urpmi issues (looking for main, wrong package names):
http://svnweb.mageia.org/packages/cauldron/webmin/current/SOURCES/webmin-1.610-urpmi.patch?revision=330411&view=markup

> >I have a question for you.  When you first installed the package, what are the
> >ownership and permissions of the /var/run/webmin directory that got created
> >automatically?
> 
> root bin 0700
> 
> So we need something like
> if [ ! -x /usr/lib/tmpfiles.d/webmin ]; then
>     echo "d /var/run/webmin 0700 root bin -" > /usr/lib/tmpfiles.d/webmin
> fi
> 
> in %post

That's the idea.  Here's how I did it:
http://svnweb.mageia.org/packages/cauldron/webmin/current/SPECS/webmin.spec?r1=330513&r2=330549

Let's see if it works :o)  webmin-1.610-3.mga3 should be up soon.
Comment 51 David Walser 2012-12-13 23:58:56 CET
(In reply to comment #49)
> David - Here is the patch I came up with to fix the outstanding issues in
> webmin. I have provided it as a src.rpm so I could check it worked.
> 
> https://dl.dropbox.com/u/285824/webmin-1.610-2dj2.src.rpm
> 
> 
> Changes are
> Patch41:    webmin-urpmi-lib.patch  - fixes issues with installing package with
> urpmi
> 
> Patch42:    webmin-urpmi_upgrade.patch - fixes issues with upgrading packages
> with urpmi
> 
> Patch43:    webmin-os_list.patch  - allows webmin to detect mageia as
> mageia-linux OS and to use the mageia config files
> 
> Source16:    webmin-mageia-config.tar.bz2  - Contains a config file for modules
> that need mageia customisation
> 
> Spec file  - Removed some lines that edited files now covered by Source16
> Removed some modules not supported in mageia
> Added a file to tmpfiles.d
> 
> Some modules that did not work in mandriva such as grub now work OK.

Cool, thanks.  Taking a look now.
Comment 52 David Walser 2012-12-14 00:19:16 CET
Derek, do you have anything to fix these?
firewall/mandrake-linux-lib.pl
net/mandrake-linux-lib.pl
Comment 53 Derek Jennings 2012-12-14 00:32:04 CET
(In reply to comment #52)
> Derek, do you have anything to fix these?
> firewall/mandrake-linux-lib.pl
> net/mandrake-linux-lib.pl

Not yet. I had not noticed those ones. I will check them out
Comment 54 David Walser 2012-12-14 00:42:02 CET
(In reply to comment #52)
> Derek, do you have anything to fix these?
> firewall/mandrake-linux-lib.pl
> net/mandrake-linux-lib.pl

Also to replace these two:
openvpn/config-*-linux
pptp-server/config-mandrake-linux
Comment 55 Derek Jennings 2012-12-14 01:08:13 CET
We do not need to worry about pptp-server/config-mandrake-linux  It is not available in mageia. We should remove the module.

As for openvpn I came up with this

openvpn/config-mageia-linux

openvpn_home=/etc/openvpn
openvpn_clients_subdir=clients
openvpn_servers_subdir=servers
openvpn_path=/usr/sbin/openvpn
openvpn_keys_subdir=keys
openvpn_pid_path=/var/run
openvpn_version=2.0_rc16
openssl_home=/usr/share/webmin/openvpn/openvpn-ssl.cnf
openssl_path=/usr/bin/openssl
openssl_version=0.9.7e
start_cmd=/bin/systemctl start openvpn.service
stop_cmd=/bin/systemctl stop openvpn.service
br_start_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_start
br_end_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_end
down_root_plugin=/usr/lib/openvpn/openvpn-down-root.so
zip_cmd=/usr/bin/zip
log_lines=200


I have not tested it, and it probably will not work.
The line openssl_home=/usr/share/webmin/openvpn/openvpn-ssl.cnf is supposed to point to a config file in /etc, but that file does not exist in any package other than webmin

The line down_root_plugin=/usr/lib/openvpn/openvpn-down-root.so
I have set to point to the only file where this library exists, but what happens on a 64 bit machine. It will need /usr/lib64/openvpn/openvpn-down-root.so

But since this module clearly does not work in mandriva either at least it is not a regression :-)
Comment 56 David Walser 2012-12-14 01:20:59 CET
(In reply to comment #48)
> >Do you think doing this in the webmin directory would work?
> 
> >perl -pi -e 's|/etc/(rc.d/)*init.d/([^ ]*)|service \2|g'
> >*/config-mandrake-linux */config-\*-linux net/mandrake-linux-lib.pl
> 
> No. Several of the mandrake config files are out of date and do not actually
> work. We could fix them in the spec file, but after looking at how many needed
> work I concluded it was simpler to define a new OS called mageia-linux and
> provide config files specifically for mageia. We then do not have to worry
> about what Mandriva might do in the future. The same files can be provided
> upstream

Hmm, it looks like the only ones you changed were syslog, grub, and sshd.

I've just added fixes for these to the package, and did the perl command to substitute the service command for init.d scripts.

Let's see how webmin-1.610-4.mga3 works.
Comment 57 Derek Jennings 2012-12-14 01:24:25 CET
Created attachment 3241 [details]
net/mageia-linux-lib.pl

Here is the fix for /net

It is also necessary to edit net/module.info to create an entry with a line 

os_support=solaris coherent-linux redhat-linux mageia-linux mandrake-linux united-linux suse-linux/6.0-* open-linux unixware
 turbo-linux/4.0 freebsd/3.2-* openbsd debian-linux/2.2-* cobalt-linux/2.2-* msc-linux gentoo-linux macos/1.5-* trustix-linu
x slackware-linux/8.0-* openmamba-linux cygwin windows pardus-linux


previously there was a version number attached to the mageia-linux entry
Comment 58 David Walser 2012-12-14 01:25:19 CET
(In reply to comment #55)
> We do not need to worry about pptp-server/config-mandrake-linux  It is not
> available in mageia. We should remove the module.
> 
> As for openvpn I came up with this
> 
> openvpn/config-mageia-linux
> 
> openvpn_home=/etc/openvpn
> openvpn_clients_subdir=clients
> openvpn_servers_subdir=servers
> openvpn_path=/usr/sbin/openvpn
> openvpn_keys_subdir=keys
> openvpn_pid_path=/var/run
> openvpn_version=2.0_rc16
> openssl_home=/usr/share/webmin/openvpn/openvpn-ssl.cnf
> openssl_path=/usr/bin/openssl
> openssl_version=0.9.7e
> start_cmd=/bin/systemctl start openvpn.service
> stop_cmd=/bin/systemctl stop openvpn.service
> br_start_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_start
> br_end_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_end
> down_root_plugin=/usr/lib/openvpn/openvpn-down-root.so
> zip_cmd=/usr/bin/zip
> log_lines=200
> 
> 
> I have not tested it, and it probably will not work.
> The line openssl_home=/usr/share/webmin/openvpn/openvpn-ssl.cnf is supposed to
> point to a config file in /etc, but that file does not exist in any package
> other than webmin
> 
> The line down_root_plugin=/usr/lib/openvpn/openvpn-down-root.so
> I have set to point to the only file where this library exists, but what
> happens on a 64 bit machine. It will need
> /usr/lib64/openvpn/openvpn-down-root.so
> 
> But since this module clearly does not work in mandriva either at least it is
> not a regression :-)

Hmm, yep that one needs some fixing for sure.  Does this work?

openvpn_home=/etc/openvpn
openvpn_clients_subdir=clients
openvpn_servers_subdir=servers
openvpn_path=/usr/sbin/openvpn
openvpn_keys_subdir=keys
openvpn_pid_path=/var/run
openvpn_version=2.2.2
openssl_home=/usr/share/openvpn/easy-rsa/2.0/openssl-1.0.0.cnf
openssl_path=/usr/bin/openssl
openssl_version=1.0.1c
start_cmd=/etc/init.d/openvpn start
stop_cmd=/etc/init.d/openvpn stop
br_start_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_start
br_end_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_end
down_root_plugin=/usr/lib/openvpn/openvpn-down-root.so
zip_cmd=/usr/bin/zip
log_lines=200
Comment 59 David Walser 2012-12-14 01:28:58 CET
(In reply to comment #57)
> Created attachment 3241 [details]
> net/mageia-linux-lib.pl
> 
> Here is the fix for /net
> 
> It is also necessary to edit net/module.info to create an entry with a line 
> 
> os_support=solaris coherent-linux redhat-linux mageia-linux mandrake-linux
> united-linux suse-linux/6.0-* open-linux unixware
>  turbo-linux/4.0 freebsd/3.2-* openbsd debian-linux/2.2-* cobalt-linux/2.2-*
> msc-linux gentoo-linux macos/1.5-* trustix-linu
> x slackware-linux/8.0-* openmamba-linux cygwin windows pardus-linux
> 
> 
> previously there was a version number attached to the mageia-linux entry

I don't think these changes are necessary with the current version of the package.  Please confirm that it works OK.
Comment 60 David Walser 2012-12-14 01:34:57 CET
(In reply to comment #55)
> We do not need to worry about pptp-server/config-mandrake-linux  It is not
> available in mageia. We should remove the module.

I think the pptp-linux package in Mageia is associated with this.
Comment 61 Derek Jennings 2012-12-14 01:39:46 CET
>Hmm, it looks like the only ones you changed were syslog, grub, and sshd.

And apache bind8 dhcpd exports ldap-server mysql openslp postgresql proftpd
samba sendmail squid syslog xinetd

in most cases the change is to use either service or systemctl to start the
service instead of /etc/rc.d/init.d  which is not always available in mga3


>> We do not need to worry about pptp-server/config-mandrake-linux  It is not
>> available in mageia. We should remove the module.

>I think the pptp-linux package in Mageia is associated with this.
I think pptp-linux is the client
Comment 62 David Walser 2012-12-14 01:54:06 CET
(In reply to comment #61)
> >Hmm, it looks like the only ones you changed were syslog, grub, and sshd.
> 
> And apache bind8 dhcpd exports ldap-server mysql openslp postgresql proftpd
> samba sendmail squid syslog xinetd
> 
> in most cases the change is to use either service or systemctl to start the
> service instead of /etc/rc.d/init.d  which is not always available in mga3

I meant changes other than the init.d thing, which my perl command takes care of.

> >> We do not need to worry about pptp-server/config-mandrake-linux  It is not
> >> available in mageia. We should remove the module.
> 
> >I think the pptp-linux package in Mageia is associated with this.
> I think pptp-linux is the client

It has /etc/rc.d/init.d/pptp in it...
Comment 63 Derek Jennings 2012-12-14 01:55:18 CET
Testing webmin-1.610-4.mga3 on mga3beta1

Package installs OK
webmin installs apache package OK
webmin cannot start apacher server /etc/rc.d/init.d/httpd No such file
webmin cannot start mysqld
webmin cannot stop sshd
software updates works
webmin cannot start syslog
shorewall firewall works OK
proftp server installs ok
proftp server starts OK
postgresql does not start
dhcpd server installs Ok
dhcpd server does not start
Comment 64 Derek Jennings 2012-12-14 01:56:58 CET
Actually that was webmin-1.610-3.mga3 I was testing webmin-1.610-4.mga3 has not hit the mirror yet
Comment 65 Colin Guthrie 2012-12-14 10:17:19 CET
(In reply to comment #50)
> (In reply to comment #48)

> > So we need something like
> > if [ ! -x /usr/lib/tmpfiles.d/webmin ]; then
> >     echo "d /var/run/webmin 0700 root bin -" > /usr/lib/tmpfiles.d/webmin
> > fi
> > 
> > in %post

I know this isn't the exact approach used, but just for future reference, if the file is *shipped* in the spec file (i.e. listed in a %files section), then the directory should be /usr/lib/tmpfiles.d as noted above.

But if the file is created at runtime by and administrator or a process that is run by an administrator, then you should use /etc/tmpfiles.d/ (you can also provide a file in /etc/tmpfiles.d of the same name as a file in /usr/lib/tmpfiles.d and it will override it).


> That's the idea.  Here's how I did it:
> http://svnweb.mageia.org/packages/cauldron/webmin/current/SPECS/webmin.spec?r1=330513&r2=330549
> 
> Let's see if it works :o)  webmin-1.610-3.mga3 should be up soon.

This looks good, but there are a couple bits needed still.

See https://wiki.mageia.org/en/System_Service_policy

When providing a tmpfiles.d snippet you should also ensure to run the %_tmpfilescreate macro in %post.

This will ensure that on first install, the folder is created immediately.

Also because of upgrades, you should really make the tmpfile start with "d" rather than "D" otherwise upgrading webmin (with the %_tmpfilescreate macro in place) would wipe any files in /run/webmin.

Hope this helps.
Comment 66 Derek Jennings 2012-12-14 11:21:46 CET
OK now testing with webmin-1.610-4.mga3 on mga3

Apache now starts and stops OK - good job

mariaddb still does not start - The config file is called config-mandrake-linux-10.1  It will need to be renamed before applying your line of perl


sshd does not start either - Your line of perl has modified config-mandrake-linux OK, but there is another config file called config-mandrake-linux-7.1 which takes precedence

proftp OK

postgresql does not start - According to the log it is because the configuration file does not exist. I think this is a problem with postgresql not starting "out of the box" rather than a webmin problem


dhcpd server OK  The out of the box config for dhcpd does not allow the service to start, but once it was configured it worked OK

shorewall OK
Comment 67 Derek Jennings 2012-12-14 11:42:04 CET
The issue with other mandrake config files with a numerical suffix taking precedence also affects bind8 lpadmin mysql samba sendmail  and sshd
Comment 68 Derek Jennings 2012-12-14 13:40:14 CET
(In reply to comment #62)
> 
> > >> We do not need to worry about pptp-server/config-mandrake-linux  It is not
> > >> available in mageia. We should remove the module.
> > 
> > >I think the pptp-linux package in Mageia is associated with this.
> > I think pptp-linux is the client
> 
> It has /etc/rc.d/init.d/pptp in it...

But it does not have /etc/rc.d/init.d/pptpd
http://linux.die.net/man/8/pptp
Comment 69 David Walser 2012-12-14 17:05:32 CET
(In reply to comment #67)
> The issue with other mandrake config files with a numerical suffix taking
> precedence also affects bind8 lpadmin mysql samba sendmail  and sshd

Well that's unintuitive, but I'm really glad you caught that.

It actually looks like there are some corrections in the numerical suffix ones vs. the ones without them and the mageia-linux configs you made based on those.

See the chroot/pid_file in bind8, driver_style/model_path in lpadmin, and smb_passwd in samba lines.

(In reply to comment #68)
> But it does not have /etc/rc.d/init.d/pptpd
> http://linux.die.net/man/8/pptp

OK, looks like you're right then. I've removed the pptp-server module.

I also made the changes to the tmpfiles config based on Colin's suggestions.

Let's see how webmin-1.610-5.mga3 does.
Comment 70 Derek Jennings 2012-12-14 18:47:42 CET
Yay    webmin-1.610-5.mga3  is really good!!

Everything I have tried works with one very small (and possibly insignificant) exception.

The iptables module does not work because the file firewall/mandrake-linux-lib.pl tests for the presence of, and makes use of /etc/rc.d/init.d/iptables  which is not present in mga3, but is in mga2.

I would not mind if you decided not to fix this because mageia uses shorewall by default, and the shorewall module works OK.

Thanks for the effort you have put in on this David.  Webmin is in pretty good shape now :-)
Comment 71 David Walser 2012-12-14 18:57:30 CET
I couldn't have done it without your help Derek, thank you!

BTW, the iptables module actually is fixed in the SPEC, but it won't be fixed in the package until the mass rebuild.  Once that happens, %{_libexecdir} is changing from /usr/lib and /usr/lib64 to /usr/libexec, and when webmin gets rebuilt, the references to /etc/rc.d/init.d/iptables will get changed automatically to /usr/libexec/iptables.init, which is where the old SysV init script that the firewall/mandrake-linux-lib.pl depends on will be installed.
Comment 72 David Walser 2012-12-14 19:15:35 CET
(In reply to comment #58)
> (In reply to comment #55)
> > We do not need to worry about pptp-server/config-mandrake-linux  It is not
> > available in mageia. We should remove the module.
> > 
> > As for openvpn I came up with this
> > 
> > openvpn/config-mageia-linux
> > 
> > openvpn_home=/etc/openvpn
> > openvpn_clients_subdir=clients
> > openvpn_servers_subdir=servers
> > openvpn_path=/usr/sbin/openvpn
> > openvpn_keys_subdir=keys
> > openvpn_pid_path=/var/run
> > openvpn_version=2.0_rc16
> > openssl_home=/usr/share/webmin/openvpn/openvpn-ssl.cnf
> > openssl_path=/usr/bin/openssl
> > openssl_version=0.9.7e
> > start_cmd=/bin/systemctl start openvpn.service
> > stop_cmd=/bin/systemctl stop openvpn.service
> > br_start_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_start
> > br_end_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_end
> > down_root_plugin=/usr/lib/openvpn/openvpn-down-root.so
> > zip_cmd=/usr/bin/zip
> > log_lines=200
> > 
> > 
> > I have not tested it, and it probably will not work.
> > The line openssl_home=/usr/share/webmin/openvpn/openvpn-ssl.cnf is supposed to
> > point to a config file in /etc, but that file does not exist in any package
> > other than webmin
> > 
> > The line down_root_plugin=/usr/lib/openvpn/openvpn-down-root.so
> > I have set to point to the only file where this library exists, but what
> > happens on a 64 bit machine. It will need
> > /usr/lib64/openvpn/openvpn-down-root.so
> > 
> > But since this module clearly does not work in mandriva either at least it is
> > not a regression :-)
> 
> Hmm, yep that one needs some fixing for sure.  Does this work?
> 
> openvpn_home=/etc/openvpn
> openvpn_clients_subdir=clients
> openvpn_servers_subdir=servers
> openvpn_path=/usr/sbin/openvpn
> openvpn_keys_subdir=keys
> openvpn_pid_path=/var/run
> openvpn_version=2.2.2
> openssl_home=/usr/share/openvpn/easy-rsa/2.0/openssl-1.0.0.cnf
> openssl_path=/usr/bin/openssl
> openssl_version=1.0.1c
> start_cmd=/sbin/service openvpn start
> stop_cmd=/sbin/service openvpn stop
> br_start_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_start
> br_end_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_end
> down_root_plugin=/usr/lib/openvpn/openvpn-down-root.so
> zip_cmd=/usr/bin/zip
> log_lines=200

Derek, I haven't changed anything with the openvpn config yet.  Did you get a chance to test the config above?
Comment 73 Derek Jennings 2012-12-14 19:36:13 CET
(In reply to comment #72)
> openvpn_home=/etc/openvpn
> openvpn_clients_subdir=clients
> openvpn_servers_subdir=servers
> openvpn_path=/usr/sbin/openvpn
> openvpn_keys_subdir=keys
> openvpn_pid_path=/var/run
> openvpn_version=2.2.2
> openssl_home=/usr/share/openvpn/easy-rsa/2.0/openssl-1.0.0.cnf
> openssl_path=/usr/bin/openssl
> openssl_version=1.0.1c
> start_cmd=/sbin/service openvpn start
> stop_cmd=/sbin/service openvpn stop
> br_start_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_start
> br_end_cmd=/usr/share/webmin/openvpn/br_scripts/bridge_end
> down_root_plugin=/usr/lib/openvpn/openvpn-down-root.so
> zip_cmd=/usr/bin/zip
> log_lines=200
> Derek, I haven't changed anything with the openvpn config yet.  Did you get a
> chance to test the config above?

No.  This configuration looks OK to me, but I do not have any experience with openvpn and do not know how to test it. All the file paths look good.
Comment 74 David Walser 2012-12-14 21:47:44 CET
To anyone that's interested, webmin-1.610-1.mga2 has now been uploaded to core/updates_testing for Mageia 2.  Please help test and report your findings (good or bad) to Bug 7803.  Thanks.
Comment 75 Colin Guthrie 2012-12-14 22:16:34 CET
Just for reference regarding openvpn stuff; the openvpn setup is quite different under systemd.

Under mga3, you could easily do "systemctl [start|stop|restart] openvpn.target" (note the ".target" suffix rather than ".service").

Each openvpn connection can technically be dealt with interdependently but all are tied to the target. For every config in /etc/openvpn/*.conf, you would have an instance of a template unit "openvpn@myconf.service". Under mga3 you can enable this with "systemctl enable openvpn@myconf.service" but this wont work under mga2 (you have to create symlinks manually).

Hope that helps.
Comment 76 David Walser 2013-05-02 20:52:11 CEST
webmin-1.620-1.1.mga2 has finally been pushed as an update for Mageia 2,

All of these issues should be fixed (also in the Cauldron package).

Derek, who did you contact when you were submit changes upstream?

One minor fix I made while updating this the last time should be upstreamed.

In os_list.txt, the second field for the Mageia line should be $1, not $2.

I currently have it patched to fix this.  Also, Anne said it should say Mageia,
not Mageia Linux (current patch doesn't address this).
Comment 77 Derek Jennings 2013-05-04 19:07:46 CEST
(In reply to David Walser from comment #76)
> 
> Derek, who did you contact when you were submit changes upstream?
> 


Jamie Cameron
jcameron at webmin.com
Comment 78 David Walser 2013-05-04 21:39:13 CEST
Thanks.  I sent the following e-mail to him.

Hello,

In os_list.txt, the second field for the Mageia line should be $1, not $2.  Also, technically the name of the distro is "Mageia" and not "Mageia Linux."

Mageia has some patches in their package, at least some of which should probably be upstreamed, you can see all of them here:
http://svnweb.mageia.org/packages/cauldron/webmin/current/SOURCES/

Note that svnweb won't be accessible this weekend as the servers are being moved.  Some notes on the patches you'll find there are below.

Correct not only for Mageia, but Mandriva back to at least 2009.0 and probably much farther, should be good for upstream:
webmin-1.610-service-names.patch
webmin-fix-sarg.diff

Same as above, although the mysql line should simply be removed:
webmin-1.610-urpmi.patch

Correct only for Mandriva 2010.1 and newer:
webmin-1.610-syslog.patch

These add configs for some modules:
webmin-0.92-add-default-configs-logviewer-fp2k.patch
webmin-0.950-add-netsaint-mandrake-config.patch
webmin-grub-config (copy to grub/config-mandrake-linux)

Probably a better way to handle this upstream, but it should be correct for Mageia/Mandriva and Fedora at the least:
webmin-1.020-ssl-location.patch

Not sure exactly what these ones do, but might be of interest:
webmin-0.85-enable-changed-theme-at-installation.patch
webmin-1.100-let-localauth-config.patch
webmin-1.220-usermin-fix-index.patch
webmin-fix-bandwith.diff
webmin-fix-newmods.patch
webmin-temp-permission-fix.diff

Probably not upstreamable, but might be fixable upstream:
webmin-1.220-remove-mandrakestuff-from-init.patch
webmin-1.610-remove-atboot-problem
webmin-ssldir-cosmetic.diff

Not upstreamable obviously, but looking around in the code, it looked like there's code for installing packages directly through a distro's package manager, as well as code to convert perl module names to perl module package names, yet there are a few places where webmin tries to download a perl module from CPAN.  Couldn't it instead install those through the distro package manager?
webmin-1.060-mysql-fix-installing-missing-packages.patch
webmin-1.610-postgresql-fix-installing-missing-packages.patch

Similar issue with usermin:
webmin-1.310-usermin-fix-installing-missing-package.diff

Not upstreamable:
webmin-0.85-never-fail-detect-os.patch

You can see how these patches and the other source files are used in the SPEC file, here:
http://svnweb.mageia.org/packages/cauldron/webmin/current/SPECS/webmin.spec?revision=410939&view=markup

There are also some perl substitution commands in the SPEC that make what should be appropriate changes for upstream as well, namely:
perl -pi -e 's|mandrake-linux|mageia mandrake-linux| if $_ =~ /^os_support.*mandrake-linux/ && $_ !~ /mageia/' */module.info
perl -pi -e 's|^cachemgr_path=.*$|cachemgr_path=/var/www/cgi-bin/cachemgr.cgi|g' squid/config-mandrake-linux*
perl -pi -e 's|/etc/(rc.d/)*init.d/([^ ]*)|/sbin/service \2|g' */config-mandrake-linux* */config-\*-linux net/mandrake-linux-lib.pl

That squid cachemgr change above is also appropriate at least back to Mandriva 2009.0.

Hopefully this is helpful.  Don't hesistate to ask if you have any questions.  Thanks.

Note You need to log in before you can comment on or make changes to this bug.