systemd service support [release 3.5.22-2mamba;Sun Oct 23 2016]

This commit is contained in:
Silvan Calarco 2024-01-05 18:05:28 +01:00
parent 26662fbccd
commit d51e1eaa7b
3 changed files with 66 additions and 44 deletions

View File

@ -3,14 +3,4 @@
# #
# Options passed to Squid. # Options passed to Squid.
SQUID_OPTIONS="-s" SQUID_OPTIONS="-sYC"
# Set to 1 to automatically restart squid after failure.
#SQUID_RESPAWN=1
# Time to wait for Squid to shut down when asked.
SQUID_SHUTDOWN_TIMEOUT=100
# The maximum number of file descriptors Squid will run with (max 8128).
#SQUID_MAXFD=4096

21
squid.service Normal file
View File

@ -0,0 +1,21 @@
## Copyright (C) 1996-2016 The Squid Software Foundation and contributors
##
## Squid software is distributed under GPLv2+ license and includes
## contributions from numerous individuals and organizations.
## Please see the COPYING and CONTRIBUTORS files for details.
##
[Unit]
Description=Squid Web Proxy Server
After=network.target
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/squid
ExecStartPre=/usr/sbin/squid -z
ExecStart=/usr/sbin/squid -N $SQUID_OPTIONS
ExecStop=/usr/sbin/squid -k shutdown
ExecReload=/usr/sbin/squid -k reconfigure
[Install]
WantedBy=multi-user.target

View File

@ -5,7 +5,7 @@
Name: squid Name: squid
Version: 3.5.22 Version: 3.5.22
Release: 1mamba Release: 2mamba
Summary: The Squid proxy caching server Summary: The Squid proxy caching server
Group: System/Servers Group: System/Servers
Vendor: openmamba Vendor: openmamba
@ -18,26 +18,37 @@ Source2: %{name}-logrotate
Source3: %{name}-pamd Source3: %{name}-pamd
Source4: %{name}-sysconfig Source4: %{name}-sysconfig
Source5: %{name}-conf Source5: %{name}-conf
Source6: %{name}.service
Patch: %{name}-3.0.STABLE15-default_config.patch Patch: %{name}-3.0.STABLE15-default_config.patch
Patch1: %{name}-3.0.STABLE13-gcc44.patch Patch1: %{name}-3.0.STABLE13-gcc44.patch
# patches from: http://www.squid-cache.org/Versions/v2/2.5/bugs/ # patches from: http://www.squid-cache.org/Versions/v2/2.5/bugs/
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: libbsd-devel
BuildRequires: libcap-devel
BuildRequires: libe2fs-devel
BuildRequires: libgcc BuildRequires: libgcc
BuildRequires: libgnutls-devel
BuildRequires: libkrb5-devel
BuildRequires: libltdl-devel
BuildRequires: libnetfilter_conntrack-devel
BuildRequires: libnettle-devel
BuildRequires: libopenldap-devel BuildRequires: libopenldap-devel
BuildRequires: libopenssl-devel BuildRequires: libpam-devel
BuildRequires: libsasl-devel BuildRequires: libperl
BuildRequires: libsasl2-devel
BuildRequires: libstdc++6-devel BuildRequires: libstdc++6-devel
BuildRequires: libwww-devel BuildRequires: libwww-devel
BuildRequires: libz-devel BuildRequires: perl-Authen-Smb
BuildRequires: pam-devel BuildRequires: perl-DBI
BuildRequires: perl-devel
BuildRequires: perl-URI BuildRequires: perl-URI
BuildRequires: perl-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
BuildRequires: openjade BuildRequires: openjade
BuildRequires: linuxdoc-tools BuildRequires: linuxdoc-tools
Obsoletes: squid-respawn Obsoletes: squid-respawn
%systemd_requires
BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description %description
@ -63,6 +74,9 @@ sed -i "s|-Werror||" configure
--libexecdir=%{_libdir}/squid \ --libexecdir=%{_libdir}/squid \
--sysconfdir=%{_sysconfdir}/squid \ --sysconfdir=%{_sysconfdir}/squid \
--datadir=%{_datadir}/squid \ --datadir=%{_datadir}/squid \
--with-logdir=%{_localstatedir}/log/squid \
--with-swapdir=%{_localstatedir}/spool/squid \
--runstatedir=/run \
--with-default-user=squid \ --with-default-user=squid \
--enable-delay-pools \ --enable-delay-pools \
--enable-snmp \ --enable-snmp \
@ -101,11 +115,13 @@ sed -i "s|-Werror||" configure
bindir=%{_sbindir} \ bindir=%{_sbindir} \
sysconfdir=%{_sysconfdir}/squid sysconfdir=%{_sysconfdir}/squid
install -m755 -D %{S:1} %{buildroot}%{_initrddir}/squid install -D -m0644 %{SOURCE6} %{buildroot}%{_unitdir}/squid.service
#install -m755 -D %{S:1} %{buildroot}%{_initrddir}/squid
install -m644 -D %{S:2} %{buildroot}%{_sysconfdir}/logrotate.d/squid install -m644 -D %{S:2} %{buildroot}%{_sysconfdir}/logrotate.d/squid
install -m644 -D %{S:3} %{buildroot}%{_sysconfdir}/pam.d/squid install -m644 -D %{S:3} %{buildroot}%{_sysconfdir}/pam.d/squid
install -m644 -D %{S:4} %{buildroot}%{_sysconfdir}/sysconfig/squid install -m644 -D %{S:4} %{buildroot}%{_sysconfdir}/sysconfig/squid
install -m640 -D %{S:5} %{buildroot}%{_sysconfdir}/squid/squid.conf install -m640 -D %{buildroot}%{_sysconfdir}/squid/squid.conf.default %{buildroot}%{_sysconfdir}/squid/squid.conf
install -d %{buildroot}%{_var}/log/squid install -d %{buildroot}%{_var}/log/squid
install -d %{buildroot}%{_var}/spool/squid install -d %{buildroot}%{_var}/spool/squid
@ -132,35 +148,26 @@ rm -f %{buildroot}%{_sbindir}/RunCache
-s /bin/false squid 2>/dev/null -s /bin/false squid 2>/dev/null
exit 0 exit 0
#%post %post
#if [ $1 -eq 1 ]; then %systemd_post %{name}
# [ -r /etc/sysconfig/rc ] && . /etc/sysconfig/rc || exit 1 :
# [ -r "$rc_networkfunctions" ] && . $rc_networkfunctions || exit 1
#
# get_interfaces_by_zone
# get_interface_parameters "$ifzone_local"
# if [ -n "$int_network" -a -n "$int_netmask" ]; then
# sed -i "s|\(acl lan src\).*|\1 $int_network/$int_netmask|" \
# %{_sysconfdir}/squid/squid.conf
# fi
#fi
#exit 0
%preun %preun
%systemd_preun %{name}
# erase # erase
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
service squid stop
/sbin/chkconfig --del squid
/usr/sbin/userdel squid /usr/sbin/userdel squid
fi fi
exit 0 :
%postun %postun
#update %systemd_postun_with_restart %{name}
if [ $1 -eq 1 ]; then :
service squid condrestart
fi %posttrans
exit 0 # clean old sysv broken links
find /etc/rc[0-6].d/ -type l -xtype l -exec rm -f {} \;
:
%files %files
%defattr(-,root,root) %defattr(-,root,root)
@ -178,7 +185,8 @@ exit 0
%{_sbindir}/purge %{_sbindir}/purge
%{_sbindir}/squid %{_sbindir}/squid
%{_sbindir}/squidclient %{_sbindir}/squidclient
%{_initrddir}/squid %{_unitdir}/squid.service
#%{_initrddir}/squid
%{_datadir}/squid/errors/* %{_datadir}/squid/errors/*
%{_datadir}/squid/icons/* %{_datadir}/squid/icons/*
%{_datadir}/snmp/mibs/SQUID-MIB.txt %{_datadir}/snmp/mibs/SQUID-MIB.txt
@ -227,11 +235,14 @@ exit 0
%dir %attr(0755,squid,squid) %{_var}/spool/squid %dir %attr(0755,squid,squid) %{_var}/spool/squid
%{_mandir}/man1/squidclient.1.gz %{_mandir}/man1/squidclient.1.gz
%{_mandir}/man8/* %{_mandir}/man8/*
%doc ChangeLog CONTRIBUTORS COPYING CREDITS %doc CONTRIBUTORS COPYING CREDITS
%doc QUICKSTART README RELEASENOTES.html SPONSORS #%doc ChangeLog
%doc contrib/url-normalizer.pl contrib/rredir.* contrib/user-agents.pl #%doc QUICKSTART README RELEASENOTES.html SPONSORS
%changelog %changelog
* Sun Oct 23 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 3.5.22-2mamba
- systemd service support
* Mon Oct 10 2016 Automatic Build System <autodist@mambasoft.it> 3.5.22-1mamba * Mon Oct 10 2016 Automatic Build System <autodist@mambasoft.it> 3.5.22-1mamba
- automatic version update by autodist - automatic version update by autodist