<div dir="ltr">Interesting - we've had OVZ containers running as ntp servers, being granted the ability to set the RTC via the CAP_SYS_TIME capability. (never more than one per physical host though)<div><br></div><div>Jake</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 26, 2016 at 9:58 AM, Stewart Brodie <span dir="ltr"><<a href="mailto:sbrodie@espial.com" target="_blank">sbrodie@espial.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Paul Giordano <<a href="mailto:paulgiordano@webpass.net">paulgiordano@webpass.net</a>> wrote:<br>
<br>
> Running LXD 2.0.3<br>
><br>
> I'm trying to have a container be an ntp server, but the container gets an<br>
> EPERM trying to set the hw clock:<br>
><br>
> clock_settime(CLOCK_REALTIME, {1469546956, 258938000}) = -1 EPERM<br>
(Operation not permitted)<br>
> adjtimex(0x7ffffb0d6bf0) = -1 EPERM (Operation not permitted)<br>
> settimeofday({1469546956, 258938}, NULL) = -1 EPERM (Operation not<br>
permitted)<br>
> settimeofday({1469546956, 0}, NULL) = -1 EPERM (Operation not permitted)<br>
><br>
> Is there a way to configure the container to allow access to /dev/rtc0?<br>
<br>
<br>
</span>You won't be able to call those functions from a container not in the<br>
initial user namespace, even if you possess CAP_SYS_TIME, because of the way<br>
the kernel does its permission checks.<br>
<br>
AIUI, this is to prevent containers from being able to do system-wide things<br>
that affect other containers. That affects quite a few things (such as<br>
access to netlink, ability to mount certain types of device, inserting<br>
kernel modules, access to the kernel logger)<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Stewart Brodie<br>
Senior Software Engineer<br>
Espial UK<br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></font></span></blockquote></div><br></div>