Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 392435 - sys-apps/openrc doesn't allow ntp_servers to contain options in net config
Summary: sys-apps/openrc doesn't allow ntp_servers to contain options in net config
Status: IN_PROGRESS
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: netifrc (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: netifrc Team
URL:
Whiteboard: netifrc:system
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-29 17:01 UTC by Kevin Bryan
Modified: 2013-08-30 14:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Partial patch for ntp_servers as array (openrc-ntp_servers.patch,888 bytes, patch)
2011-11-29 17:01 UTC, Kevin Bryan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Bryan 2011-11-29 17:01:19 UTC
Created attachment 294203 [details, diff]
Partial patch for ntp_servers as array

The ntp_servers* variables in /etc/conf.d/net don't support servers having their own options (such as "key 123456" or "prefer") in ntp.conf.

ntp_servers=("ntp1.localdomain key 123456" "ntp2.localdomain key 123457")

Here is a partial patch to allow it, although somehow it doesn't work for ntp_servers_WAP, and it does work for ntp_servers_eth1.  I assume that it has something to do with an assignment from ntp_servers_WAP to ntp_servers_eth1, but I don't know where that happens.
Comment 1 SpanKY gentoo-dev 2011-11-29 19:16:17 UTC
Comment on attachment 294203 [details, diff]
Partial patch for ntp_servers as array

sorry, but no.  arrays are not allowed anymore as those require bash.

look at how /etc/init.d/net.lo supports multiple options with multiline strings.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-12-26 23:51:35 UTC
The problem with changing this to use newlines, is that we're going to break the configuration for everybody that has no newlines (and users with a mix of newlines and none).

We can't easily detect the options either, because there are a lot of different ones, and users DO use hostnames in the ntp_servers variable.

I think if users want to use options, they should probably write their own ntp.conf file (there's also no way to set the options from DHCP etc).

The only alternative is a new variable name, like ntp2_servers_$IFACE, that's explicitly newline separated.

vapier/WilliamH: opinion on making users write their own ntp.conf if they need the options?
Comment 3 Kevin Bryan 2012-01-04 15:52:33 UTC
(In reply to comment #2)
> I think if users want to use options, they should probably write their own
> ntp.conf file
> 
The issue with writing your own is that it won't change with location.
Comment 4 Ian Stakenvicius gentoo-dev 2013-08-30 14:01:20 UTC
How about:

ntp_config_[iface]="/path/to/ntp.conf.specific"

Given system.sh just creates ntp.conf with a bunch of default values, no reason why we can't instead just cat ${file} > /etc/ntp.conf instead if ${file} exists.  And this frees us from having to support who knows what possible config options an end-user might set.