From 7548db3e85bd42a441ad72bfade53c6c2dda038d Mon Sep 17 00:00:00 2001 From: Ilia Date: Mon, 13 Jun 2022 22:28:26 +0300 Subject: [PATCH 1/7] Fix to remove `OOM` control --- usermin-systemd | 1 - 1 file changed, 1 deletion(-) diff --git a/usermin-systemd b/usermin-systemd index 8519cf05..c2ea0b0b 100644 --- a/usermin-systemd +++ b/usermin-systemd @@ -10,7 +10,6 @@ PIDFile=WEBMIN_VAR/miniserv.pid Type=forking Restart=always RestartSec=2s -OOMPolicy=kill [Install] WantedBy=multi-user.target From 4884a8eda62194d6673abd547add8ff07dcfd2c7 Mon Sep 17 00:00:00 2001 From: Ilia Date: Wed, 15 Jun 2022 01:16:55 +0300 Subject: [PATCH 2/7] Fix Usermin `systemd` issues too --- setup.sh | 4 ++++ updateboot.pl | 2 +- usermin-systemd | 9 +++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index e942a945..0bca6691 100755 --- a/setup.sh +++ b/setup.sh @@ -69,6 +69,10 @@ else fi cd "$wadir" +# Export Usermin root dir +WEBMIN_LIBDIR=$wadir +export WEBMIN_LIBDIR + # Display install directory allmods=`cd "$srcdir"; echo */module.info | sed -e 's/\/module.info//g'` if [ "$allmods" = "" ]; then diff --git a/updateboot.pl b/updateboot.pl index 818e3a8e..99d7e924 100755 --- a/updateboot.pl +++ b/updateboot.pl @@ -29,7 +29,7 @@ ©_source_dest("$root_directory/usermin-systemd", $temp); my $lref = &read_file_lines($temp); foreach my $l (@{$lref}) { - $l =~ s/(WEBMIN_[A-Z]+)/$ENV{$1}/; + $l =~ s/(WEBMIN_[A-Z]+)/$ENV{$1}/g; } &flush_file_lines($temp); copy_source_dest($temp, "$systemd_root/$product.service"); diff --git a/usermin-systemd b/usermin-systemd index c2ea0b0b..8dd103c0 100644 --- a/usermin-systemd +++ b/usermin-systemd @@ -1,15 +1,16 @@ [Unit] Description=Usermin server daemon -After=syslog.target [Service] -ExecStart=WEBMIN_CONFIG/.start-init -ExecStop=WEBMIN_CONFIG/.stop-init -ExecReload=WEBMIN_CONFIG/.reload-init +Environment="PERLLIB=WEBMIN_LIBDIR" +ExecStart=WEBMIN_LIBDIR/miniserv.pl WEBMIN_CONFIG/miniserv.conf +ExecStop=/usr/bin/kill $MAINPID +ExecReload=/bin/bash -c '/usr/bin/kill -HUP $MAINPID && while /usr/bin/kill -0 $MAINPID ; do /bin/sleep 0.5 ; done' PIDFile=WEBMIN_VAR/miniserv.pid Type=forking Restart=always RestartSec=2s +TimeoutSec=15s [Install] WantedBy=multi-user.target From b7acb725d38572a61f668fb2fd37e206512e65ab Mon Sep 17 00:00:00 2001 From: Ilia Date: Wed, 15 Jun 2022 01:34:04 +0300 Subject: [PATCH 3/7] Fix not to log to `systemd` while waiting --- usermin-systemd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermin-systemd b/usermin-systemd index 8dd103c0..ff19710b 100644 --- a/usermin-systemd +++ b/usermin-systemd @@ -5,7 +5,7 @@ Description=Usermin server daemon Environment="PERLLIB=WEBMIN_LIBDIR" ExecStart=WEBMIN_LIBDIR/miniserv.pl WEBMIN_CONFIG/miniserv.conf ExecStop=/usr/bin/kill $MAINPID -ExecReload=/bin/bash -c '/usr/bin/kill -HUP $MAINPID && while /usr/bin/kill -0 $MAINPID ; do /bin/sleep 0.5 ; done' +ExecReload=/bin/bash -c '/usr/bin/kill -HUP $MAINPID && while /usr/bin/kill -0 $MAINPID >/dev/null 2>&1 ; do /bin/sleep 0.5 ; done' PIDFile=WEBMIN_VAR/miniserv.pid Type=forking Restart=always From 77013d628f435ec37b2d03dd74e03a39e0809e70 Mon Sep 17 00:00:00 2001 From: Ilia Date: Wed, 15 Jun 2022 03:20:34 +0300 Subject: [PATCH 4/7] Fix reload script for `systemd` in `/etc/usermin` --- setup.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.sh b/setup.sh index 0bca6691..27e194f1 100755 --- a/setup.sh +++ b/setup.sh @@ -600,8 +600,7 @@ if [ -x "$systemctlcmd" ]; then echo "$systemctlcmd start usermin" >>$config_dir/restart-by-force-kill # Reload systemd echo "#!/bin/sh" >>$config_dir/reload - echo "$config_dir/.reload-init >/dev/null 2>&1" >>$config_dir/reload - + echo "$systemctlcmd reload usermin" >>$config_dir/reload chmod 755 $config_dir/stop $config_dir/start $config_dir/restart $config_dir/restart-by-force-kill $config_dir/reload else From b095688e00402ddc415dc2a63babf203838f429a Mon Sep 17 00:00:00 2001 From: Ilia Date: Sun, 19 Jun 2022 00:27:46 +0300 Subject: [PATCH 5/7] Update reload command --- usermin-systemd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermin-systemd b/usermin-systemd index ff19710b..a279b8f7 100644 --- a/usermin-systemd +++ b/usermin-systemd @@ -5,7 +5,7 @@ Description=Usermin server daemon Environment="PERLLIB=WEBMIN_LIBDIR" ExecStart=WEBMIN_LIBDIR/miniserv.pl WEBMIN_CONFIG/miniserv.conf ExecStop=/usr/bin/kill $MAINPID -ExecReload=/bin/bash -c '/usr/bin/kill -HUP $MAINPID && while /usr/bin/kill -0 $MAINPID >/dev/null 2>&1 ; do /bin/sleep 0.5 ; done' +ExecReload=/usr/bin/kill -USR1 $MAINPID PIDFile=WEBMIN_VAR/miniserv.pid Type=forking Restart=always From a8b9ab21ad6deecdae2ef62ece39f5588d7b9086 Mon Sep 17 00:00:00 2001 From: Ilia Date: Sun, 19 Jun 2022 02:13:18 +0300 Subject: [PATCH 6/7] Fix minor releases builds --- makedist.pl | 9 ++++++++- makerpm.pl | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/makedist.pl b/makedist.pl index 701a9fd6..30953a73 100755 --- a/makedist.pl +++ b/makedist.pl @@ -8,7 +8,10 @@ if (@ARGV != 1) { die "usage: makedist.pl [--webmail] "; } -$vers = $ARGV[0]; +$fullvers = $ARGV[0]; +$fullvers =~ /^([0-9\.]+)(\-(\d+))?$/ || usage(); +$vers = $1; +$release = $3; @files = ("config-*-linux", "config-solaris", "images", "index.cgi", "mime.types", @@ -65,6 +68,10 @@ system("cp -r -L $flist tarballs/$dir"); system("touch tarballs/$dir/install-type"); system("echo $vers > tarballs/$dir/version"); +# Store release version, if set +if ($release && $release != 1) { + system("echo $release > tarballs/$dir/release"); + } # Add module files foreach $m (@mlist) { diff --git a/makerpm.pl b/makerpm.pl index aa459862..f8e8aa47 100755 --- a/makerpm.pl +++ b/makerpm.pl @@ -77,15 +77,15 @@ Version: $ver Release: $rel Provides: %{name}-%{version} -PreReq: /bin/sh /usr/bin/perl /bin/rm +Requires(pre): /bin/sh /usr/bin/perl /bin/rm Requires: /bin/sh /usr/bin/perl /bin/rm perl(Net::SSLeay) perl(Time::Local) perl(Encode::Detect) perl(Data::Dumper) +AutoReq: 0 License: BSD-3-clause Group: System/Tools Source: http://www.webmin.com/download/%{name}-%{version}.tar.gz Vendor: Jamie Cameron BuildRoot: /tmp/%{name}-%{version} BuildArchitectures: noarch -AutoReq: 0 %description A web-based user account administration interface for Unix systems. @@ -256,13 +256,15 @@ $cmd = -x "/usr/bin/rpmbuild" ? "rpmbuild" : "rpm"; system("$cmd -ba --target=noarch $spec_dir/$pkgname-$ver.spec") && exit; -system("mv $base_dir/RPMS/noarch/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.noarch.rpm"); -print "Moved to rpm/$pkgname-$ver-$rel.noarch.rpm\n"; -system("mv $base_dir/SRPMS/$pkgname-$ver-$rel.src.rpm rpm/$pkgname-$ver-$rel.src.rpm"); -print "Moved to rpm/$pkgname-$ver-$rel.src.rpm\n"; -system("chown jcameron: rpm/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.src.rpm"); -if (!$nosign) { - system("rpm --resign rpm/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.src.rpm"); +if (-d "rpm") { + system("mv $base_dir/RPMS/noarch/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.noarch.rpm"); + print "Moved to rpm/$pkgname-$ver-$rel.noarch.rpm\n"; + system("mv $base_dir/SRPMS/$pkgname-$ver-$rel.src.rpm rpm/$pkgname-$ver-$rel.src.rpm"); + print "Moved to rpm/$pkgname-$ver-$rel.src.rpm\n"; + system("chown jcameron: rpm/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.src.rpm"); + if (!$nosign) { + system("rpm --resign rpm/$pkgname-$ver-$rel.noarch.rpm rpm/$pkgname-$ver-$rel.src.rpm"); + } } if (-d "/usr/local/webadmin/rpm/yum") { From 37de560f329591d42c09aacecfb21b44defe3fee Mon Sep 17 00:00:00 2001 From: Ilia Date: Sun, 19 Jun 2022 02:14:43 +0300 Subject: [PATCH 7/7] Update requires --- makerpm.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makerpm.pl b/makerpm.pl index f8e8aa47..354b58d1 100755 --- a/makerpm.pl +++ b/makerpm.pl @@ -78,7 +78,7 @@ Release: $rel Provides: %{name}-%{version} Requires(pre): /bin/sh /usr/bin/perl /bin/rm -Requires: /bin/sh /usr/bin/perl /bin/rm perl(Net::SSLeay) perl(Time::Local) perl(Encode::Detect) perl(Data::Dumper) +Requires: /bin/sh /usr/bin/perl /bin/rm perl(Net::SSLeay) perl(Time::Local) perl(Encode::Detect) perl(Data::Dumper) openssl unzip tar AutoReq: 0 License: BSD-3-clause Group: System/Tools