- dont run as root
OBS-URL: https://build.opensuse.org/package/show/server:database/redis?expand=0&rev=13
This commit is contained in:
parent
9dc744c6d3
commit
05e5c633e2
@ -40,7 +40,7 @@ Index: utils/redis_init_script
|
|||||||
- $EXEC $CONF
|
- $EXEC $CONF
|
||||||
- fi
|
- fi
|
||||||
+ echo -n "Starting service Redis "
|
+ echo -n "Starting service Redis "
|
||||||
+ /sbin/startproc -p $PIDFILE -s -e $EXEC $CONF
|
+ /sbin/startproc -u redis -g redis -p $PIDFILE -s -e $EXEC $CONF
|
||||||
+ rc_status -v
|
+ rc_status -v
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon May 17 14:26:18 UTC 2010 - mrueckert@suse.de
|
||||||
|
|
||||||
|
- dont run as root
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon May 17 14:10:31 UTC 2010 - mrueckert@suse.de
|
Mon May 17 14:10:31 UTC 2010 - mrueckert@suse.de
|
||||||
|
|
||||||
|
12
redis.spec
12
redis.spec
@ -27,6 +27,8 @@ Patch1: %{name}-conf.patch
|
|||||||
# for init script
|
# for init script
|
||||||
Requires: netcat
|
Requires: netcat
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
%define pkg_homedir %{_var}/run/%{name}
|
||||||
|
%define pkg_datadir %{_var}/lib/%{name}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Redis is an advanced key-value store. It is similar to memcached but the dataset
|
Redis is an advanced key-value store. It is similar to memcached but the dataset
|
||||||
@ -60,11 +62,14 @@ install -D -m 0755 redis-server $RPM_BUILD_ROOT%{_sbindir}/redis-server
|
|||||||
install -D -m 0755 utils/redis_init_script $RPM_BUILD_ROOT%{_sysconfdir}/init.d/redis
|
install -D -m 0755 utils/redis_init_script $RPM_BUILD_ROOT%{_sysconfdir}/init.d/redis
|
||||||
ln -s %{_sysconfdir}/init.d/redis $RPM_BUILD_ROOT%{_sbindir}/rcredis
|
ln -s %{_sysconfdir}/init.d/redis $RPM_BUILD_ROOT%{_sbindir}/rcredis
|
||||||
install -D -m 0644 redis.conf $RPM_BUILD_ROOT%{_sysconfdir}/redis.conf
|
install -D -m 0644 redis.conf $RPM_BUILD_ROOT%{_sysconfdir}/redis.conf
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/redis
|
install -d $RPM_BUILD_ROOT%{pkg_homedir} $RPM_BUILD_ROOT%{pkg_datadir}
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%pre
|
||||||
|
/usr/sbin/groupadd -r %{name} &>/dev/null || :
|
||||||
|
/usr/sbin/useradd -o -g %{name} -s /bin/false -r -c "User for Redis key-value store" -d %{pkg_homedir} %{name} &>/dev/null || :
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%fillup_and_insserv %{name}
|
%fillup_and_insserv %{name}
|
||||||
@ -84,8 +89,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_sbindir}/redis-server
|
%{_sbindir}/redis-server
|
||||||
%{_sbindir}/rcredis
|
%{_sbindir}/rcredis
|
||||||
%config(noreplace) %{_sysconfdir}/init.d/redis
|
%config(noreplace) %{_sysconfdir}/init.d/redis
|
||||||
%config(noreplace) %{_sysconfdir}/redis.conf
|
%config(noreplace) %attr(0640, %{name}, %{name}) %{_sysconfdir}/redis.conf
|
||||||
%dir /var/lib/redis
|
%dir %attr(0750, %{name}, %{name}) %{pkg_homedir}
|
||||||
|
%dir %attr(0750, %{name}, %{name}) %{pkg_datadir}
|
||||||
|
|
||||||
%files doc
|
%files doc
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
Loading…
Reference in New Issue
Block a user