Hi, for frequent performance test it would be nice to just start tcpbench as a regular service. tcpbench gets an extra user and group with this diff and is already pledged to "stdio". Thus, there should be no security risk to do this even in hostile environments.
OK? bye, Jan Index: etc/Makefile =================================================================== RCS file: /cvs/src/etc/Makefile,v retrieving revision 1.480 diff -u -p -r1.480 Makefile --- etc/Makefile 13 Sep 2020 11:29:52 -0000 1.480 +++ etc/Makefile 15 Dec 2020 21:05:07 -0000 @@ -64,7 +64,7 @@ RCDAEMONS=amd apmd bgpd bootparamd cron lpd mopd mountd mrouted nfsd npppd nsd ntpd ospf6d ospfd \ pflogd portmap rad radiusd rarpd rbootd relayd ripd route6d \ sasyncd sensorsd slowcgi slaacd smtpd sndiod snmpd spamd \ - spamlogd sshd statd switchd syslogd tftpd tftpproxy unbound \ + spamlogd sshd statd switchd syslogd tcpbench tftpd tftpproxy unbound \ unwind vmd watchdogd wsmoused xenodm ypbind ypldap ypserv MISETS= base${OSrev}.tgz comp${OSrev}.tgz man${OSrev}.tgz game${OSrev}.tgz Index: etc/group =================================================================== RCS file: /cvs/src/etc/group,v retrieving revision 1.94 diff -u -p -r1.94 group --- etc/group 28 Jan 2020 16:51:03 -0000 1.94 +++ etc/group 15 Dec 2020 20:48:07 -0000 @@ -79,6 +79,7 @@ _ftp_proxy:*:109: _sndiop:*:110: _syspatch:*:112: _slaacd:*:115: +_tcpbench:*:116: dialer:*:117: nogroup:*:32766: nobody:*:32767: Index: etc/master.passwd =================================================================== RCS file: /cvs/src/etc/master.passwd,v retrieving revision 1.104 diff -u -p -r1.104 master.passwd --- etc/master.passwd 24 Apr 2020 14:57:31 -0000 1.104 +++ etc/master.passwd 15 Dec 2020 21:25:17 -0000 @@ -62,4 +62,5 @@ _ftp_proxy:*:109:109::0:0:ftp proxy daem _sndiop:*:110:110::0:0:sndio privileged user:/var/empty:/sbin/nologin _syspatch:*:112:112::0:0:syspatch unprivileged user:/var/empty:/sbin/nologin _slaacd:*:115:115::0:0:SLAAC Daemon:/var/empty:/sbin/nologin +_tcpbench:*:116:116::0:0:tcpbench unprivileged user:/var/empty:/sbin/nologin nobody:*:32767:32767::0:0:Unprivileged user:/nonexistent:/sbin/nologin Index: etc/rc.conf =================================================================== RCS file: /cvs/src/etc/rc.conf,v retrieving revision 1.220 diff -u -p -r1.220 rc.conf --- etc/rc.conf 24 Jan 2020 06:17:37 -0000 1.220 +++ etc/rc.conf 15 Dec 2020 20:32:46 -0000 @@ -65,6 +65,7 @@ spamlogd_flags= # use eg. "-i interface sshd_flags= switchd_flags=NO syslogd_flags= # add more flags, e.g. "-u -a /chroot/dev/log" +tcpbench_flags=NO tftpd_flags=NO tftpproxy_flags=NO unbound_flags=NO Index: etc/mail/aliases =================================================================== RCS file: /cvs/src/etc/mail/aliases,v retrieving revision 1.68 diff -u -p -r1.68 aliases --- etc/mail/aliases 24 Jan 2020 06:17:37 -0000 1.68 +++ etc/mail/aliases 15 Dec 2020 20:48:31 -0000 @@ -79,6 +79,7 @@ _ftp_proxy: /dev/null _sndiop: /dev/null _syspatch: /dev/null _slaacd: /dev/null +_tcpbench: /dev/null sshd: /dev/null # Well-known aliases -- these should be filled in! Index: etc/rc.d/tcpbench =================================================================== RCS file: etc/rc.d/tcpbench diff -N etc/rc.d/tcpbench --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ etc/rc.d/tcpbench 15 Dec 2020 20:30:18 -0000 @@ -0,0 +1,12 @@ +#!/bin/ksh + +daemon="/usr/bin/tcpbench" +daemon_flags="-s" +daemon_user=_tcpbench + +. /etc/rc.d/rc.subr + +rc_reload=NO +rc_bg=YES + +rc_cmd $1