* Thu Oct 30 2025 Jean-Philippe Pialasse <jpp@koozali.org> 0.2-22.sme

- remove sv files, rewrite systemd unit [SME: 11517]
- remove /var/log/httpd-bkpc/ [SME: 12197]
- remove logfiles2timestamp [SME: 12196]
This commit is contained in:
2025-10-30 17:42:27 -04:00
parent ec6b312c35
commit b2ab500ef3
7 changed files with 25 additions and 62 deletions

View File

@@ -39,8 +39,6 @@ $event = 'smeserver-BackupPC-update'; #Must match rpm name
safe_symlink("restart", "root/etc/e-smith/events/logrotate/services2adjust/httpd-bkpc");
# Create needed empty files
safe_touch("root/etc/e-smith/events/logrotate/logfiles2timestamp/var/log/httpd/bkpc_access_log");
safe_touch("root/etc/e-smith/events/logrotate/logfiles2timestamp/var/log/httpd/bkpc_error_log");
safe_touch("root/var/service/httpd-bkpc/down");

View File

@@ -53,6 +53,7 @@ foreach (qw(
access_compat
authn_core
authz_core
systemd
))
{
next unless -f "/usr/lib/httpd/modules/mod_${_}.so" ||

View File

@@ -3,9 +3,19 @@ Description=BackupPC web page
After=network.target
[Service]
Type=forking
#PIDFile=/run/bandwidthd.pid
ExecStart=/var/service/httpd-bkpc/run
Type=notify
ExecStartPre=/sbin/e-smith/service-status httpd-bkpc
ExecStartPre=/sbin/e-smith/expand-template /etc/httpd/bkpc-conf/httpd.conf
ExecStart=/usr/sbin/httpd -f /etc/httpd/bkpc-conf/httpd.conf -DFOREGROUND
ExecReload=/usr/sbin/httpd -f /etc/httpd/bkpc-conf/httpd.conf -k graceful
ExecStop=/bin/kill -WINCH ${MAINPID}
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=sme-server.target

View File

@@ -39,11 +39,10 @@ sub main {
my $c = shift;
$c->app->log->info($c->log_req);
$cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
$adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
my $url = "https://".$c->session->{'SystemName'}.".".$c->session->{"DomainName"}."/BackupPC";
$cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
$adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
my $host = $c->req->url->to_abs->host;
my $url = "https://$host/BackupPC";
$c->stash(url => $url );
$c->render(template => 'backuppc');
@@ -72,4 +71,4 @@ sub get_backuppc {
return $out;
}
1;
1;

View File

@@ -1,27 +0,0 @@
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 2005 Mitel Networks Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Technical support for this program is available from Mitel Networks
# Please visit our web site www.mitel.com/sme/ for details.
#----------------------------------------------------------------------
exec \
/usr/local/bin/setuidgid smelog \
/usr/local/bin/multilog t s5000000 \
/var/log/httpd-bkpc

View File

@@ -1,12 +0,0 @@
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 1999-2004 Mitel Networks Corporation
#----------------------------------------------------------------------
config=/etc/httpd/bkpc-conf/httpd.conf
[ -e $config ] || exit 1
exec 2>&1
exec chpst -P /usr/sbin/httpd -f $config -D FOREGROUND&

View File

@@ -4,7 +4,7 @@
Name: smeserver-BackupPC
Version: 0.2
Release: 21%{?dist}
Release: 22%{?dist}
Summary: BackupPC integration into SME server
Group: Applications/System
@@ -52,6 +52,11 @@ This package contains specific configuration for SME server
#----------------------------------------------------
%changelog
* Thu Oct 30 2025 Jean-Philippe Pialasse <jpp@koozali.org> 0.2-22.sme
- remove sv files, rewrite systemd unit [SME: 11517]
- remove /var/log/httpd-bkpc/ [SME: 12197]
- remove logfiles2timestamp [SME: 12196]
* Sun Oct 05 2025 Brian Read <brianr@koozali.org> 0.2-21.sme
- Add UTF8 and avoid potential DB caching problems [SME: 13209]
@@ -206,10 +211,6 @@ perl createlinks
%install
%{__mkdir} -p $RPM_BUILD_ROOT/var/service/httpd-bkpc/supervise
%{__mkdir} -p $RPM_BUILD_ROOT/var/service/httpd-bkpc/log/supervise
%{__mkdir} -p $RPM_BUILD_ROOT/var/log/httpd-bkpc
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
/bin/rm -f %{name}-%{version}-filelist
@@ -231,13 +232,6 @@ perl createlinks
--file "/etc/BackupPC/remoteArchive.conf" "attr(640,backuppc,backuppc) %config(noreplace)" \
--file "/etc/BackupPC/remoteCopyPool.conf" "attr(640,backuppc,backuppc) %config(noreplace)" \
--dir "/etc/BackupPC/pc" "attr(750,backuppc,backuppc)" \
--dir "/var/service/httpd-bkpc" "attr(01755,root,root)" \
--file "/var/service/httpd-bkpc/run" "attr(0700,root,root)" \
--dir "/var/service/httpd-bkpc/supervise" "attr(0700,root,root)" \
--dir "/var/service/httpd-bkpc/log" "attr(0755,root,root)" \
--file "/var/service/httpd-bkpc/log/run" "attr(0755,root,root)" \
--dir "/var/service/httpd-bkpc/log/supervise" "attr(0700,root,root)" \
--dir "/var/log/httpd-bkpc" "attr(0750,smelog,smelog)" \
--ignoredir "/root/var/" \
--ignoredir "/usr/share/BackupPC" \
--ignoredir "/usr/share/BackupPC/lib" \