use upstream unit file (#1350939)
This commit is contained in:
parent
85446a9e23
commit
ea0733a371
11
memcached-unit.patch
Normal file
11
memcached-unit.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
diff -up memcached-1.4.28/scripts/memcached.service.unit memcached-1.4.28/scripts/memcached.service
|
||||||
|
--- memcached-1.4.28/scripts/memcached.service.unit 2016-07-02 03:14:25.000000000 +0200
|
||||||
|
+++ memcached-1.4.28/scripts/memcached.service 2016-07-12 13:54:54.275782170 +0200
|
||||||
|
@@ -9,6 +9,7 @@
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=memcached daemon
|
||||||
|
+Before=httpd.service
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
@ -1,12 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Memcached
|
|
||||||
Before=httpd.service
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
EnvironmentFile=-/etc/sysconfig/memcached
|
|
||||||
ExecStart=/usr/bin/memcached -u $USER -p $PORT -m $CACHESIZE -c $MAXCONN $OPTIONS
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
@ -12,9 +12,9 @@ Group: System Environment/Daemons
|
|||||||
License: BSD
|
License: BSD
|
||||||
URL: http://www.memcached.org/
|
URL: http://www.memcached.org/
|
||||||
Source0: http://www.memcached.org/files/%{name}-%{version}.tar.gz
|
Source0: http://www.memcached.org/files/%{name}-%{version}.tar.gz
|
||||||
|
Source1: memcached.sysconfig
|
||||||
|
|
||||||
# custom unit file
|
Patch1: memcached-unit.patch
|
||||||
Source1: memcached.service
|
|
||||||
|
|
||||||
BuildRequires: libevent-devel systemd-units
|
BuildRequires: libevent-devel systemd-units
|
||||||
BuildRequires: perl-generators
|
BuildRequires: perl-generators
|
||||||
@ -42,6 +42,7 @@ access to the memcached binary include files.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch1 -p1 -b .unit
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# compile with full RELRO
|
# compile with full RELRO
|
||||||
@ -76,20 +77,11 @@ install -Dp -m0644 scripts/memcached-tool.1 \
|
|||||||
%{buildroot}%{_mandir}/man1/memcached-tool.1
|
%{buildroot}%{_mandir}/man1/memcached-tool.1
|
||||||
|
|
||||||
# Unit file
|
# Unit file
|
||||||
install -Dp -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/memcached.service
|
install -Dp -m0644 scripts/memcached.service \
|
||||||
|
%{buildroot}%{_unitdir}/memcached.service
|
||||||
|
|
||||||
# Default configs
|
# Default configs
|
||||||
mkdir -p %{buildroot}/%{_sysconfdir}/sysconfig
|
install -Dp -m0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
|
||||||
cat <<EOF >%{buildroot}/%{_sysconfdir}/sysconfig/%{name}
|
|
||||||
PORT="11211"
|
|
||||||
USER="%{username}"
|
|
||||||
MAXCONN="1024"
|
|
||||||
CACHESIZE="64"
|
|
||||||
OPTIONS=""
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Constant timestamp on the config file.
|
|
||||||
touch -r %{SOURCE1} %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
|
|
||||||
|
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
|
5
memcached.sysconfig
Normal file
5
memcached.sysconfig
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
PORT="11211"
|
||||||
|
USER="memcached"
|
||||||
|
MAXCONN="1024"
|
||||||
|
CACHESIZE="64"
|
||||||
|
OPTIONS=""
|
Loading…
Reference in New Issue
Block a user