Accepting request 81909 from home:fcrozat:systemd

- Add apache2-systemd-ask-pass / apache2.service / start_apache2
  and modify apache2-ssl-global.conf for systemd support
  (bnc#697137).

OBS-URL: https://build.opensuse.org/request/show/81909
OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=335
This commit is contained in:
Roman Drahtmueller 2011-09-12 12:20:52 +00:00 committed by Git OBS Bridge
parent 90508856d0
commit f247c8cfd7
6 changed files with 91 additions and 0 deletions

View File

@ -29,7 +29,12 @@
# Configure the pass phrase gathering process.
# The filtering dialog program (`builtin' is a internal
# terminal dialog) has to provide the pass phrase on stdout.
<IfDefine SYSTEMD>
SSLPassPhraseDialog exec:/usr/sbin/apache2-systemd-ask-pass
</IfDefine>
<IfDefine !SYSTEMD>
SSLPassPhraseDialog builtin
</IfDefine>
# Inter-Process Session Cache:
# Configure the SSL Session Cache: First the mechanism

2
apache2-systemd-ask-pass Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec /bin/systemd-ask-password "Enter SSL pass phrase for $1 ($2): "

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Sep 1 09:43:49 UTC 2011 - fcrozat@suse.com
- Add apache2-systemd-ask-pass / apache2.service / start_apache2
and modify apache2-ssl-global.conf for systemd support
(bnc#697137).
-------------------------------------------------------------------
Wed Aug 31 12:52:22 UTC 2011 - crrodriguez@opensuse.org

16
apache2.service Normal file
View File

@ -0,0 +1,16 @@
[Unit]
Description=apache
After=syslog.target network.target
Before=getty@tty1.service
[Service]
Type=forking
PIDFile=/var/run/httpd2.pid
EnvironmentFile=/etc/sysconfig/apache2
ExecStart=/usr/sbin/start_apache2 -D SYSTEMD -k start
ExecReload=/usr/sbin/start_apache2 -D SYSTEMD -t
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/usr/sbin/httpd2 -D SYSTEMD -k stop
[Install]
WantedBy=multi-user.target

View File

@ -116,6 +116,9 @@ Source130: apache2-vhost.template
Source131: apache2-vhost-ssl.template
Source140: apache2-check_forensic
Source141: apache-20-22-upgrade
Source142: start_apache2
Source143: apache2-systemd-ask-pass
Source144: apache2.service
Patch2: httpd-2.1.3alpha-layout.dif
Patch23: httpd-2.1.9-apachectl.dif
Patch65: httpd-2.0.49-log_server_status.dif
@ -595,7 +598,11 @@ tar xjf %{SOURCE29} -C $RPM_BUILD_ROOT/%{sysconfdir}
#
# init script and friends
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/etc/init.d $RPM_BUILD_ROOT/lib/systemd/system/
install -m 744 $RPM_SOURCE_DIR/rc.%{pname} $RPM_BUILD_ROOT/etc/init.d/%{pname}
install -m 744 $RPM_SOURCE_DIR/start_apache2 $RPM_BUILD_ROOT/usr/sbin/start_apache2
install -m 744 $RPM_SOURCE_DIR/apache2-systemd-ask-pass $RPM_BUILD_ROOT/usr/sbin/apache2-systemd-ask-pass
install -m 744 $RPM_SOURCE_DIR/apache2.service $RPM_BUILD_ROOT/lib/systemd/system/apache2.service
ln -sf ../../etc/init.d/%{pname} $RPM_BUILD_ROOT/%{_sbindir}/rc%{pname}
install -m 755 $RPM_SOURCE_DIR/load_configuration $RPM_BUILD_ROOT/%{_prefix}/share/%{pname}/
install -m 755 $RPM_SOURCE_DIR/find_mpm $RPM_BUILD_ROOT/%{_prefix}/share/%{pname}/
@ -853,6 +860,7 @@ mv $RPM_BUILD_ROOT/%{sysconfdir}/original .
%config(noreplace) /etc/permissions.d/%{pname}
%endif
%config /etc/init.d/%{pname}
/lib/systemd/system/%{pname}.service
#
%{_sbindir}/rc%{pname}
%{_sbindir}/apache%{vers}ctl
@ -863,6 +871,8 @@ mv $RPM_BUILD_ROOT/%{sysconfdir}/original .
%{_sbindir}/a2enmod
%{_sbindir}/a2disflag
%{_sbindir}/a2dismod
%{_sbindir}/start_apache2
%{_sbindir}/apache2-systemd-ask-pass
%{_bindir}/log_server_status%{vers}
%{iconsdir}
%{errordir}

51
start_apache2 Normal file
View File

@ -0,0 +1,51 @@
#!/bin/sh
#
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
# Copyright (c) 2002, 2003, (2004?) SuSE Linux AG
# Copyright (c) 2004(?), 2005, 2006, 2007, 2008 SUSE Linux Products GmbH
#
# Authors: Rolf Haberrecker <apache@suse.de>, 2001
# Peter Poeml <apache@suse.de>, 2002, 2003, 2004, 2005, 2006, 2007,
# 2008, 2009, 2010
#
#
pname=apache2
. /usr/share/$pname/load_configuration
export ${!APACHE_*}
apache_link=/usr/sbin/httpd2
apache_bin=$(/usr/share/$pname/find_mpm 2>/dev/null)
httpd_conf=${APACHE_HTTPD_CONF:-/etc/apache2/httpd.conf}
test -L $apache_link && apache_bin=$(readlink $apache_link)
if [ -z "$APACHE_MPM" ]; then
APACHE_MPM=${apache_bin##*-}
fi
if ! [ -x $apache_bin ]; then
echo >&2 $apache_bin-$APACHE_MPM is not a valid httpd2 binary.
echo >&2 Check your APACHE_MPM setting in /etc/sysconfig/$pname.
exit 5
fi
# a proper home should be set, otherwise the server might end up
# with HOME=/root and some script might try to use that
HOME=/var/lib/apache2
unset server_flags
case "$action" in startssl) server_flags="-DSSL";; esac
for i in $APACHE_SERVER_FLAGS; do
case $i in
-D) ;;
-D*) server_flags="$server_flags $i";;
*) server_flags="$server_flags -D$i";;
esac
done
${get_module_list_done:=false} || /usr/share/$pname/get_module_list && export get_module_list_done=true
${get_includes:=false} || /usr/share/$pname/get_includes && export get_includes_done=true
export -n ${!APACHE_*}
exec $apache_bin -f $httpd_conf $server_flags $@