Accepting request 794934 from home:kukuk:container
- Use sysusers.d to create the nginx user and group - Remove self-conflict OBS-URL: https://build.opensuse.org/request/show/794934 OBS-URL: https://build.opensuse.org/package/show/server:http/nginx?expand=0&rev=164
This commit is contained in:
parent
7f63fdb070
commit
2c38ca9f0e
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Apr 17 12:28:02 UTC 2020 - Thorsten Kukuk <kukuk@suse.com>
|
||||||
|
|
||||||
|
- Use sysusers.d to create the nginx user and group
|
||||||
|
- Remove self-conflict
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Apr 15 13:12:58 UTC 2020 - Илья Индиго <ilya@ilya.pp.ua>
|
Wed Apr 15 13:12:58 UTC 2020 - Илья Индиго <ilya@ilya.pp.ua>
|
||||||
|
|
||||||
|
19
nginx.spec
19
nginx.spec
@ -91,6 +91,7 @@ Source5: https://github.com/openresty/headers-more-nginx-module/archive/v
|
|||||||
Source6: https://github.com/yaoweibin/nginx_upstream_check_module/archive/v%{nginx_upstream_check_version}/%{nginx_upstream_check_module_path}.tar.gz
|
Source6: https://github.com/yaoweibin/nginx_upstream_check_module/archive/v%{nginx_upstream_check_version}/%{nginx_upstream_check_module_path}.tar.gz
|
||||||
Source7: https://github.com/arut/nginx-rtmp-module/archive/v%{nginx_rtmp_version}/%{nginx_rtmp_module_path}.tar.gz
|
Source7: https://github.com/arut/nginx-rtmp-module/archive/v%{nginx_rtmp_version}/%{nginx_rtmp_module_path}.tar.gz
|
||||||
Source8: https://github.com/leev/ngx_http_geoip2_module/archive/%{nginx_geoip2_version}.tar.gz#/%{nginx_geoip2_module_path}.tar.gz
|
Source8: https://github.com/leev/ngx_http_geoip2_module/archive/%{nginx_geoip2_version}.tar.gz#/%{nginx_geoip2_module_path}.tar.gz
|
||||||
|
Source9: nginx.sysusers
|
||||||
Source100: nginx.rpmlintrc
|
Source100: nginx.rpmlintrc
|
||||||
Source101: https://nginx.org/download/%{name}-%{version}.tar.gz.asc
|
Source101: https://nginx.org/download/%{name}-%{version}.tar.gz.asc
|
||||||
Source102: https://nginx.org/keys/mdounin.key#/%{name}.keyring
|
Source102: https://nginx.org/keys/mdounin.key#/%{name}.keyring
|
||||||
@ -117,10 +118,8 @@ BuildRequires: vim
|
|||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
BuildRequires: pkgconfig(libmaxminddb)
|
BuildRequires: pkgconfig(libmaxminddb)
|
||||||
%requires_eq perl
|
%requires_eq perl
|
||||||
Requires(pre): shadow
|
|
||||||
Recommends: logrotate
|
Recommends: logrotate
|
||||||
Recommends: vim-plugin-nginx
|
Recommends: vim-plugin-nginx
|
||||||
Conflicts: nginx
|
|
||||||
Provides: http_daemon
|
Provides: http_daemon
|
||||||
Provides: httpd
|
Provides: httpd
|
||||||
#
|
#
|
||||||
@ -135,7 +134,11 @@ BuildRequires: libatomic-ops-devel
|
|||||||
%if %{with systemd}
|
%if %{with systemd}
|
||||||
BuildRequires: pkgconfig(systemd)
|
BuildRequires: pkgconfig(systemd)
|
||||||
%{?systemd_ordering}
|
%{?systemd_ordering}
|
||||||
|
BuildRequires: sysuser-shadow
|
||||||
|
BuildRequires: sysuser-tools
|
||||||
|
%sysusers_requires
|
||||||
%else
|
%else
|
||||||
|
Requires(pre): shadow
|
||||||
Requires(pre): %fillup_prereq
|
Requires(pre): %fillup_prereq
|
||||||
Requires(pre): %insserv_prereq
|
Requires(pre): %insserv_prereq
|
||||||
%endif
|
%endif
|
||||||
@ -263,6 +266,9 @@ sed -i "s/\/var\/run/\/run/" conf/nginx.conf
|
|||||||
--with-cc-opt="%{optflags}"
|
--with-cc-opt="%{optflags}"
|
||||||
%endif
|
%endif
|
||||||
%make_build
|
%make_build
|
||||||
|
%if %{with systemd}
|
||||||
|
%sysusers_generate_pre %{SOURCE9} nginx
|
||||||
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install
|
%make_install
|
||||||
@ -275,6 +281,7 @@ install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{pkg_name}
|
|||||||
%if %{with systemd}
|
%if %{with systemd}
|
||||||
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/nginx.service
|
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/nginx.service
|
||||||
ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rcnginx
|
ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rcnginx
|
||||||
|
install -D -m 0644 %{SOURCE9} %{buildroot}%{_sysusersdir}/nginx.conf
|
||||||
%else
|
%else
|
||||||
install -D -m 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/%{pkg_name}
|
install -D -m 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/%{pkg_name}
|
||||||
ln -s -f %{_sysconfdir}/init.d/%{pkg_name} %{buildroot}%{_sbindir}/rc%{pkg_name}
|
ln -s -f %{_sysconfdir}/init.d/%{pkg_name} %{buildroot}%{_sbindir}/rc%{pkg_name}
|
||||||
@ -344,12 +351,13 @@ copydocs %{nginx_rtmp_module_path} \
|
|||||||
%insserv_cleanup
|
%insserv_cleanup
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with systemd}
|
||||||
|
%pre -f nginx.pre
|
||||||
|
%service_add_pre nginx.service
|
||||||
|
%else
|
||||||
%pre
|
%pre
|
||||||
%{_sbindir}/groupadd -r %{ngx_user_group} &>/dev/null ||:
|
%{_sbindir}/groupadd -r %{ngx_user_group} &>/dev/null ||:
|
||||||
%{_sbindir}/useradd -g %{ngx_user_group} -s /bin/false -r -c "user for %{ngx_user_group}" -d %{ngx_home} %{ngx_user_group} &>/dev/null ||:
|
%{_sbindir}/useradd -g %{ngx_user_group} -s /bin/false -r -c "user for %{ngx_user_group}" -d %{ngx_home} %{ngx_user_group} &>/dev/null ||:
|
||||||
|
|
||||||
%if %{with systemd}
|
|
||||||
%service_add_pre nginx.service
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%files
|
%files
|
||||||
@ -406,6 +414,7 @@ copydocs %{nginx_rtmp_module_path} \
|
|||||||
%doc %{ngx_doc_dir}
|
%doc %{ngx_doc_dir}
|
||||||
%if %{with systemd}
|
%if %{with systemd}
|
||||||
%{_unitdir}/nginx.service
|
%{_unitdir}/nginx.service
|
||||||
|
%{_sysusersdir}/nginx.conf
|
||||||
%else
|
%else
|
||||||
%{_sysconfdir}/init.d/%{pkg_name}
|
%{_sysconfdir}/init.d/%{pkg_name}
|
||||||
%endif
|
%endif
|
||||||
|
2
nginx.sysusers
Normal file
2
nginx.sysusers
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Type Name ID GECOS [HOME]
|
||||||
|
u nginx - "User for nginx" /var/lib/nginx
|
Loading…
Reference in New Issue
Block a user