# make install, and have "sudo stap ...." or "sudo stapbpf ...." work later.
install-exec-hook:
if [ `id -u` -eq 0 ]; then \
- getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \
- getent group stapusr >/dev/null \
+ (getent group stapusr >/dev/null || groupadd -f -g 156 -r stapusr) \
&& chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \
&& chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \
fi
# make install, and have "sudo stap ...." or "sudo stapbpf ...." work later.
@HAVE_BPF_DECLS_TRUE@install-exec-hook:
@HAVE_BPF_DECLS_TRUE@ if [ `id -u` -eq 0 ]; then \
-@HAVE_BPF_DECLS_TRUE@ getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \
-@HAVE_BPF_DECLS_TRUE@ getent group stapusr >/dev/null \
+@HAVE_BPF_DECLS_TRUE@ (getent group stapusr >/dev/null || groupadd -f -g 156 -r stapusr) \
@HAVE_BPF_DECLS_TRUE@ && chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \
@HAVE_BPF_DECLS_TRUE@ && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \
@HAVE_BPF_DECLS_TRUE@ fi
# make install, and have "sudo stap ...." or "sudo staprun ...." work later.
install-exec-hook:
if [ `id -u` -eq 0 ]; then \
- getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \
- getent group stapusr >/dev/null && chgrp stapusr "$(DESTDIR)$(bindir)/staprun"; \
- chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \
+ (getent group stapusr >/dev/null || groupadd -f -g 156 -r stapusr) \
+ && chgrp stapusr "$(DESTDIR)$(bindir)/staprun" \
+ && chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \
fi
# make install, and have "sudo stap ...." or "sudo staprun ...." work later.
install-exec-hook:
if [ `id -u` -eq 0 ]; then \
- getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \
- getent group stapusr >/dev/null && chgrp stapusr "$(DESTDIR)$(bindir)/staprun"; \
- chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \
+ (getent group stapusr >/dev/null || groupadd -f -g 156 -r stapusr) \
+ && chgrp stapusr "$(DESTDIR)$(bindir)/staprun" \
+ && chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \
fi
# Tell versions [3.59,3.63) of GNU make to not export all variables.
%endif
%pre runtime
-getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr
-getent group stapsys >/dev/null || groupadd -g 157 -r stapsys 2>/dev/null || groupadd -r stapsys
-getent group stapdev >/dev/null || groupadd -g 158 -r stapdev 2>/dev/null || groupadd -r stapdev
+getent group stapusr >/dev/null || groupadd -f -g 156 -r stapusr
+getent group stapsys >/dev/null || groupadd -f -g 157 -r stapsys
+getent group stapdev >/dev/null || groupadd -f -g 158 -r stapdev
exit 0
%pre server
-getent group stap-server >/dev/null || groupadd -g 155 -r stap-server 2>/dev/null || groupadd -r stap-server
+getent group stap-server >/dev/null || groupadd -f -g 155 -r stap-server
getent passwd stap-server >/dev/null || \
useradd -c "Systemtap Compile Server" -u 155 -g stap-server -d %{_localstatedir}/lib/stap-server -r -s /sbin/nologin stap-server 2>/dev/null || \
useradd -c "Systemtap Compile Server" -g stap-server -d %{_localstatedir}/lib/stap-server -r -s /sbin/nologin stap-server