Re: [systemd-devel] binding tmpfiles.d to unit startup
Make it more user friendly (e.g. without an open man page). Instead of u root 0 g mail /usr/bin/procmail g tty /usr/bin/write d /var/lib/foobar 664 root root c /etc/sudoers /usr/share/sudo/sudoers.default user root 0 setgroup mail /usr/bin/procmail ... and so on. Hmm, that gave me one thougth: if systemd starts as PID 1 and no /etc/passwd etc doesn't exist, I can very well understand that, when compiled with --enable-privioning, it should create those things. But the c -line could be happily handled by a shell script. So my proposal is to only add things into systemd-provision that absolutely must be done by pid 1, because without it /bin/dash or most user-space won't run. But then systemd-provision should just execute provision shell scripts in /lib/systemd/provision.d (or similar). No need to re-create cp, for example. Also it gives overall a bigger flexibility. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] backlight: don't hardcode path in binary
Hmm, why should it be configurable? Isn't one (of the many) purposes of systemd to unify the user-space of Linux? And we don't have /lib/systemd/system-sleep/ configurable either, for example. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] systemd-networkd on by default?
I agree with Harald. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] install: Do not enable systemd-networkd by default
True, but this requires manual patching and fixing up of `make install`, which is a bummer. Why? Your debian/rules or rpmspec %build can simply do something like this: make install rm -f ${DEST}/etc/systemd/system/FOOO.BAR that is much easier than quilt patches that modify Makefile.am. Also, those patches tend to not apply from time to time (if the area around the patch got changed upstream). ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] Add setns() functions if not in the C library.
Compilation works okay here. And make check said PASS: test-namespace. The change I made is to complain if __NR_setns is not defined. The approach with an error message (at runtime) was taken from iproute2. I used that because for many (desktop) users namespace support isn't really needed. So if the libc would really not provide it, ... who cares. Then just the namespace related units wouldn't work, and they are not central to system bringup. I didn't knew the syscall numbers differs between architectures. It never occured to me that this could be a sane design :-) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Compilation error on Debian
I'm on Debian 7.4 (the current stable one), gcc is gcc (Debian 4.7.2-5) 4.7.2. I get lots of warnings, but also a compilation error. I also get one warning at autogen time and one warning at configure time. For the compilation error: I have libc6-dev in version 2.13-38+deb7u1. Doesn't that one define setns? The libc6-dev *.deb provides /usr/include/i386-linux-gnu/bits/syscall.h, which at least defines SYS_setns. $ git describe v209-1-g6300b3e $ git clean -fdx $ ./autogen.sh ... configure.ac:37: installing `build-aux/missing' Makefile.am:36: user target `.PRECIOUS' defined here... /usr/share/automake-1.11/am/configure.am: ... overrides Automake target `.PRECIOUS' defined here ... $ ./configure ... checking for LIBGCRYPT - version = 1.4.5... yes (1.5.0) configure: WARNING: *** *** The config script /usr/bin/libgcrypt-config was *** built for i486-pc-linux-gnu and thus may not match the *** used host i686-pc-linux-gnu. *** You may want to use the configure option --with-libgcrypt-prefix *** to specify a matching config script. *** checking libaudit.h usability... yes ... $ make ... CC src/libsystemd/sd-bus/libsystemd_la-bus-kernel.lo src/libsystemd/sd-bus/bus-kernel.c: In function 'bus_message_setup_kmsg': src/libsystemd/sd-bus/bus-kernel.c:230:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] src/libsystemd/sd-bus/bus-kernel.c: In function 'bus_kernel_create_bus': src/libsystemd/sd-bus/bus-kernel.c:1301:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] src/libsystemd/sd-bus/bus-kernel.c:1302:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] ... CC src/core/libsystemd_core_la-namespace.lo src/core/namespace.c: In function 'setup_netns': src/core/namespace.c:495:17: warning: implicit declaration of function 'setns' [-Wimplicit-function-declaration] src/core/namespace.c:495:17: warning: nested extern declaration of 'setns' [-Wnested-externs] ... CC src/shared/conf-parser.lo src/shared/conf-parser.c: In function 'config_parse_bytes_off': src/shared/conf-parser.c:493:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] ... CCLD libsystemd.la src/libsystemd/sd-bus/.libs/libsystemd_la-bus-message.o (symbol from plugin): warning: memset used with constant zero length parameter; this could be due to transposed parameters ... CC src/libsystemd/sd-bus/libsystemd_internal_la-bus-kernel.lo src/libsystemd/sd-bus/bus-kernel.c: In function 'bus_message_setup_kmsg': src/libsystemd/sd-bus/bus-kernel.c:230:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] src/libsystemd/sd-bus/bus-kernel.c: In function 'bus_kernel_create_bus': src/libsystemd/sd-bus/bus-kernel.c:1301:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] src/libsystemd/sd-bus/bus-kernel.c:1302:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] ... CCLD libudev.la libsystemd_internal_la-bus-message.o (symbol from plugin): warning: memset used with constant zero length parameter; this could be due to transposed parameters ... CC src/shared/libsystemd_capability_la-capability.lo src/shared/capability.c: In function 'drop_from_file': src/shared/capability.c:174:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] src/shared/capability.c:175:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] ... CC src/core/libsystemd_core_la-manager.lo src/core/manager.c: In function 'manager_setup_time_change': src/core/manager.c:238:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] CC src/core/libsystemd_core_la-transaction.lo CC src/core/libsystemd_core_la-load-fragment.lo src/core/load-fragment.c: In function 'config_parse_memory_limit': src/core/load-fragment.c:2279:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] ... CC src/core/libsystemd_core_la-dbus-manager.lo src/core/dbus-manager.c: In function 'property_set_runtime_watchdog': src/core/dbus-manager.c:284:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] src/core/dbus-manager.c: In function 'method_get_unit_by_pid': src/core/dbus-manager.c:334:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] ... CC src/core/libsystemd_core_la-namespace.lo src/core/namespace.c: In function 'setup_netns': src/core/namespace.c:495:17: warning: implicit declaration of function 'setns' [-Wimplicit-function-declaration] src/core/namespace.c:495:17: warning: nested extern declaration of 'setns' [-Wnested-externs] ... CC src/udev/net/libudev_core_la-link-config.lo src/udev/net/link-config.c: In function 'get_mac': src/udev/net/link-config.c:334:17: warning: ISO C90 forbids mixed declarations
Re: [systemd-devel] Compilation error on Debian
You need glibc = 2.14 Two notes: * than ./configure should say so * that cuts out Debian Stable from the dance, which is probably with us for 2 years ... ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [RFC] make static_assert() run without warnings
Make C++11 static_assert work without warning by using C99 _Pragma() as well. --- NOTE: this patch is probably whitespace damaged, because I'm pasting it in via Google's web interface. I declared this patch as RFC because I'm unsure how clang behaves on it. Index: systemd-test/src/shared/macro.h === --- systemd-test.orig/src/shared/macro.h 2014-02-20 10:09:53.300892884 +0100 +++ systemd-test/src/shared/macro.h 2014-02-20 10:20:25.656892808 +0100 @@ -156,7 +156,12 @@ static inline size_t ALIGN_TO(size_t l, #if defined(static_assert) #define assert_cc(expr) static_assert(expr, #expr) #else -#define assert_cc(expr) struct UNIQUE(_assert_struct_) { char x[(expr) ? 0 : -1]; }; +//#define assert_cc(expr) struct UNIQUE(_assert_struct_) { char x[(expr) ? 0 : -1]; }; +#define assert_cc(expr) \ + _Pragma(GCC diagnostic push); \ + _Pragma(GCC diagnostic ignored \-Wdeclaration-after-statement\); \ + struct UNIQUE(_assert_struct_) { char x[(expr) ? 0 : -1]; }; \ + _Pragma(GCC diagnostic pop); #endif #define assert_return(expr, r) \ ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] systemd from git doesn't work with g-object-introspection 1.32.1
Compilation on Debian Stable, this happens during a make: GISCAN src/gudev/GUdev-1.0.gir Usage: g-ir-scanner [options] sources g-ir-scanner: error: no such option: -W ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Compilation error on Debian
Okay, that's easy enought. Can you tell me if ./test-namespace is all I need to test it? Or do I have to install the compile systemd and create a service file with namespace stuff in it? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] Remove static_assert related warnings
Make macro assert_cc() not emit declaration after statements warnings. This can be done by using the GCC pragmas 'diagnostic ignore undefined'. In order to be able to use that pragma inside a macro, we need to put it into the (C99-introduced) _Pragma() pseudo-function. --- src/shared/macro.h |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/macro.h b/src/shared/macro.h index dfbc201..f93a4f0 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -156,7 +156,11 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) { #if defined(static_assert) #define assert_cc(expr) static_assert(expr, #expr) #else -#define assert_cc(expr) struct UNIQUE(_assert_struct_) { char x[(expr) ? 0 : -1]; }; +#define assert_cc(expr) \ + _Pragma(GCC diagnostic push); \ + _Pragma(GCC diagnostic ignored \-Wdeclaration-after-statement\); \ + struct UNIQUE(_assert_struct_) { char x[(expr) ? 0 : -1]; }; \ + _Pragma(GCC diagnostic pop); #endif #define assert_return(expr, r) \ -- 1.7.10.4 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] Add setns() functions if not in the C library.
Debian Stable is still using glibc 2.13, which doesn't provide the setns(). So we detect this and provide a tiny wrapper that issues the setns syscall towards the kernel. --- configure.ac |3 +++ src/shared/missing.h | 13 + 2 files changed, 16 insertions(+) diff --git a/configure.ac b/configure.ac index 05ee098..40162ba 100644 --- a/configure.ac +++ b/configure.ac @@ -250,6 +250,9 @@ AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include sys/ m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) # -- +AC_CHECK_FUNCS([setns]) + +# -- have_dbus=no AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests])) AS_IF([test x$enable_dbus != xno], [ diff --git a/src/shared/missing.h b/src/shared/missing.h index 2661285..ea87053 100644 --- a/src/shared/missing.h +++ b/src/shared/missing.h @@ -28,6 +28,7 @@ #include fcntl.h #include stdlib.h #include unistd.h +#include errno.h #include linux/oom.h #include linux/input.h #include linux/if_link.h @@ -352,4 +353,16 @@ static inline int name_to_handle_at(int fd, const char *name, struct file_handle #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) #endif +#ifndef HAVE_SETNS +static inline int setns(int fd, int nstype) +{ +#ifdef __NR_setns +return syscall(__NR_setns, fd, nstype); +#else +errno = ENOSYS; +return -1; +#endif +} +#endif + #endif -- 1.7.10.4 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] systemd from git doesn't work with g-object-introspection 1.32.1
$ make -j1 V=1 make --no-print-directory all-recursive Making all in . /usr/bin/g-ir-scanner --c-include=gudev/gudev.h --namespace=GUdev --nsversion=1.0 --libtool=/bin/bash ./libtool --include=GObject-2.0 --library=libgudev-1.0.la --pkg-export=gudev-1.0 --warn-all -pipe -Wall -Wextra -Wno-inline -Wundef -Wformat=2 -Wformat-security -Wformat-nonliteral -Wlogical-op -Wsign-compare -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-long-long -Wno-overlength-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Werror=overflow -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -ffunction-sections -fdata-sections -fstack-protector --param=ssp-buffer-size=4 -flto -D_GUDEV_COMPILATION -D_GUDEV_WORK_AROUND_DEV_T_BUG -I./src -I./src -I./src/gudev -I./src/gudev src/gudev/gudev.h src/gudev/gudevtypes.h src/gudev/gudevenums.h src/gudev/gudevenumtypes.h src/gudev/gudevclient.h src/gudev/gudevdevice.h src/gudev/gudevenumerator.h src/gudev/gudevclient.c src/gudev/gudevdevice.c src/gudev/gudevenumerator.c libgudev-1.0.la --output src/gudev/GUdev-1.0.gir Usage: g-ir-scanner [options] sources g-ir-scanner: error: no such option: -W make[2]: *** [src/gudev/GUdev-1.0.gir] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] udev: Adding zram to inappropriate block device
with unit type ending in .zswap No, not another unit type. Instead better amend .swap unit types to also know about ZRAM. However, isn't this a bit early? Shouldn't move ZRAM first move out of staging? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Installing gitlab
Maybe this script *needs* a tty? Maybe it doesn't run as user git, e.g. wrong rights, wrong home directory? Try to put a set -x at the top of the script and restart it, then you'll see where it failed. Then, look into that program and find out why it failed. If in doubt, pepper it with debug printf or Ruby's equivalent. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Installing gitlab
Marwan, he specified it, see above the line directly after [Service] [Service] Type=forking User=git WorkingDirectory=/var/www/gitlab Environment=RAILS_ENV=production One thing that makes me wonder is however his sidekick.target thingy. It says that Redis and Postgresql should be started, but his sidekick.service file doesn't say this. I think that his *.target is superfluous and should get away, and that the sidekick.service file should declare what dependencies it has/wants. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Is masking an error?
Hi, on my systemd v208 + many patches from the Fedora 21 source RPM i get TWO error messages in my journal when I login as root: 09:27:58 systemd-logind[118]: Failed to start unit user@0.service: Unit user@0.service failed to load: No such file or directory. 09:27:58 systemd-logind[118]: Failed to start user service: Unit user@0.service failed to load: No such file or directory. But it was my decision as an admin to disable user sessions, by doing ln -s /dev/null /etc/systemd/systemd/user@.service. In my case systemd runs in embedded devices and no one would use use user service files anyway - tightly controlled environment. So, it would be better to a) only spit one message that this is masked and b) put that at debug level ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Is masking an error?
Thomas, logind in conjunction with udev's tagging also sets some device ACLs correctly, which I like. I also like that I can have a protection to not reboot my system while a user is active. So I'm not ready to get rid of logind completely. I'd actually have used user sessions if starting a user-dbus (in text mode, not in X) and systemd-run --user would have worked with my vanilla v208. But it was a mess, so I solved that entireley differently. For now I have a yucky type=oneshot ExecStart=/bin/true service file in /etc/systemd/system/user@.service. This is very ugly, so I raised the question if announcing masked services as an *ERROR* is really the way to go. Every masking is a system admin decision, after all. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Is masking an error?
I'd actually have used user sessions Not sure if I'd translate to I would have actually used. But that is what I meant :-) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] consider renaming -.slice
systemd-journalctl and systemd-systemctl were also renamed to get more convenient ... (But hey, I don't really know what external stuff uses -.slice and -.mount ...) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] consider renaming -.slice
Oh, I confused that with the old /etc/systemd/systemd-journald.conf file, which was renamed. Kay, I only meant to special case the /, e.g. let home-kay-data.mount be it like it is, but rename - to root, so that it is root.mount and root.slice. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] understanding list-unit-files ...
There is one strange thing here: root@desktop:/etc# systemctl list-unit-files | grep multi multi-user.targetdisabled root@desktop:/etc# systemctl status multi-user.target multi-user.target - Multi-User System Loaded: loaded (/lib/systemd/system/multi-user.target; disabled) Active: active since Wed 2014-01-15 15:22:14 CET; 56min ago Docs: man:systemd.special(7) 15:22:14 systemd[1]: Starting Multi-User System. 15:22:14 systemd[1]: Reached target Multi-User System. root@desktop:/etc# So, why is list-unit-files saying that multi-user.target is disabled? It's not, it was even started automatically ... ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] systemd hangs after Welcome message when LogLevel=debug
Educated guess (!) With LogLevel=debug, you generate huge amounts of output. With DefaultStandardOutput=syslog, you're asking systemd to send it's output to syslog. But while systemd is starting your system the syslog might not be ready. Probably systemd has some buffer, where it buffers the output. Once syslog becomes available, it will be fed with the buffer's contents first. If the output is small enought, as with LogLevel=info, this actually works. But when you generate gobs of output, the buffer will overflow and the output routine will wait until the buffer get's emptied, which it never will ... So, you might try to use DefaultStandardOutput=syslog-or-kmsg or DefaultStandardOutput=journal instead. The latter will eventually also send the output to syslog, which is why it's a default. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] understanding list-unit-files ...
I did not want to disable multi-user.target at all. It's perfectly running, just as intended. I just want to ask why list-unit-files reports erraneous junk. man systemctl is very brief on it's output: list-unit-files List installed unit files. Maybe it would be better to get rid of the enabled/static junk and instead report the full path, e.g. /run/systemd/system/dynamic.service, /lib/systemd/system/blah.service, /etc/systemd/systemd/foo.service.d/ ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] systemctl reboot/shutdown freezes client
Try systemctl --force reboot. The --force will kill the processes, which (for me) closes the incoming ssh session. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] Fix: can not pass configure by default kmod build option
Chengwai, given that kmod may not available in some distro version I'm on Debian and use my self-compiled systemd v208 with a self-made kmod_15.deb file. Packaging kmod is dead easy, it's a very straightforward package. Using the newest kmod doesn't hurt Debian Stable nor Debian SID. So the Debian packagers of systemd could very easily package a decent version of kmod if they think that their version of systemd should use if. If they think that it's not worth the hassle, then they could simply apply --disable-kmod. Both systemd and udev source code have the proper #ifdef HAVE_KMOD guarding. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] consider renaming -.slice
Please consider renamign -.slice, because this sucks: # cd /lib/systemd/system # grep -r user@ * grep: invalid option -- '.' Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information. Yes, I know that I can use grep -r -- user@ *, but this is just inconvenient. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] systemd --user and kdbus
Waa, all of these tenthousand bus proxies ... ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Starting in a network name?
Hi, I used ip netns commands to setup several network namespaces. Now I want to run a user-space (non-root) in one of those netspaces. ip netns exec NAME COMMAND seems to only work for root, not normal users. Is there a way to configure a systemd unit to run in a *specific* network namespace? I mean similar to, but more general than, PrivateNetwork=true and JoinsNamespaceOf= ... ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [RFT] DHCPv4 support in networkd
AFAIK Mac OSX does a trick here: it uses the last IP (still in the old lease file) and immediately configures the network with that. *) Then it does the DHCP, asking for the same IP. If the IP returned was changed, it will re-change. But usually it's the same IP address, and therefore on this OS DHCP doesn't take longer than static IP. Strictly speaking the DHCP protocol is not violated that way: DHCP itself works as expected, e.g. the DHCP packets are following the RFC. And ip clients should copy with changed IP addresses anyway, because DHCP can assign any IP address at renogiation time. *) it might do an RARP to find out if the IP is available ... ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [Bug] minor typo on systemd wiki page
On http://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/ To create and start a unit in the cgroup tree use the StartTransientUnit() method on the Manager object exposed by systemd's PID 1 on the bus, see the Bus API Documentation for details. This call takes for arguments. The last for should be four. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] /etc/machine-id handling in a non-initrd / embedded environment ?!?!
Hi all, I'm using systemd for embedded devices. The kernel is compiled for the target and I don't need / use an initrd, as all device drivers are known beforehand and I like the faster boot speed. That means that / is mounted read-only when systemd starts. However, systemd (and also journald, as it uses machine_id_setup) has a handling of /etc/machine-id that doesn't fit here. In effect, systemd+journald won't run in a system where root is readonly at boot time and where no /run exists because no initrd did run. What happens currently? 1. It tries to open /etc/machine-id and fails, because at that point in time /etc isn't writable. 2. Then it tries to open /etc/machine-id readonly, but again fails, no machine-id there 3. Now it tries to generate a machine ID and tries to write it into /run/machine-id. Again this fails, because /run is still on the same partition as /, and it is still not writable. FAIL ! Wouldn't it be better to just generate the machine-id internally and pass it by environment/command-line/some-other-means to journald? And write it later, once root is writable? Sure, theoretically I could create the machine-id file beforehand. But when putting my image onto 50+ devices, I want to have one identical image that I deploy, that I can check via SHA1 ... ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] /etc/machine-id handling in a non-initrd / embedded environment ?!?!
I was in error about this: 3. Now it tries to generate a machine ID and tries to write it into /run/machine-id. Again this fails, because /run is still on the same partition as /, and it is still not writable. FAIL ! When there is no writable or readable /etc/machine-id, then it won't even try to generate one, as this code here bails out with a return -errno;: fd = open(/etc/machine-id, O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY, 0444); if (fd = 0) writable = true; else { fd = open(/etc/machine-id, O_RDONLY|O_CLOEXEC|O_NOCTTY); if (fd 0) { log_error(Cannot open /etc/machine-id: %m); return -errno; } writable = false; } ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] /etc/machine-id handling in a non-initrd / embedded environment ?!?!
If I place an empty /etc/machine-id into the image, then /run/machine-id will be bind-mounted over it. But that file will be different whenever I boot. So obviously I want to save it, once my filesystem is fsck'd and mounted read-write. But if I do it like that ... umount /etc/machine-id cp /run/machine-id /etc/machine-id ... then and between step 1 and 2 some other process might fall on it's nose. I noticed that several systemd binaries directly access /etc/machine-id via sd_id128_get_machine(). That would mean a race condition, or? You should always mount a tmpfs as /run, it is not supposed to be the same as /. Omitting the /run tmpfs mount is not supported. Kay, you're replaying to my point 3. that I already have taken back :-) And no, I should *NOT* mount it --- how could I, without an initrd? I don't need to mount it, because systemd mounts it for me with one of the functions in src/core/mount-setup.c before calling machine_id_setup(). ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] /etc/machine-id handling in a non-initrd / embedded environment ?!?!
Maybe sd_id128_get_machine() could try first to read /etc/machine-id and use that. If it doesn't exist, it could read /run/machine-id and use that. If that doesn't exist we're doomed *) That would allow some save-code like this (quick'n'dirty untested) [Unit] Description=Save machine-id After=systemd-remount-fs.service ConditionPathExists=!/etc/machine-id ConditionPathExists=/run/machine-id [Service] Type=oneshot RemainAfterExit=yes ExecStart=cp -a /run/machine-id /etc/machine-id *) Note that the systemd I use (v208) will not boot if /etc/machine-id (not even an empty one) doesn't exist. Or, maybe it boots, but because of huge timeouts takes 20 minutes or so. So probably /run/machine-id should always be written by machine_id_setup(), even when no empty /etc/machine-id exists. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel