ntpd redirection to /dev/null 14 December 2019, 12:06:00 The ntpd run script has this: Code: [Select]exec ntpd -g -u ntp:ntp -n >/dev/null. Unfortunately, that's not a redirection - the >/dev/null part is taken as an explicit argument to ntpd, resulting in:QuoteDec 14 11:47:01 [daemon|err] ntpd[1111]: giving up resolving host >/dev/null: Name or service not known (-2)To redirect an fd to a file you need to use redirfd:Code: [Select]#!/usr/bin/execlineb -Pfdmove -c 2 1redirfd -w 2 /dev/nullexec ntpd -g -u ntp:ntp -nSeems to work.
Re: ntpd redirection to /dev/null Reply #1 – 14 December 2019, 12:10:27 Not sure if you also need to redirect fd=1 after the fdmove.
Re: ntpd redirection to /dev/null Reply #2 – 14 December 2019, 16:28:11 Yikes, a quick recursive grep on my directory shows quite a few of shell-style redirects in places they don't belong. Clearly, they don't work in execline. Thanks for pointing them out. I'll fix these ASAP.Actually I don't think you need fdmove here at all. Only stdout should be directed to null so just this should do it.Code: [Select]redirfd -w 1 /dev/nullexec ntpd -g -u ntp:ntp -nSeems to work. Presumably if it raises an error of some sort, it should still print out. Last Edit: 14 December 2019, 16:36:41 by Dudemanguy 1 Likes
Re: ntpd redirection to /dev/null Reply #3 – 14 December 2019, 17:57:04 Alright this should be fixed now along with any other scripts that had this problem. ntp-s6 is an extra package so I pushed the new one directly to the extra repo so you should be able to catch it immediately on the next mirror sync. A handful of scripts in the system repo were in here so those will sit in testing for a bit before I move them into system.Sidenote: Thanks for all your help catching these issues so far. s6 is extremely underrated in my opinion. The last thing I want is people to get a bad first impression because I screwed up a script somewhere.
Re: ntpd redirection to /dev/null Reply #4 – 14 December 2019, 18:56:26 I only run a handful services and ntp was the only one with this problem. Just got the update and appears to be working as intended!Quote from: Dudemanguy – on 14 December 2019, 17:57:04Sidenote: Thanks for all your help catching these issues so far. s6 is extremely underrated in my opinion. The last thing I want is people to get a bad first impression because I screwed up a script somewhere. Glad I can help. There's something about s6 that just feels... right. 1 Likes