On Wed, Apr 09, 2014 at 07:35:15PM -0400, Mike Gilbert wrote: > On Wed, Apr 9, 2014 at 12:32 PM, Lennart Poettering > <lenn...@poettering.net> wrote: > > On Wed, 09.04.14 11:21, Tom Gundersen (t...@jklm.no) wrote: > > > >> > >> On Mon, Mar 31, 2014 at 8:28 PM, Mike Gilbert <flop...@gentoo.org> wrote: > >> > Several units now utilize the PrivateNetwork parameter, which requires > >> > network namespace support. > > > > BTW, this really sounds like something where we should have graceful > > degradation: if network namespaces are missing we should probably simply > > ignore PrivateNetwork= (maybe print a one-time warning to syslog, just > > to mentioned this), and proceed without them. After all this is a > > feature that just takes away features, and doesn't add any, thus simply > > ignoring it should be safe. > > > > I'd be happy to merge a patch which implements such a scheme to support > > kernels with a more limited feature set. > > > > Are there any examples of how to implement a "one-time warning" for > this sort of thing? Not in systemd, I think.
Simply try: int func(...) { static bool network_namespace_warning = false; ... if (!network_namespace_warning) { network_namespace_warning = true; log_warn("..."); } } Zbyszek _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel