Dear readers,
I have an openBSD just freshly updated to 7.3.
Amazing release, Thank you
I run ttyd on it, a tty over http small demon
and because i like log level i run a custom rc script
nothing fancy here :
daemon_user=support
rc_bg=YES
and in rc_start
su -fl -c ${daemon_class} -s /bin/sh ${daemon_user} -c "SHELL=/bin/ksh
${daemon} ${daemon_flags} 2>&1 | /usr/local/bin/ttyd.logger.pl"
Which i am updating with new pipe tools. (!| or |!) ;
ttyd.logger.pl is simple , read log put a level on it:
===================================
#!/usr/bin/perl
use Sys::Syslog qw(:standard :macros);
openlog("ttyd", "pid", "daemon");
while (my $l = <>) {
# [2020/10/20 09:58:39:7131] NOTICE:
$l =~ /\[[^]]+\]\s(\w+):/;
my $ll = $1 ? $1 : "info";
if ( $ll eq "ERR" ) {
$ll = "err";
} elsif ( $ll eq "WARN" ) {
$ll = "warning";
} elsif ( $ll eq "NOTICE") {
$ll = "info"; # ttyd is way to verbose
} elsif ( $ll eq "INFO") {
$ll = "info";
} elsif ( $ll eq "DEBUG") {
$ll = "debug";
} else {
$ll = "notice"; #notice unknown
}
syslog($ll, $l);
}
===================================
When looking at top, something surprise me ( this is the actual question ):
34172 support -6 0 4860K 8992K sleep/0 piperd 0:00 0.78%
/usr/bin/perl /usr/local/bin//ttyd.logger.pl
*The priority is -6* (why , how)
First this is not nice ( ha ha ) and I am quite sure
this is completely controlled by the kernel.
# id support
uid=1001(support) gid=1001(support) groups=1001(support), 67(www)
How can a basic user get a -6 PRIO ? This feels very wrong.
I fear syslog in perl is doing something unexpected,
Please help and/or educate on this.