Accepting request 875976 from home:hgraeber:branches:network
- Use sysuser-tools for creation of the wsdd user and group - Do not hijack the /run/sysconfig folder anymore - Add missing '/' OBS-URL: https://build.opensuse.org/request/show/875976 OBS-URL: https://build.opensuse.org/package/show/network/wsdd?expand=0&rev=12
This commit is contained in:
parent
f2c7c22ed7
commit
7379460409
@ -1,5 +1,5 @@
|
||||
## Path: Network/WSD
|
||||
## Description: WSD Configuration
|
||||
## Path: Network/WSDD
|
||||
## Description: WSDD Configuration
|
||||
## Type: string
|
||||
## Default: ""
|
||||
## ServiceRestart:·wsdd
|
||||
@ -30,4 +30,5 @@ WSDD_INTERFACES=""
|
||||
## Type: string
|
||||
## Default: ""
|
||||
## ServiceRestart:·wsdd
|
||||
# Additional wsdd options
|
||||
WSDD_ARGS=""
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
umask 0644
|
||||
|
||||
WSDD_CONFIG=/etc/sysconfig/wsdd
|
||||
if test -r "${WSDD_CONFIG}"; then
|
||||
. "${WSDD_CONFIG}"
|
||||
@ -23,7 +25,5 @@ if [ "${WSDD_INTERFACES}" != "" ]; then
|
||||
done
|
||||
fi
|
||||
|
||||
install -o wsdd -g wsdd -p 0700 -d /run/sysconfig
|
||||
|
||||
echo "WSDD_ARGS=${WSDD_HOSTNAME} ${WSDD_DOMAIN} ${WSDD_INTERFACE_ARGS} \
|
||||
${WSDD_ARGS}" >/run/sysconfig/wsdd
|
||||
${WSDD_ARGS}" >/run/wsdd/env-vars
|
||||
|
2
wsdd-user.conf
Normal file
2
wsdd-user.conf
Normal file
@ -0,0 +1,2 @@
|
||||
# Type Name ID GECOS [HOME]
|
||||
u wsdd - "User for wsdd" /run/wsdd
|
11
wsdd.changes
11
wsdd.changes
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 1 11:04:37 UTC 2021 - Herbert Graeber <herbert@graeber-clan.de>
|
||||
|
||||
- Use sysuser-tools for creation of the wsdd user and group
|
||||
- Do not hijack the /run/sysconfig folder anymore
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 28 17:26:00 UTC 2021 - Herbert Graeber <herbert@graeber-clan.de>
|
||||
|
||||
- Add missing '/'
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 28 16:11:58 UTC 2021 - Herbert Graeber <herbert@graeber-clan.de>
|
||||
|
||||
|
@ -9,9 +9,9 @@ AmbientCapabilities=CAP_SYS_CHROOT
|
||||
PermissionsStartOnly=true
|
||||
Environment= WSDD_ARGS=-p
|
||||
ExecStartPre=@LIBEXECDIR@/wsdd-init.sh
|
||||
EnvironmentFile=-/run/sysconfig/wsdd
|
||||
EnvironmentFile=-/run/wsdd/env-vars
|
||||
ExecStart=/usr/sbin/wsdd --shortlog -c /run/wsdd $WSDD_ARGS
|
||||
ExecStartPost=/usr/bin/rm /run/sysconfig/wsdd
|
||||
ExecStartPost=/usr/bin/rm /run/wsdd/env-vars
|
||||
User=wsdd
|
||||
Group=wsdd
|
||||
|
||||
|
17
wsdd.spec
17
wsdd.spec
@ -28,7 +28,9 @@ Source2: %{name}.service.in
|
||||
Source3: %{name}.xml
|
||||
Source4: sysconfig.%{name}
|
||||
Source5: %{name}.conf
|
||||
Source6: %{name}-user.conf
|
||||
Patch1: %{name}-shebang.patch
|
||||
BuildRequires: sysuser-tools
|
||||
BuildRequires: firewall-macros
|
||||
BuildRequires: python3
|
||||
Requires(post): %fillup_prereq
|
||||
@ -49,6 +51,7 @@ for devices running Samba, like NAS or file sharing servers on your local networ
|
||||
%patch1 -p1
|
||||
|
||||
%build
|
||||
%sysusers_generate_pre %{SOURCE6} %{name}
|
||||
|
||||
%install
|
||||
install -m 755 -D src/wsdd.py %{buildroot}%{_sbindir}/%{name}
|
||||
@ -64,16 +67,16 @@ mkdir -p %{buildroot}%{_prefix}/lib/tmpfiles.d/
|
||||
install -m 644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}
|
||||
mkdir -p %{buildroot}/run/wsdd
|
||||
mkdir -p %{buildroot}%{_localstatedir}/lib/wsdd
|
||||
mkdir -p %{buildroot}%{_sysusersdir}
|
||||
install -m 0644 %{SOURCE6} %{buildroot}%{_sysusersdir}/
|
||||
|
||||
%pre
|
||||
getent group wsdd >/dev/null || %{_sbindir}/groupadd -r wsdd
|
||||
getent passwd wsdd >/dev/null || %{_sbindir}/useradd -r -g wsdd -c "User for wsdd" -s /sbin/nologin -d /run/wsdd wsdd
|
||||
%pre -f %{name}.pre
|
||||
%service_add_pre wsdd.service
|
||||
|
||||
%post
|
||||
%fillup_only
|
||||
%service_add_post wsdd.service
|
||||
%tmpfiles_create %{_tmpfilesdir}wsdd.conf
|
||||
%tmpfiles_create %{_tmpfilesdir}/wsdd.conf
|
||||
%firewalld_reload
|
||||
|
||||
%preun
|
||||
@ -97,8 +100,8 @@ getent passwd wsdd >/dev/null || %{_sbindir}/useradd -r -g wsdd -c "User for wsd
|
||||
%dir %{_prefix}/lib/firewalld/services
|
||||
%{_prefix}/lib/firewalld/services/wsdd.xml
|
||||
%{_fillupdir}/sysconfig.%{name}
|
||||
%dir %attr(0755,wsdd,wsdd) %ghost /run/sysconfig
|
||||
%attr(0644,wsdd,wsdd) %ghost /run/sysconfig/wsdd
|
||||
%dir %attr(0755,wsdd,wsdd) %ghost /run/wsdd
|
||||
%{_sysusersdir}/%{name}-user.conf
|
||||
%dir %attr(0755,wsdd,wsdd) %ghost /run/%{name}
|
||||
%attr(0644,wsdd,wsdd) %ghost /run/%{name}/env-vars
|
||||
|
||||
%changelog
|
||||
|
Loading…
x
Reference in New Issue
Block a user