Re: [systemd-devel] [PATCH 2/2] localectl: print warning when there are options given on kernel cmdline
On Thu, Sep 25, 2014 at 04:47:58AM +0200, Zbigniew Jędrzejewski-Szmek wrote: On Wed, Sep 24, 2014 at 05:18:47PM +0200, Michal Sekletar wrote: --- src/core/locale-setup.c | 47 + src/locale/localectl.c | 50 src/shared/locale-util.c | 20 +++ src/shared/locale-util.h | 25 4 files changed, 100 insertions(+), 42 deletions(-) Both patches look good. Please push. Pushed now. Michal Zbyszek diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c index 7a41035..5177dbf 100644 --- a/src/core/locale-setup.c +++ b/src/core/locale-setup.c @@ -30,48 +30,11 @@ #include fileio.h #include strv.h #include env-util.h - -enum { -/* We don't list LC_ALL here on purpose. People should be - * using LANG instead. */ - -VARIABLE_LANG, -VARIABLE_LANGUAGE, -VARIABLE_LC_CTYPE, -VARIABLE_LC_NUMERIC, -VARIABLE_LC_TIME, -VARIABLE_LC_COLLATE, -VARIABLE_LC_MONETARY, -VARIABLE_LC_MESSAGES, -VARIABLE_LC_PAPER, -VARIABLE_LC_NAME, -VARIABLE_LC_ADDRESS, -VARIABLE_LC_TELEPHONE, -VARIABLE_LC_MEASUREMENT, -VARIABLE_LC_IDENTIFICATION, -_VARIABLE_MAX -}; - -static const char * const variable_names[_VARIABLE_MAX] = { -[VARIABLE_LANG] = LANG, -[VARIABLE_LANGUAGE] = LANGUAGE, -[VARIABLE_LC_CTYPE] = LC_CTYPE, -[VARIABLE_LC_NUMERIC] = LC_NUMERIC, -[VARIABLE_LC_TIME] = LC_TIME, -[VARIABLE_LC_COLLATE] = LC_COLLATE, -[VARIABLE_LC_MONETARY] = LC_MONETARY, -[VARIABLE_LC_MESSAGES] = LC_MESSAGES, -[VARIABLE_LC_PAPER] = LC_PAPER, -[VARIABLE_LC_NAME] = LC_NAME, -[VARIABLE_LC_ADDRESS] = LC_ADDRESS, -[VARIABLE_LC_TELEPHONE] = LC_TELEPHONE, -[VARIABLE_LC_MEASUREMENT] = LC_MEASUREMENT, -[VARIABLE_LC_IDENTIFICATION] = LC_IDENTIFICATION -}; +#include locale-util.h int locale_setup(char ***environment) { char **add; -char *variables[_VARIABLE_MAX] = {}; +char *variables[_VARIABLE_LC_MAX] = {}; int r = 0, i; if (detect_container(NULL) = 0) { @@ -121,13 +84,13 @@ int locale_setup(char ***environment) { } add = NULL; -for (i = 0; i _VARIABLE_MAX; i++) { +for (i = 0; i _VARIABLE_LC_MAX; i++) { char *s; if (!variables[i]) continue; -s = strjoin(variable_names[i], =, variables[i], NULL); +s = strjoin(locale_variable_to_string(i), =, variables[i], NULL); if (!s) { r = -ENOMEM; goto finish; @@ -157,7 +120,7 @@ int locale_setup(char ***environment) { finish: strv_free(add); -for (i = 0; i _VARIABLE_MAX; i++) +for (i = 0; i _VARIABLE_LC_MAX; i++) free(variables[i]); return r; diff --git a/src/locale/localectl.c b/src/locale/localectl.c index bf8b7b2..5917364 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -43,6 +43,8 @@ #include path-util.h #include utf8.h #include def.h +#include virt.h +#include fileio.h #include locale-util.h static bool arg_no_pager = false; @@ -81,6 +83,53 @@ typedef struct StatusInfo { const char *x11_options; } StatusInfo; +static void print_overriden_variables(void) { +int r; +char *variables[_VARIABLE_LC_MAX] = {}; +LocaleVariable j; +bool print_warning = true; + +if (detect_container(NULL) 0 || arg_host) +return; + +r = parse_env_file(/proc/cmdline, WHITESPACE, + locale.LANG, variables[VARIABLE_LANG], + locale.LANGUAGE, variables[VARIABLE_LANGUAGE], + locale.LC_CTYPE, variables[VARIABLE_LC_CTYPE], + locale.LC_NUMERIC, variables[VARIABLE_LC_NUMERIC], + locale.LC_TIME, variables[VARIABLE_LC_TIME], + locale.LC_COLLATE, variables[VARIABLE_LC_COLLATE], + locale.LC_MONETARY, variables[VARIABLE_LC_MONETARY], + locale.LC_MESSAGES, variables[VARIABLE_LC_MESSAGES], + locale.LC_PAPER, variables[VARIABLE_LC_PAPER], + locale.LC_NAME, variables[VARIABLE_LC_NAME], + locale.LC_ADDRESS,
Re: [systemd-devel] [PATCH] swap: introduce Discard property
Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl writes: On Wed, Sep 24, 2014 at 02:29:05PM +0200, Jan Synacek wrote: Process possible discard values from /etc/fstab. Hm, wouldn't it be enough to simply pass through the options like with mounts, using the Options= option? This might be less work and be more flexible. Zbyszek Swap options are special in that they're processed and used by the swapon(8) command. You cannot pass swapon -o options, as you can to ordinary mounts. And how many options for swapon, that at the same time can be specified in /etc/fstab, do we really care about? I'm not sure. -- Jan Synacek Software Engineer, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCHi v2] systemctl: add add-wants and add-requires verbs
Zbigniew Jędrzejewski-Szmek píše v St 24. 09. 2014 v 18:15 +0200: I don't understand the name method_add_install_dependency_unit_files. Why not just method_add_dependencies? After all, this is not like install, and does not work on the level of unit files, but units. Similarly for the dbus method name AddInstallDependencyUnitFiles. This works with unit files, similarly as 'enable', so I would really like to keep the UnitFiles part there. And the same for Install part, I wanted to make it obvious that this is somehow an alternative to [Install] section in unit file. -r = unit_file_load(c, info, path, root_dir, allow_symlink); +if (load) +r = unit_file_load(c, info, path, root_dir, allow_symlink); +else +r = access(path, F_OK) ? -errno : 0; Wouldn't it be nicer to push the 'load' parameter into unit_file_load(), and do the check there? I think that with your patch the support for root_dir is missing. Yep you are right, this will not work with --root, but I don't think that we want to have function unit_file_load(, bool really_load). Maybe it would be better to add function unit_file_exists. + based on preset configuration\n Extra line now? ;) for (int i=0; i100; i++) puts(Will double check my patches before sending them); Zbyszek But really thanks for review. Lukas ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Systemd-nspawn -- Canot add interface to container
Hi James, I'm having another issue with private networking in systemd-nspawn. This one I'm not so certain is a bug, but probably some kind of mistake on my part. Base on my reading of the systemd-nspawn man page though, I can't figure out what the problem is. Basically, all I'm tring to do is remove an interface from the host namespace and provide it to the container. Details are included below (This is systemd 216-r3 in Arch Linux ARM). [root@host01 ~]# systemd-nspawn --network-interface=wlan0 -M1 -bD /home/lanvpn/ Spawning container 1 on /home/lanvpn. Press ^] three times within 1s to kill container. Failed to move interface wlan0 to namespace: File exists actually netdev interfaces like wlan0 can not move into network namespaces by themselves. With wireless hardware, the underlying physical device (for example phy0) needs to move into the namespace. Which means that all netdev that belong to a specific phyX will move with it into the namespace. Try using iw phy phyname set netns pid to achieve this. Regards Marcel ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] udevd: SAS: use SAS addr + PHY id in by-path whenever possible.
On 09/24/2014 05:03 PM, Kay Sievers wrote: - Original Message - On Tue, Sep 23, 2014 at 01:55:09PM -0400, Kay Sievers wrote: - Original Message - We are not applying this patch now. It introduces a complete new scheme and we do not want to extend the current SCSI code, we only fix obvious bugs. Fine with me, however not sure what our story should be for years to come regarding SCSI stuff downstream. Simple as: Don't add new features to systemd/udev, only fix bugs. The by-path has been part of udev for a long time, the users of this feature are from the same camp as the users of the, 'enterprise storage'. Everyone has been happily using it, until someone found out that the values shown are incorrect. The patch posted here corrects the values so it can work as expected. You probably were confused by something, but this is _not_ a new feature it's a obvious bug fix. Please consider again inclusion of this patch. Tomas SCSI code needs to be maintained by someone who understands it and is capable and willing to maintain it in the long run. Systemd/udev maintainers lack the experience and cannot do that. New features need to happen in an existing or new storage related-package and not in the systemd/udev code base. Systemd+udev are supposed to be about providing a fairly complete basic environment. No, it is absolutely not. Things like enterprise storage technology is for sure not part of our task. We focus on the basic operating system tasks only. I don't see why an exception should be made for SAS disks. If necessary, we can bring additional people in, or maybe just wait for patches. No, we don't. We will move this out to an external package. This seems like a better solution than waiting for a project to be created to create and maintain a tiny amount of code and one line of udev rules. It is not tiny. It is complicated and has a long history of forth and back. Systemd/udev is just the wrong place to maintain it. I think that the failure mode is especially ugly here: if you have the hardware, but don't install this mythical extra package, systemd/udev provides one set of stable names. Then you install the extra package, and you get a different set. That is how *features* work, they require extra packages. SCSI, SAS, LVM, MD, enterprise storage, ... is _not_ part of systemd's task and should be maintained separately. Kay, any serious objections to applying only downstream for RHEL? Well, the currently created links will go away and potentially break existing users. Not sure what is acceptable here. I personally would not apply it to any released product. Right, so applying the patch as is is probably not OK. But we could provide the old names as an additional alias. This should be doable. Nope, no new features. Upstream systemd/udev will not apply or ship it. A new place in an externally maintained package is needed to add/improve the current code. Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCHi v2] systemctl: add add-wants and add-requires verbs
On Thu, Sep 25, 2014 at 10:09:40AM +0200, Lukáš Nykrýn wrote: Zbigniew Jędrzejewski-Szmek píše v St 24. 09. 2014 v 18:15 +0200: I don't understand the name method_add_install_dependency_unit_files. Why not just method_add_dependencies? After all, this is not like install, and does not work on the level of unit files, but units. Similarly for the dbus method name AddInstallDependencyUnitFiles. This works with unit files, similarly as 'enable', so I would really like to keep the UnitFiles part there. And the same for Install part, I wanted to make it obvious that this is somehow an alternative to [Install] section in unit file. OK. -r = unit_file_load(c, info, path, root_dir, allow_symlink); +if (load) +r = unit_file_load(c, info, path, root_dir, allow_symlink); +else +r = access(path, F_OK) ? -errno : 0; Wouldn't it be nicer to push the 'load' parameter into unit_file_load(), and do the check there? I think that with your patch the support for root_dir is missing. Yep you are right, this will not work with --root, but I don't think that we want to have function unit_file_load(, bool really_load). Maybe it would be better to add function unit_file_exists. I don't see this extra parameter as a problem. Getting the root_dir semantics right has proven to be really hard, so it is important to keep the number of places where we calculcate the path to minimum. If you have two functions, you'll have to add an if to pick which one to call in multiple places, and duplicate the logic in both functions, but the whole point was to avoid that. + based on preset configuration\n Extra line now? ;) for (int i=0; i100; i++) puts(Will double check my patches before sending them); :) Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH v3] systemctl: add add-wants and add-requires verbs
--- Changes in v3 - move don't load logic to unit_file_load - --help message should be finally fine TODO | 1 - man/systemctl.xml | 21 src/core/dbus-manager.c| 84 ++--- src/core/org.freedesktop.systemd1.conf | 4 ++ src/core/selinux-access.c | 29 ++ src/core/selinux-access.h | 3 ++ src/shared/install.c | 96 ++ src/shared/install.h | 11 src/systemctl/systemctl.c | 95 + 9 files changed, 304 insertions(+), 40 deletions(-) diff --git a/TODO b/TODO index 9ac6fac..923cbb8 100644 --- a/TODO +++ b/TODO @@ -450,7 +450,6 @@ Features: - systemctl mask should find all names by which a unit is accessible (i.e. by scanning for symlinks to it) and link them all to /dev/null - systemctl list-unit-files should list generated files (and probably with a new state generated for them, or so) - - systemctl: maybe add systemctl add-wants or so... * timer units: - timer units should get the ability to trigger when: diff --git a/man/systemctl.xml b/man/systemctl.xml index b28a3b7..c4ee308 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -1098,6 +1098,27 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service /varlistentry varlistentry + termcommandadd-wants|add-requires replaceableTARGET/replaceable + replaceableNAME/replaceable.../command + /term + + listitem +paraEnables one or more units similarly to commandenable/command, +but instead of looking to literal[Install]/literal section of +the unit file, adds literalWants/literal +resp. literalRequires/literal dependency to the specified +replaceableTARGET/replaceable. +/para + +paraThis command honors option--system/option, +option--user/option, option--runtime/option and +option--global/option in a similar way as +commandenable/command./para + + /listitem +/varlistentry + +varlistentry termcommandlink replaceableFILENAME/replaceable.../command/term listitem diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 533ce43..921a614 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -1562,9 +1562,6 @@ static int method_enable_unit_files_generic( sd_bus_error *error) { _cleanup_strv_free_ char **l = NULL; -#ifdef HAVE_SELINUX -char **i; -#endif UnitFileChange *changes = NULL; unsigned n_changes = 0; UnitFileScope scope; @@ -1588,18 +1585,9 @@ static int method_enable_unit_files_generic( if (r 0) return r; -#ifdef HAVE_SELINUX -STRV_FOREACH(i, l) { -Unit *u; - -u = manager_get_unit(m, *i); -if (u) { -r = selinux_unit_access_check(u, message, verb, error); -if (r 0) -return r; -} -} -#endif +r = selinux_unit_access_check_strv(l, message, m, verb, error); +if (r 0) +return r; scope = m-running_as == SYSTEMD_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER; @@ -1637,9 +1625,6 @@ static int method_mask_unit_files(sd_bus *bus, sd_bus_message *message, void *us static int method_preset_unit_files_with_mode(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_strv_free_ char **l = NULL; -#ifdef HAVE_SELINUX -char **i; -#endif UnitFileChange *changes = NULL; unsigned n_changes = 0; Manager *m = userdata; @@ -1674,18 +1659,9 @@ static int method_preset_unit_files_with_mode(sd_bus *bus, sd_bus_message *messa return -EINVAL; } -#ifdef HAVE_SELINUX -STRV_FOREACH(i, l) { -Unit *u; - -u = manager_get_unit(m, *i); -if (u) { -r = selinux_unit_access_check(u, message, enable, error); -if (r 0) -return r; -} -} -#endif +r = selinux_unit_access_check_strv(l, message, m, enable, error); +if (r 0) +return r; scope = m-running_as == SYSTEMD_SYSTEM ? UNIT_FILE_SYSTEM : UNIT_FILE_USER; @@ -1828,6 +1804,53 @@ static int method_preset_all_unit_files(sd_bus *bus, sd_bus_message *message, vo return reply_unit_file_changes_and_free(m, bus, message, -1, changes, n_changes); } +static int method_add_install_dependency_unit_files(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { +
Re: [systemd-devel] [HEADS-UP] Intent to remove readahead from systemd
On Thu, Aug 14, 2014 at 7:16 PM, Lennart Poettering lenn...@poettering.net wrote: So, I think with the release after the upcoming one we should just remove it from the systemd package and just throw it on the pile of historic cruft. So, yeah, here's the advance warning that this will be happening... (Well, unless somebody from the community who cares and wants to invest the necessary time in it steps up and gives it the love it really needs. If nobody does until that release, I will delete the component from systemd). No one objected to this, so I pushed the patch deleting it. If anyone wants to resurrect this in an external repo, it should be simple enough to extract it from git. Cheers, Tom ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Systemd-nspawn -- Canot add interface to container
On Thu, Sep 25, 2014 at 7:49 PM, James Lott ja...@lottspot.com wrote: Hi Marcel, Thanks for the help pointing that one out! With your guidance I was able to figure out that I'll need to run something like: iw phy phy0 set netns pid Unfortunately I'm having some trouble trying to figure out the network namespace PID to assign the phy0 interface to. Although I definitely have containers with private networking running, I can't view any information about their network namespaces Generally, using the PID of /any/ process in the container (e.g. the init) should work the same. `ip netns` only shows persistent namespaces which were given a name using the same tool. Containers generally don't bother with that. -- Mantas Mikulėnas graw...@gmail.com ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Systemd-nspawn -- Canot add interface to container
Hi Mantas, Thanks for the clarification. The first thing I tried actually was using the PID of the systemd-nspawn instance, like so [root@host01 lanvpn]# ps aux | grep -v grep | grep systemd-nspawn root 143 0.0 0.3 2884 728 ?Ss 08:42 0:00 /usr/bin/systemd-nspawn --network-bridge=switch1 -bD /home/proxy -M 0 root 4564 0.7 0.6 2884 1124 pts/3S+ 10:38 0:00 systemd- nspawn --private-network [root@host01 lanvpn]# iw phy phy0 set netns 4564 Upon re-attaching to the container, I didn't see the interface [root@lanvpn ~]# ip l 1: lo: LOOPBACK,UP,LOWER_UP mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 [root@lanvpn ~]# iw list [root@lanvpn ~]# I suppose at this point I'm probably using the iw interface incorrectly and should seek help from a more appropriate channel to address that? On Thursday 25 September 2014 20:11:56 Mantas Mikulėnas wrote: On Thu, Sep 25, 2014 at 7:49 PM, James Lott ja...@lottspot.com wrote: Hi Marcel, Thanks for the help pointing that one out! With your guidance I was able to figure out that I'll need to run something like: iw phy phy0 set netns pid Unfortunately I'm having some trouble trying to figure out the network namespace PID to assign the phy0 interface to. Although I definitely have containers with private networking running, I can't view any information about their network namespaces Generally, using the PID of /any/ process in the container (e.g. the init) should work the same. `ip netns` only shows persistent namespaces which were given a name using the same tool. Containers generally don't bother with that. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [Featur Request] Allow list of names in file.network
This is a minor feature request for systemd-networkd: my files in /etc/systemd/network/ all share the same pattern: [Match] Name=en* [Network] DHCP=yes [Match] Name=eth* [Network] DHCP=yes [Match] Name=usb* [Network] DHCP=yes I would like to be able to only write one file, like [Match] Name=en*,eth*,usb* [Network] DHCP=yes or maybe to imitate extended globs like so [Match] Name={en,eth,usb}* [Network] DHCP=yes This would greatly facilitate adding common options like custom DNS and so on. Thanks! ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [feature request] allow instances in file.preset
I really like the new preset directive, and I plan to use preset files to synchronise the services I launch at boot across my computers. However it is a bit cumbersome that preset files do not parse instanced services files. I could play with DefaultInstance in foobar@.service.d/ droplets and add foobar@.service in the preset file (this works); but this only allow to configure one instance. Thanks! ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [feature request] allow instances in file.preset
Damien Robert wrote in message m01rcj$dhh$2...@ger.gmane.org: I really like the new preset directive, and I plan to use preset files to synchronise the services I launch at boot across my computers. Also according to the man file systemd.preset and my test, while user systemd units are looked in user folders: $XDG_CONFIG_HOME/systemd/user/* $HOME/.config/systemd/user/* ... preset files are only looked in system folders: /etc/systemd/user-preset/*.preset ... Is there a reason for that? Thanks, Damien Robert ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] journal: build fix when LZ4 is enabled but XZ is not.
--- src/journal/journal-file.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index da2ef3b..6b4bf0d 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -78,7 +78,7 @@ typedef struct JournalFile { Hashmap *chain_cache; -#ifdef HAVE_XZ +#if defined(HAVE_XZ) || defined(HAVE_LZ4) void *compress_buffer; size_t compress_buffer_size; #endif -- 2.1.0 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Systemd-nspawn -- Canot add interface to container
On Thu, Sep 25, 2014 at 10:40:42AM -0700, James Lott wrote: Hi Mantas, Thanks for the clarification. The first thing I tried actually was using the PID of the systemd-nspawn instance, like so [root@host01 lanvpn]# ps aux | grep -v grep | grep systemd-nspawn root 143 0.0 0.3 2884 728 ?Ss 08:42 0:00 /usr/bin/systemd-nspawn --network-bridge=switch1 -bD /home/proxy -M 0 root 4564 0.7 0.6 2884 1124 pts/3S+ 10:38 0:00 systemd- nspawn --private-network [root@host01 lanvpn]# iw phy phy0 set netns 4564 systemd-nspawn is *outside* of the container. You should use the child of systemd-nspawn, i.e. the init process, instead. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] do not install factory/etc/pam.d if --disable-pam
--- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index 5312851..52f578b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2050,9 +2050,11 @@ endif dist_factory_etc_DATA = \ factory/etc/nsswitch.conf +if HAVE_PAM dist_factory_pam_DATA = \ factory/etc/pam.d/system-auth \ factory/etc/pam.d/other +endif # -- if ENABLE_FIRSTBOOT -- 2.1.0 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH 2/2] sysusers.d: split files to cope with split packages.
move each user/group creation to a file that represents its own split package, so it's possible to ship them in separate. --- Makefile.am| 33 +++-- sysusers.d/systemd-journal-remote.conf | 9 + sysusers.d/systemd-journal-upload.conf | 8 sysusers.d/systemd-journald.conf | 8 sysusers.d/systemd-kdbus.conf | 8 sysusers.d/systemd-networkd.conf | 8 sysusers.d/systemd-remote.conf | 10 -- sysusers.d/systemd-resolved.conf | 8 sysusers.d/systemd-timesyncd.conf | 8 sysusers.d/systemd.conf| 12 10 files changed, 88 insertions(+), 24 deletions(-) create mode 100644 sysusers.d/systemd-journal-remote.conf create mode 100644 sysusers.d/systemd-journal-upload.conf create mode 100644 sysusers.d/systemd-journald.conf create mode 100644 sysusers.d/systemd-kdbus.conf create mode 100644 sysusers.d/systemd-networkd.conf delete mode 100644 sysusers.d/systemd-remote.conf create mode 100644 sysusers.d/systemd-resolved.conf create mode 100644 sysusers.d/systemd-timesyncd.conf delete mode 100644 sysusers.d/systemd.conf diff --git a/Makefile.am b/Makefile.am index d8b7636..8a32880 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2038,8 +2038,37 @@ SYSINIT_TARGET_WANTS += \ systemd-sysusers.service dist_sysusers_DATA = \ - sysusers.d/systemd.conf \ - sysusers.d/systemd-remote.conf + sysusers.d/systemd-journald.conf + +if HAVE_MICROHTTPD +dist_sysusers_DATA += \ + sysusers.d/systemd-journal-remote.conf +endif + +if HAVE_LIBCURL +dist_sysusers_DATA += \ + sysusers.d/systemd-journal-upload.conf +endif + +if ENABLE_KDBUS +dist_sysusers_DATA += \ + sysusers.d/systemd-kdbus.conf +endif + +if ENABLE_NETWORKD +dist_sysusers_DATA += \ + sysusers.d/systemd-networkd.conf +endif + +if ENABLE_RESOLVED +dist_sysusers_DATA += \ + sysusers.d/systemd-resolved.conf +endif + +if ENABLE_TIMESYNCD +dist_sysusers_DATA += \ + sysusers.d/systemd-timesyncd.conf +endif nodist_sysusers_DATA = \ sysusers.d/basic.conf diff --git a/sysusers.d/systemd-journal-remote.conf b/sysusers.d/systemd-journal-remote.conf new file mode 100644 index 000..36bb51e --- /dev/null +++ b/sysusers.d/systemd-journal-remote.conf @@ -0,0 +1,9 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +u systemd-journal-gateway - systemd Journal Gateway +u systemd-journal-remote - systemd Journal Remote diff --git a/sysusers.d/systemd-journal-upload.conf b/sysusers.d/systemd-journal-upload.conf new file mode 100644 index 000..927d400 --- /dev/null +++ b/sysusers.d/systemd-journal-upload.conf @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +u systemd-journal-upload - systemd Journal Upload diff --git a/sysusers.d/systemd-journald.conf b/sysusers.d/systemd-journald.conf new file mode 100644 index 000..dcb01f6 --- /dev/null +++ b/sysusers.d/systemd-journald.conf @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +g systemd-journal - - diff --git a/sysusers.d/systemd-kdbus.conf b/sysusers.d/systemd-kdbus.conf new file mode 100644 index 000..13dce6a --- /dev/null +++ b/sysusers.d/systemd-kdbus.conf @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +u systemd-bus-proxy - systemd Bus Proxy diff --git a/sysusers.d/systemd-networkd.conf b/sysusers.d/systemd-networkd.conf new file mode 100644 index 000..208148d --- /dev/null +++ b/sysusers.d/systemd-networkd.conf @@ -0,0 +1,8 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +u systemd-network - systemd Network Management diff --git a/sysusers.d/systemd-remote.conf
[systemd-devel] [PATCH] only build and install systemd-bus-proxyd if --enable-kdbus
--- Makefile.am | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8a32880..62cf768 100644 --- a/Makefile.am +++ b/Makefile.am @@ -387,7 +387,6 @@ rootlibexec_PROGRAMS = \ systemd-ac-power \ systemd-sysctl \ systemd-sleep \ - systemd-bus-proxyd \ systemd-socket-proxyd \ systemd-update-done @@ -2468,6 +2467,10 @@ systemd_run_LDADD = \ libsystemd-shared.la # -- +if ENABLE_KDBUS +rootlibexec_PROGRAMS += \ + systemd-bus-proxyd + systemd_bus_proxyd_SOURCES = \ src/bus-proxyd/bus-proxyd.c \ src/bus-proxyd/bus-policy.c \ @@ -2489,7 +2492,6 @@ bus-proxyd-uninstall-hook: INSTALL_EXEC_HOOKS += bus-proxyd-install-hook UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook -if ENABLE_KDBUS nodist_systemunit_DATA += \ units/systemd-bus-proxyd@.service -- 2.1.0 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [feature request] allow instances in file.preset
On Thu, Sep 25, 2014 at 08:29:46PM +, Damien Robert wrote: Damien Robert wrote in message m01rcj$dhh$2...@ger.gmane.org: I really like the new preset directive, and I plan to use preset files to synchronise the services I launch at boot across my computers. Also according to the man file systemd.preset and my test, while user systemd units are looked in user folders: $XDG_CONFIG_HOME/systemd/user/* $HOME/.config/systemd/user/* ... preset files are only looked in system folders: /etc/systemd/user-preset/*.preset ... Is there a reason for that? This seems to be a mis-design. I'm pretty sure we should allow users to set their own presets, so those directories underneath the home dir should be added. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [feature request] allow instances in file.preset
On Thu, Sep 25, 2014 at 07:45:23PM +, Damien Robert wrote: I really like the new preset directive, and I plan to use preset files to synchronise the services I launch at boot across my computers. However it is a bit cumbersome that preset files do not parse instanced services files. I could play with DefaultInstance in foobar@.service.d/ droplets and add foobar@.service in the preset file (this works); but this only allow to configure one instance. Sounds like a useful feature. I don't see any reason why we shouldn't allow that. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] journal: build fix when LZ4 is enabled but XZ is not.
On Thu, Sep 25, 2014 at 06:08:02PM -0300, Gustavo Sverzut Barbieri wrote: --- src/journal/journal-file.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index da2ef3b..6b4bf0d 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -78,7 +78,7 @@ typedef struct JournalFile { Hashmap *chain_cache; -#ifdef HAVE_XZ +#if defined(HAVE_XZ) || defined(HAVE_LZ4) void *compress_buffer; size_t compress_buffer_size; #endif Thanks, applied. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] only build and install systemd-bus-proxyd if --enable-kdbus
On Thu, Sep 25, 2014 at 06:13:19PM -0300, Gustavo Sverzut Barbieri wrote: --- Makefile.am | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8a32880..62cf768 100644 --- a/Makefile.am +++ b/Makefile.am @@ -387,7 +387,6 @@ rootlibexec_PROGRAMS = \ systemd-ac-power \ systemd-sysctl \ systemd-sleep \ - systemd-bus-proxyd \ systemd-socket-proxyd \ systemd-update-done @@ -2468,6 +2467,10 @@ systemd_run_LDADD = \ libsystemd-shared.la # -- +if ENABLE_KDBUS +rootlibexec_PROGRAMS += \ + systemd-bus-proxyd + systemd_bus_proxyd_SOURCES = \ src/bus-proxyd/bus-proxyd.c \ src/bus-proxyd/bus-policy.c \ @@ -2489,7 +2492,6 @@ bus-proxyd-uninstall-hook: INSTALL_EXEC_HOOKS += bus-proxyd-install-hook UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook -if ENABLE_KDBUS nodist_systemunit_DATA += \ units/systemd-bus-proxyd@.service Applied. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] do not install factory/etc/pam.d if --disable-pam
On Thu, Sep 25, 2014 at 06:12:03PM -0300, Gustavo Sverzut Barbieri wrote: --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index 5312851..52f578b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2050,9 +2050,11 @@ endif dist_factory_etc_DATA = \ factory/etc/nsswitch.conf +if HAVE_PAM dist_factory_pam_DATA = \ factory/etc/pam.d/system-auth \ factory/etc/pam.d/other +endif Applied. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] journal-remote: initialize writer hashmap before use
Applied, with a small change. Zbyszek On Wed, Sep 24, 2014 at 11:59:06PM +1000, Jonathan Liu wrote: https://bugs.freedesktop.org/show_bug.cgi?id=83682 --- src/journal-remote/journal-remote.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index f06c2cb..b1cc6fd 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -913,6 +913,10 @@ static int remoteserver_init(RemoteServer *s, return r; } +r = init_writer_hashmap(s); +if (r 0) +return r; + STRV_FOREACH(file, arg_files) { const char *output_name; @@ -942,10 +946,6 @@ static int remoteserver_init(RemoteServer *s, return -EINVAL; } -r = init_writer_hashmap(s); -if (r 0) -return r; - if (arg_split_mode == JOURNAL_WRITE_SPLIT_NONE) { /* In this case we know what the writer will be called, so we can create it and verify that we can -- 2.1.0 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Systemd-networkd -- Cannot acquire DHCP lease on bridge interface
Hi, On Wed, Sep 24, 2014 at 08:14:55PM -0700, James Lott wrote: Hello, There is no .network file for the bridge. Systemd-networkd is currently only in charge of setting up the interface. As you can see from the provided output in my original email, I am running the dhcpcd service directly from the command line (the output from each run of the dhcpcd service is included in that email as well). I asked because you could try and see if networkd can acquire a lease by itself, without dhcpcd (I don't expect it to). Also, could you run dhcpcd with -d -t 0 (debug output, no timeout) to see what it's doing? I have seen a similar issue with networkd and bonding of interfaces. It turned out that the way networkd works with links is racy, so in ~70% of boots dhcp lease attempts failed both via networkd and dhcpcd. The only solution which I found was to use netctl (should be availabel on ALARM) where you can explicitly specify a precise order in which links should be managed. Cheers, -- Leonid Isaev GPG fingerprints: DA92 034D B4A8 EC51 7EA6 20DF 9291 EE8A 043C B8C4 C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D pgpLL9IO0V0UE.pgp Description: PGP signature ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] only build and install systemd-bus-proxyd if --enable-kdbus
On Thu, Sep 25, 2014 at 11:32 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: Applied. Isn't systemd-stdio-bridge used also on non-kdbus systems? -- Michał Bartoszkiewicz mbartoszkiew...@gmail.com ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [feature request] allow instances in file.preset
Zbigniew Jędrzejewski-Szmek wrote in message 20140925211702.gv29...@in.waw.pl: This seems to be a mis-design. I'm pretty sure we should allow users to set their own presets, so those directories underneath the home dir should be added. Ok great! I'll be happy to provide a patch but I have never hacked systemd before. Would something like that be ok? (not tested, just to see if I am in the right direction) Thanks, Damien Robert -- 8 - From 7755e4afc3dc24f50c97c28fd7c00fd576d882cc Mon Sep 17 00:00:00 2001 From: Damien Robert damien.olivier.robert+...@gmail.com Date: Fri, 26 Sep 2014 00:34:46 +0200 Subject: [PATCH 1/1] preset: read files in $XDG_CONFIG_HOME/systemd/user-preset/* This is the only way for a user to modify preset files as the other directory read /run/systemd/user-preset/*.preset /usr/lib/systemd/user-preset/*.preset are not user owned. --- man/systemd.preset.xml | 1 + src/shared/install.c | 24 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/man/systemd.preset.xml b/man/systemd.preset.xml index 55cb4de..9d414f4 100644 --- a/man/systemd.preset.xml +++ b/man/systemd.preset.xml @@ -49,6 +49,7 @@ parafilename/etc/systemd/system-preset/*.preset/filename/para parafilename/run/systemd/system-preset/*.preset/filename/para parafilename/usr/lib/systemd/system-preset/*.preset/filename/para + paraliterallayoutfilename$XDG_CONFIG_HOME/systemd/user-preset/*/filename parafilename/etc/systemd/user-preset/*.preset/filename/para parafilename/run/systemd/user-preset/*.preset/filename/para parafilename/usr/lib/systemd/user-preset/*.preset/filename/para diff --git a/src/shared/install.c b/src/shared/install.c index 61e572b..7981556 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1769,6 +1769,7 @@ UnitFileState unit_file_get_state( int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char *name) { _cleanup_strv_free_ char **files = NULL; +_cleanup_free_ char *user_preset = NULL; char **p; int r; @@ -1786,12 +1787,23 @@ int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char #endif NULL); else if (scope == UNIT_FILE_GLOBAL) -r = conf_files_list(files, .preset, root_dir, -/etc/systemd/user-preset, -/usr/local/lib/systemd/user-preset, -/usr/lib/systemd/user-preset, -NULL); -else +if (user_config_home(user_preset) = 0) { +user_preset = strappend(user_preset, -preset); +if (!user_preset) +return -ENOMEM; +r = conf_files_list(files, .preset, root_dir, +user_preset, +/etc/systemd/user-preset, + /usr/local/lib/systemd/user-preset, +/usr/lib/systemd/user-preset, +NULL); +} +else +r = conf_files_list(files, .preset, root_dir, +/etc/systemd/user-preset, + /usr/local/lib/systemd/user-preset, +/usr/lib/systemd/user-preset, +NULL); return 1; if (r 0) -- Patched on top of v216-385-g79d80fc (git version 2.1.0) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] only build and install systemd-bus-proxyd if --enable-kdbus
2014-09-26 0:28 GMT+02:00 Michał Bartoszkiewicz mbartoszkiew...@gmail.com: On Thu, Sep 25, 2014 at 11:32 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: Applied. Isn't systemd-stdio-bridge used also on non-kdbus systems? Yeah. I've had basically prepared a similar patch a few weeks ago when I realized that it's also used for systemd-stdio-bridge, which is also useful for non-kdbus systems. So this patch should be reverted again. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [feature request] allow instances in file.preset
On Thu, Sep 25, 2014 at 10:44:35PM +, Damien Robert wrote: Zbigniew Jędrzejewski-Szmek wrote in message 20140925211702.gv29...@in.waw.pl: This seems to be a mis-design. I'm pretty sure we should allow users to set their own presets, so those directories underneath the home dir should be added. Ok great! I'll be happy to provide a patch but I have never hacked systemd before. Would something like that be ok? (not tested, just to see if I am in the right direction) In general yes. Some specific notes below. -- 8 - From 7755e4afc3dc24f50c97c28fd7c00fd576d882cc Mon Sep 17 00:00:00 2001 From: Damien Robert damien.olivier.robert+...@gmail.com Date: Fri, 26 Sep 2014 00:34:46 +0200 Subject: [PATCH 1/1] preset: read files in $XDG_CONFIG_HOME/systemd/user-preset/* This is the only way for a user to modify preset files as the other directory read /run/systemd/user-preset/*.preset /usr/lib/systemd/user-preset/*.preset are not user owned. --- man/systemd.preset.xml | 1 + src/shared/install.c | 24 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/man/systemd.preset.xml b/man/systemd.preset.xml index 55cb4de..9d414f4 100644 --- a/man/systemd.preset.xml +++ b/man/systemd.preset.xml @@ -49,6 +49,7 @@ parafilename/etc/systemd/system-preset/*.preset/filename/para parafilename/run/systemd/system-preset/*.preset/filename/para parafilename/usr/lib/systemd/system-preset/*.preset/filename/para + paraliterallayoutfilename$XDG_CONFIG_HOME/systemd/user-preset/*/filename parafilename/etc/systemd/user-preset/*.preset/filename/para parafilename/run/systemd/user-preset/*.preset/filename/para parafilename/usr/lib/systemd/user-preset/*.preset/filename/para You seem to open an xml element, without closing it. diff --git a/src/shared/install.c b/src/shared/install.c index 61e572b..7981556 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1769,6 +1769,7 @@ UnitFileState unit_file_get_state( int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char *name) { _cleanup_strv_free_ char **files = NULL; +_cleanup_free_ char *user_preset = NULL; You can define this below, where it is used. char **p; int r; @@ -1786,12 +1787,23 @@ int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char #endif NULL); else if (scope == UNIT_FILE_GLOBAL) -r = conf_files_list(files, .preset, root_dir, -/etc/systemd/user-preset, -/usr/local/lib/systemd/user-preset, -/usr/lib/systemd/user-preset, -NULL); -else +if (user_config_home(user_preset) = 0) { +user_preset = strappend(user_preset, -preset); +if (!user_preset) +return -ENOMEM; +r = conf_files_list(files, .preset, root_dir, +user_preset, +/etc/systemd/user-preset, + /usr/local/lib/systemd/user-preset, +/usr/lib/systemd/user-preset, +NULL); +} +else +r = conf_files_list(files, .preset, root_dir, +/etc/systemd/user-preset, + /usr/local/lib/systemd/user-preset, +/usr/lib/systemd/user-preset, +NULL); Please align all the if's at the same level, not nested. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] only build and install systemd-bus-proxyd if --enable-kdbus
On Fri, Sep 26, 2014 at 12:59:29AM +0200, Michael Biebl wrote: 2014-09-26 0:28 GMT+02:00 Michał Bartoszkiewicz mbartoszkiew...@gmail.com: On Thu, Sep 25, 2014 at 11:32 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: Applied. Isn't systemd-stdio-bridge used also on non-kdbus systems? Yeah. I've had basically prepared a similar patch a few weeks ago when I realized that it's also used for systemd-stdio-bridge, which is also useful for non-kdbus systems. So this patch should be reverted again. Ooops, reverted. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Systemd-nspawn -- Canot add interface to container
Hi Zbyszek, Thanks for all your help! This is a new concept to me though, as I have never tried to refer to a process inside of a container from outside of the container before (I did not realize this was possible). Since specifying PID 1 would obviously be referring to the host system's init process, would you be willing to give me an example that might help me understand how I can specify an in-container PID from the host system? Thanks again for taking the time to help me grasp all of this :) On Sep 25, 2014, at 2:10 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: On Thu, Sep 25, 2014 at 10:40:42AM -0700, James Lott wrote: Hi Mantas, Thanks for the clarification. The first thing I tried actually was using the PID of the systemd-nspawn instance, like so [root@host01 lanvpn]# ps aux | grep -v grep | grep systemd-nspawn root 143 0.0 0.3 2884 728 ?Ss 08:42 0:00 /usr/bin/systemd-nspawn --network-bridge=switch1 -bD /home/proxy -M 0 root 4564 0.7 0.6 2884 1124 pts/3S+ 10:38 0:00 systemd- nspawn --private-network [root@host01 lanvpn]# iw phy phy0 set netns 4564 systemd-nspawn is *outside* of the container. You should use the child of systemd-nspawn, i.e. the init process, instead. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [feature request] allow instances in file.preset
[Resending to the list since I was not posting through gmane but through gmail this time and my post was rejected because I was not subscribed to the list. Sorry for the spam] From Zbigniew Jędrzejewski-Szmek, Fri 26 Sep 2014 at 01:00:11 (+0200) : + paraliterallayoutfilename$XDG_CONFIG_HOME/systemd/user-preset/*/filename You seem to open an xml element, without closing it. Oups! A hasty copy and paste from systemd.unit +_cleanup_free_ char *user_preset = NULL; You can define this below, where it is used. According to CODING_STYLE it is better to declare all variables at the top of the function. -else +if (user_config_home(user_preset) = 0) { +user_preset = strappend(user_preset, -preset); +if (!user_preset) +return -ENOMEM; +r = conf_files_list(files, .preset, root_dir, +user_preset, +/etc/systemd/user-preset, + /usr/local/lib/systemd/user-preset, +/usr/lib/systemd/user-preset, +NULL); +} +else +r = conf_files_list(files, .preset, root_dir, +/etc/systemd/user-preset, + /usr/local/lib/systemd/user-preset, +/usr/lib/systemd/user-preset, +NULL); Please align all the if's at the same level, not nested. In fact they are part of the outer 'else if () {' and i was missing some brackets. Here is an updated patch, but I really need to test it inside a container first; I'll send you a real version asap. Thanks for your comments! -- 8 --- From: Damien Robert damien.olivier.robert+...@gmail.com Date: Fri, 26 Sep 2014 00:34:46 +0200 Subject: [PATCH 1/1] preset: read files in $XDG_CONFIG_HOME/systemd/user-preset/* This is the only way for a user to modify preset files as the other directory read /run/systemd/user-preset/*.preset /usr/lib/systemd/user-preset/*.preset are not user owned. Signed-off-by: Damien Robert damien.olivier.robert+...@gmail.com --- man/systemd.preset.xml | 1 + src/shared/install.c | 26 -- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/man/systemd.preset.xml b/man/systemd.preset.xml index 55cb4de..3a45cbd 100644 --- a/man/systemd.preset.xml +++ b/man/systemd.preset.xml @@ -49,6 +49,7 @@ parafilename/etc/systemd/system-preset/*.preset/filename/para parafilename/run/systemd/system-preset/*.preset/filename/para parafilename/usr/lib/systemd/system-preset/*.preset/filename/para + paraliterallayoutfilename$XDG_CONFIG_HOME/systemd/user-preset/*/filename/literallayout/para parafilename/etc/systemd/user-preset/*.preset/filename/para parafilename/run/systemd/user-preset/*.preset/filename/para parafilename/usr/lib/systemd/user-preset/*.preset/filename/para diff --git a/src/shared/install.c b/src/shared/install.c index 61e572b..b666b96 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1769,6 +1769,7 @@ UnitFileState unit_file_get_state( int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char *name) { _cleanup_strv_free_ char **files = NULL; +_cleanup_free_ char *user_preset = NULL; char **p; int r; @@ -1785,12 +1786,25 @@ int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char /lib/systemd/system-preset, #endif NULL); -else if (scope == UNIT_FILE_GLOBAL) -r = conf_files_list(files, .preset, root_dir, -/etc/systemd/user-preset, -/usr/local/lib/systemd/user-preset, -/usr/lib/systemd/user-preset, -NULL); +else if (scope == UNIT_FILE_GLOBAL) { +if (user_config_home(user_preset) = 0) { +user_preset = strappend(user_preset, -preset); +if (!user_preset) +return -ENOMEM; +r = conf_files_list(files, .preset, root_dir, +user_preset, +/etc/systemd/user-preset, + /usr/local/lib/systemd/user-preset, +
Re: [systemd-devel] Systemd-networkd -- Cannot acquire DHCP lease on bridge interface
Hi Leonid! I asked because you could try and see if networkd can acquire a lease by itself, without dhcpcd (I don't expect it to). Actually, the reason I am using dhcpcd fro mthe command line is as a debugging measure, because I originally setup a .network file for this interface to attempt to allow systemd-networkd to handle acquiring the DHCP lease. In line with your expectations, this failed, so I tried using dhcpcd to see if I could glean what was happening. I will happily provide the disabled .network file I tried using if you would like to review it, but I'm fairly confident it isn't the issue. Also, could you run dhcpcd with -d -t 0 (debug output, no timeout) to see what it's doing? Always happy to gather more information! See the output below [root@host01 ~]# ip l show switch0 7: switch0: BROADCAST,MULTICAST,UP,LOWER_UP mtu 1500 qdisc noqueue state UP mode DEFAULT group default link/ether 4e:c1:ff:d9:d1:49 brd ff:ff:ff:ff:ff:ff [root@host01 ~]# dhcpcd -dd -t0 switch0 dhcpcd[361]: version 6.4.3 starting dhcpcd[361]: all: IPv6 kernel autoconf disabled dhcpcd[361]: switch0: IPv6 kernel autoconf disabled dhcpcd[361]: switch0: adding address fe80::4cc1::fed9:d149 dhcpcd[361]: if_addaddress6: Operation not supported dhcpcd[361]: switch0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks' PREINIT dhcpcd[361]: switch0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks' CARRIER dhcpcd[361]: DUID 00:01:00:01:c7:92:cd:f9:e2:b2:c0:dd:be:4e dhcpcd[361]: switch0: IAID ff:d9:d1:49 dhcpcd[361]: switch0: delaying DHCP for 0.7 seconds dhcpcd[361]: switch0: using ClientID 01:4e:c1:ff:d9:d1:49 dhcpcd[361]: switch0: soliciting a DHCP lease dhcpcd[361]: switch0: sending DISCOVER (xid 0x79fe0186), next in 4.5 seconds dhcpcd[361]: switch0: sending DISCOVER (xid 0x79fe0186), next in 7.7 seconds dhcpcd[361]: switch0: sending DISCOVER (xid 0x79fe0186), next in 15.2 seconds dhcpcd[361]: switch0: sending DISCOVER (xid 0x79fe0186), next in 31.5 seconds I have seen a similar issue with networkd and bonding of interfaces. It turned out that the way networkd works with links is racy, so in ~70% of boots dhcp lease attempts failed both via networkd and dhcpcd. The only solution which I found was to use netctl (should be availabel on ALARM) where you can explicitly specify a precise order in which links should be managed. Yuck. I'm really not a fan of netctl, and would probably sooner hack together some oneshot service files that manually setup the interfaces and acquire leases. So it sounds like systemd-networkd is not quite ready for prime time when it comes to being a complete interface management solution. I guess that's what I get for living life on the edge ;) On Thursday 25 September 2014 18:23:47 Leonid Isaev wrote: Hi, On Wed, Sep 24, 2014 at 08:14:55PM -0700, James Lott wrote: Hello, There is no .network file for the bridge. Systemd-networkd is currently only in charge of setting up the interface. As you can see from the provided output in my original email, I am running the dhcpcd service directly from the command line (the output from each run of the dhcpcd service is included in that email as well). I asked because you could try and see if networkd can acquire a lease by itself, without dhcpcd (I don't expect it to). Also, could you run dhcpcd with -d -t 0 (debug output, no timeout) to see what it's doing? I have seen a similar issue with networkd and bonding of interfaces. It turned out that the way networkd works with links is racy, so in ~70% of boots dhcp lease attempts failed both via networkd and dhcpcd. The only solution which I found was to use netctl (should be availabel on ALARM) where you can explicitly specify a precise order in which links should be managed. Cheers, ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Systemd-nspawn -- Canot add interface to container
Shame on me for not spending more time trying to figure this out before responding. Please ignore my previous sad plea for help, I understand fully now exactly what you're saying, and was able to successfully move the phy0 interface into my container. At this point, my challenge is going to be coordinating the movement of this interface within a service file, so I don't need to do it manually when starting the container... but I suppose I can write an ExecStartPost script which can manage this. Thanks again for all your help! On Thursday 25 September 2014 16:25:02 James Lott wrote: Hi Zbyszek, Thanks for all your help! This is a new concept to me though, as I have never tried to refer to a process inside of a container from outside of the container before (I did not realize this was possible). Since specifying PID 1 would obviously be referring to the host system's init process, would you be willing to give me an example that might help me understand how I can specify an in-container PID from the host system? Thanks again for taking the time to help me grasp all of this :) On Sep 25, 2014, at 2:10 PM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: On Thu, Sep 25, 2014 at 10:40:42AM -0700, James Lott wrote: Hi Mantas, Thanks for the clarification. The first thing I tried actually was using the PID of the systemd-nspawn instance, like so [root@host01 lanvpn]# ps aux | grep -v grep | grep systemd-nspawn root 143 0.0 0.3 2884 728 ?Ss 08:42 0:00 /usr/bin/systemd-nspawn --network-bridge=switch1 -bD /home/proxy -M 0 root 4564 0.7 0.6 2884 1124 pts/3S+ 10:38 0:00 systemd- nspawn --private-network [root@host01 lanvpn]# iw phy phy0 set netns 4564 systemd-nspawn is *outside* of the container. You should use the child of systemd-nspawn, i.e. the init process, instead. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH v3] systemctl: add add-wants and add-requires verbs
On Thu, Sep 25, 2014 at 03:26:45PM +0200, Lukas Nykryn wrote: +static int add_install_dependency(sd_bus *bus, char **args) { +_cleanup_strv_free_ char **names = NULL; +_cleanup_free_ char *target = NULL; +const char *verb = args[0]; +UnitFileInstallDependency dep; +int r = 0; + +if (!args[1]) +return 0; + +target = unit_name_mangle_with_suffix(args[1], MANGLE_NOGLOB, .target); +if (!target) +return log_oom(); + +r = mangle_names(args+2, names); +if (r 0) +return r; + +if (streq(verb, add-wants)) +dep = UNIT_FILE_INSTALL_DEPENDENCY_WANTS; +else if (streq(verb, add-requires)) +dep = UNIT_FILE_INSTALL_DEPENDENCY_REQUIRES; +else +assert_not_reached(Unknown verb); + +if (!bus || avoid_bus()) { +UnitFileChange *changes = NULL; +unsigned n_changes = 0; + +r = unit_file_add_install_dependency(arg_scope, arg_runtime, arg_root, names, target, dep, arg_force, changes, n_changes); I think this is missing some error reporting. When I run 'systmectl add-wants --root=/ ...' it obviously fails with permission denied. But no indication is given, apart from a non-zero return code. If I run it as root for a non-existent unit file, it doesn't say anything either. When I run it over dbus, the error message for a non-existent unit is Failed to execute operation: No such file or directory. It would be nice to at least include the unit name in the message. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH 1/7] make utmp/wtmp support configurable
On Wed, Sep 24, 2014 at 05:25:00PM +0200, Emil Renner Berthing wrote: For now just stub out the functions in utmp-wtmp.h so code will still compile. These stubs will be removed in the last commit in this patch series. --- Makefile.am | 34 +++--- configure.ac| 11 +++ man/runlevel.xml| 3 ++- man/systemd-update-utmp.service.xml | 2 +- src/core/build.h| 7 +++ src/shared/utmp-wtmp.h | 28 6 files changed, 76 insertions(+), 9 deletions(-) Hm, I understand why this is wanted, but the approach is rather intrusive. Can you instead modify utmp-wtmp.c to provide noop stubs when utmp is disabled? Other places should simply call the utmp_* functions as before. Possibly if there are other places where significant prepration is done before calling utmp_*, like server_forward_wall, stub implementations could be provided too, but only if it seems to make a significant difference at runtime. In general please try to minimize ifdefs, we have too many of those already. Zbyszek diff --git a/Makefile.am b/Makefile.am index 6b2ca29..47a1c07 100644 --- a/Makefile.am +++ b/Makefile.am @@ -378,7 +378,6 @@ rootlibexec_PROGRAMS = \ systemd \ systemd-cgroups-agent \ systemd-initctl \ - systemd-update-utmp \ systemd-shutdownd \ systemd-shutdown \ systemd-remount-fs \ @@ -391,6 +390,11 @@ rootlibexec_PROGRAMS = \ systemd-socket-proxyd \ systemd-update-done +if HAVE_UTMP +rootlibexec_PROGRAMS += \ + systemd-update-utmp +endif + systemgenerator_PROGRAMS = \ systemd-getty-generator \ systemd-fstab-generator \ @@ -517,8 +521,6 @@ nodist_systemunit_DATA = \ units/systemd-initctl.service \ units/systemd-shutdownd.service \ units/systemd-remount-fs.service \ - units/systemd-update-utmp.service \ - units/systemd-update-utmp-runlevel.service \ units/systemd-ask-password-wall.service \ units/systemd-ask-password-console.service \ units/systemd-sysctl.service \ @@ -544,6 +546,12 @@ nodist_systemunit_DATA = \ units/systemd-nspawn@.service \ units/systemd-update-done.service +if HAVE_UTMP +nodist_systemunit_DATA += \ + units/systemd-update-utmp.service \ + units/systemd-update-utmp-runlevel.service +endif + dist_userunit_DATA = \ units/user/basic.target \ units/user/default.target \ @@ -565,8 +573,6 @@ EXTRA_DIST += \ units/systemd-initctl.service.in \ units/systemd-shutdownd.service.in \ units/systemd-remount-fs.service.in \ - units/systemd-update-utmp.service.in \ - units/systemd-update-utmp-runlevel.service.in \ units/systemd-ask-password-wall.service.in \ units/systemd-ask-password-console.service.in \ units/systemd-sysctl.service.in \ @@ -589,6 +595,12 @@ EXTRA_DIST += \ units/systemd-nsp...@.service.in \ units/systemd-update-done.service.in +if HAVE_UTMP +EXTRA_DIST += \ + units/systemd-update-utmp.service.in \ + units/systemd-update-utmp-runlevel.service.in +endif + CLEANFILES += \ units/console-shell.service.m4 \ units/console-getty.service.m4 \ @@ -805,7 +817,6 @@ libsystemd_shared_la_SOURCES = \ src/shared/cgroup-show.h \ src/shared/unit-name.c \ src/shared/unit-name.h \ - src/shared/utmp-wtmp.c \ src/shared/utmp-wtmp.h \ src/shared/watchdog.c \ src/shared/watchdog.h \ @@ -879,6 +890,11 @@ libsystemd_shared_la_SOURCES = \ src/shared/switch-root.c \ src/shared/nss-util.h +if HAVE_UTMP +libsystemd_shared_la_SOURCES += \ + src/shared/utmp-wtmp.c +endif + nodist_libsystemd_shared_la_SOURCES = \ src/shared/errno-from-name.h \ src/shared/errno-to-name.h \ @@ -5920,8 +5936,12 @@ RUNLEVEL5_TARGET_WANTS += \ systemd-update-utmp-runlevel.service endif +if HAVE_UTMP +SYSINIT_TARGET_WANTS += \ + systemd-update-utmp.service +endif + SYSINIT_TARGET_WANTS += \ - systemd-update-utmp.service \ systemd-update-done.service LOCAL_FS_TARGET_WANTS += \ diff --git a/configure.ac b/configure.ac index 38a165c..34282b6 100644 --- a/configure.ac +++ b/configure.ac @@ -346,6 +346,16 @@ AS_IF([test x$enable_dbus != xno], [ AM_CONDITIONAL(HAVE_DBUS, [test $have_dbus = yes]) # -- +have_utmp=yes +AC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log handling]), +AS_CASE(x${enableval}, +[xyes], [have_utmp=yes], +[xno], [have_utmp=no], +AC_MSG_ERROR(bad value ${enableval} for --enable-utmp))) +AS_IF([test x$have_utmp = xyes], [AC_DEFINE(HAVE_UTMP, 1, [Define if utmp/wtmp support is
Re: [systemd-devel] Systemd-networkd -- Cannot acquire DHCP lease on bridge interface
Hi, On Thu, Sep 25, 2014 at 04:56:55PM -0700, James Lott wrote: Actually, the reason I am using dhcpcd fro mthe command line is as a debugging measure, because I originally setup a .network file for this interface to attempt to allow systemd-networkd to handle acquiring the DHCP lease. You could run networkd manually as # SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/systemd-networkd but this will also show endless DISCOVER attempts. In my case, I controlled the DHCP server, and according to its logs the lease is actually assigned but the client never receives it. So, I suspect a bug either in kernel or systemd because packets get lost in the bridge (or bond in my case). I suspect the former because restarting networkd didn't help (i.e. the DHCP lease never got received). Yuck. I'm really not a fan of netctl, and would probably sooner hack together some oneshot service files that manually setup the interfaces and acquire leases. So it sounds like systemd-networkd is not quite ready for prime time when it comes to being a complete interface management solution. I guess that's what I get for living life on the edge ;) Netctl is better in this situation because it allows ordering of different profiles w.r.t. each other because they are just systemd services (in networkd language this would be ordering of different .net* units if such existed). So you can first set up vlans, then bridge and do the DHCP stuff. There is an additional problem with networkd: you never know how to order against it. Sure there are network* targets (and ideally things _should_ work) but they are useless in this context because they can be reached before (virtual) devices are actually initialized. OTOH, when a netctl script successfully returns, you know that things are properly set up. Hopefully this thread attracts relevant attention because I don't know how to debug this... HTH, -- Leonid Isaev GPG fingerprints: DA92 034D B4A8 EC51 7EA6 20DF 9291 EE8A 043C B8C4 C0DF 20D0 C075 C3F1 E1BE 775A A7AE F6CB 164B 5A6D pgp88gtVXlpiz.pgp Description: PGP signature ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [systemd-commits] src/bus-proxyd test/bus-policy
On Wed, Sep 24, 2014 at 08:08:24AM -0700, Daniel Mack wrote: src/bus-proxyd/bus-policy.c | 200 --- src/bus-proxyd/bus-policy.h | 17 +++ src/bus-proxyd/test-bus-policy.c | 92 + test/bus-policy/methods.conf |2 4 files changed, 171 insertions(+), 140 deletions(-) New commits: commit 078ef7b85ad77ba999588f72b31a50ced5907692 Author: Daniel Mack dan...@zonque.org Date: Wed Sep 24 17:02:08 2014 +0200 bus-policy: split API for bus-proxyd Instead of operating on an sd_bus_message object, expose an API that has 4 functions: policy_check_own() policy_check_hello() policy_check_recv() policy_check_send() This also allows dropping extra code to parse message contents - the bus proxy already has dedicated code paths for that, and we can hook into those later. Tests amended accordingly. Hi, test-bus-policy fails intermittently in 'make distcheck' FAIL: test-bus-policy = Assertion 'policy_check_own(p, ucred, org.test.test1) == true' failed at ../src/bus-proxyd/test-bus-policy.c:58, function main(). Aborting. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel