Re: [systemd-devel] Socket is dying, how to automatically restart it?
Op 11 apr. 2013, om 21:09 heeft David Strauss da...@davidstrauss.net het volgende geschreven: On Wed, Apr 10, 2013 at 11:00 PM, Koen Kooi k...@dominion.thruhere.net wrote: restarting it once it fails Is it the socket or the service? socket ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Socket is dying, how to automatically restart it?
2013/4/11 Koen Kooi k...@dominion.thruhere.net: On Wed, Apr 10, 2013 at 11:00 PM, Koen Kooi k...@dominion.thruhere.net wrote: restarting it once it fails Is it the socket or the service? socket I believe I experienced this with PHP-FPM when I injected the sockets by abusing PHP-FPM's internal env var method for preserving sockets during a configuration reload. We didn't not study the problem in detail, but I did raise it with Lennart, especially after removing PHP-FPM's socket cleanup routine fixed the issue. Lennart's pretty confident that an application closing a socket on shutdown shouldn't break systemd's ability to listen. Still, there must be something else going on. -- David Strauss | da...@davidstrauss.net | +1 512 577 5827 [mobile] ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] New mount restriction? -- from Systemd policy?
On Mon, Apr 8, 2013 at 3:45 PM, Linda Walsh s...@tlinx.org wrote: Is it something that systemd needed to have? I.e. if it is made private would systemd care? If not, why would it have been made shared? Maybe a default in mount for root changed? Having the default mount propagation be shared solves some situations where a configuration item (say, PrivateTmp=) requires spawning a service in a Linux kernel file system namespace. Other mounts that happen post-service start aren't visible to the service, despite being visible and functional to administrators. It's hard to debug, and it won't show any obvious warnings or errors in logs. I don't believe making root private breaks systemd itself. I think it just makes other administration potentially confusing. -- David Strauss | da...@davidstrauss.net | +1 512 577 5827 [mobile] ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] New mount restriction? -- from Systemd policy?
Here is the commit with some background: http://cgit.freedesktop.org/systemd/systemd/commit/?id=b3ac5f8cb98757416d8660023d6564a7c411f0a0 On Thu, Apr 11, 2013 at 11:42 PM, David Strauss da...@davidstrauss.net wrote: On Mon, Apr 8, 2013 at 3:45 PM, Linda Walsh s...@tlinx.org wrote: Is it something that systemd needed to have? I.e. if it is made private would systemd care? If not, why would it have been made shared? Maybe a default in mount for root changed? Having the default mount propagation be shared solves some situations where a configuration item (say, PrivateTmp=) requires spawning a service in a Linux kernel file system namespace. Other mounts that happen post-service start aren't visible to the service, despite being visible and functional to administrators. It's hard to debug, and it won't show any obvious warnings or errors in logs. I don't believe making root private breaks systemd itself. I think it just makes other administration potentially confusing. -- David Strauss | da...@davidstrauss.net | +1 512 577 5827 [mobile] -- David Strauss | da...@davidstrauss.net | +1 512 577 5827 [mobile] ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [opensuse-kernel] New mount restriction?
I posted this to another, related thread, but here's the relevant commit and reasoning: http://cgit.freedesktop.org/systemd/systemd/commit/?id=b3ac5f8cb98757416d8660023d6564a7c411f0a0 On Tue, Apr 9, 2013 at 5:15 AM, Tetsuo Handa penguin-ker...@i-love.sakura.ne.jp wrote: Andrey Borzenkov wrote: This seems to be yest another fallout of changed systemd policy - it now makes / shared mount. bor@opensuse:~ sudo mount --move /tmp/old /tmp/new mount: wrong fs type, bad option, bad superblock on /tmp/old, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so bor@opensuse:~ sudo mount --make-private / bor@opensuse:~ sudo mount --move /tmp/old /tmp/new bor@opensuse:~ cd OK. Changing mount flags solves this problem. Current way of mounting seems to be breaking not only mount --move but also pivot_root. linux:~ # /usr/bin/newns /sbin/pivot_root /proc/ /proc/self/ Starting /sbin/pivot_root pivot_root: failed to change root from `/proc/' to `/proc/self/': Invalid argument linux:~ # mount --make-private / linux:~ # mount --make-private /proc/ linux:~ # /usr/bin/newns /sbin/pivot_root /proc/ /proc/self/ Starting /sbin/pivot_root linux:~ # ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- David Strauss | da...@davidstrauss.net | +1 512 577 5827 [mobile] ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH 0/2] journalctl arguments and filtering
From: Harald Hoyer har...@redhat.com This patch series improves the argument handling of journalctl. It ANDs all parameter like -b --unit= -p and multiple --unit= can be specified. The output of: # journalctl -u sshd.service -u crond.service -u sshd.service -b -p 0..7 is now, what you would expect it to be. Harald Hoyer (2): journal: add one more level on top with AND journalctl: specify --unit= and --user-unit multiple times man/journalctl.xml | 6 ++- src/journal/journal-internal.h | 2 +- src/journal/journalctl.c | 68 -- src/journal/sd-journal.c | 80 ++-- src/journal/test-journal-match.c | 16 +++- src/systemd/sd-journal.h | 1 + 6 files changed, 122 insertions(+), 51 deletions(-) -- 1.8.2 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH 2/2] journalctl: specify --unit= and --user-unit multiple times
From: Harald Hoyer har...@redhat.com Previously only one --unit= or --user-unit could be specified. With this patch, journalcrtl can show multiple units. $ journalctl -u systemd-udevd.service -u sshd.service -u crond.service -b -- Logs begin at Sa 2013-03-23 11:08:45 CET, end at Fr 2013-04-12 09:10:22 CEST. -- Apr 12 08:41:37 lenovo systemd[1]: Started udev Kernel Device Manager. Apr 12 08:41:37 lenovo systemd[1]: Stopped udev Kernel Device Manager. Apr 12 08:41:38 lenovo systemd[1]: Started udev Kernel Device Manager. Apr 12 08:41:38 lenovo crond[291]: (CRON) INFO (Syslog will be used instead of sendmail.) Apr 12 08:41:38 lenovo crond[291]: (CRON) INFO (running with inotify support) Apr 12 08:41:39 lenovo systemd[1]: Starting OpenSSH server daemon... Apr 12 08:41:39 lenovo systemd[1]: Started OpenSSH server daemon. Apr 12 08:41:39 lenovo sshd[355]: Server listening on 0.0.0.0 port 22. Apr 12 08:41:39 lenovo sshd[355]: Server listening on :: port 22. Apr 12 08:41:39 lenovo mtp-probe[373]: checking bus 1, device 8: /sys/devices/pci:00/:00:1a.0/usb1/1-1/1-1.5/1-1.5.6/1-1.5.6.2/1-1.5.6.2.1 --- man/journalctl.xml | 6 -- src/journal/journalctl.c | 55 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/man/journalctl.xml b/man/journalctl.xml index 144b54f..b291f11 100644 --- a/man/journalctl.xml +++ b/man/journalctl.xml @@ -332,7 +332,8 @@ (literal_SYSTEMD_UNIT=/literal) and additional matches for messages from systemd and messages about -coredumps for the specified unit. +coredumps for the specified unit./para +paraThis option can be specified multiple times. /para/listitem /varlistentry @@ -346,7 +347,8 @@ and literal_UID=/literal) and additional matches for messages from session systemd and messages about -coredumps for the specified unit. +coredumps for the specified unit./para +paraThis option can be specified multiple times. /para/listitem /varlistentry diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index e34ff62..759a896 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -80,8 +80,8 @@ static usec_t arg_interval = DEFAULT_FSS_INTERVAL_USEC; #endif static usec_t arg_since, arg_until; static bool arg_since_set = false, arg_until_set = false; -static const char *arg_unit = NULL; -static bool arg_unit_system; +static char **arg_system_units = NULL; +static char **arg_user_units = NULL; static const char *arg_field = NULL; static bool arg_catalog = false; static bool arg_reverse = false; @@ -437,13 +437,15 @@ static int parse_argv(int argc, char *argv[]) { break; case 'u': -arg_unit = optarg; -arg_unit_system = true; +r = strv_extend(arg_system_units, optarg); +if (r 0) +return log_oom(); break; case ARG_USER_UNIT: -arg_unit = optarg; -arg_unit_system = false; +r = strv_extend(arg_user_units, optarg); +if (r 0) +return log_oom(); break; case '?': @@ -611,25 +613,39 @@ static int add_this_boot(sd_journal *j) { return 0; } -static int add_unit(sd_journal *j) { +static int add_units(sd_journal *j) { _cleanup_free_ char *u = NULL; int r; +char **i; assert(j); -if (isempty(arg_unit)) -return 0; +STRV_FOREACH(i, arg_system_units) { +u = unit_name_mangle(*i); +if (!u) +return log_oom(); +r = add_matches_for_unit(j, u); +if (r 0) +return r; +r = sd_journal_add_disjunction(j); +if (r 0) +return r; +} -u = unit_name_mangle(arg_unit); -if (!u) -return log_oom(); +STRV_FOREACH(i, arg_user_units) { +u = unit_name_mangle(*i); +if (!u) +return log_oom(); -if (arg_unit_system) -r = add_matches_for_unit(j, u); -else r = add_matches_for_user_unit(j, u, getuid()); -if (r
[systemd-devel] [PATCH] cryptsetup: set the timeout to 0 by default
From: Harald Hoyer har...@redhat.com cryptsetup itself has no timeout as default from the beginning. So the default timeout has been 0 from the beginning. https://bugzilla.redhat.com/show_bug.cgi?id=949702 --- src/cryptsetup/cryptsetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index ae4aa8d..376f748 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -44,7 +44,7 @@ static unsigned opt_tries = 0; static bool opt_readonly = false; static bool opt_verify = false; static bool opt_discards = false; -static usec_t opt_timeout = DEFAULT_TIMEOUT_USEC; +static usec_t opt_timeout = 0; /* Options Debian's crypttab knows we don't: -- 1.8.2 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] core/device.c: fix possible segfault
From: Harald Hoyer har...@redhat.com https://bugs.freedesktop.org/show_bug.cgi?id=63189 better fail than segfault systemd[1]: Failed to load device unit: Invalid argument systemd[1]: Failed to process udev device event: Invalid argument --- src/core/device.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/device.c b/src/core/device.c index fb94868..abb6a05 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -312,6 +312,7 @@ fail: static int device_process_new_device(Manager *m, struct udev_device *dev, bool update_state) { const char *sysfs, *dn; struct udev_list_entry *item = NULL, *first = NULL; +int r; assert(m); @@ -319,7 +320,9 @@ static int device_process_new_device(Manager *m, struct udev_device *dev, bool u return -ENOMEM; /* Add the main unit named after the sysfs path */ -device_update_unit(m, dev, sysfs, true); +r = device_update_unit(m, dev, sysfs, true); +if (r) +return r; /* Add an additional unit for the device node */ if ((dn = udev_device_get_devnode(dev))) -- 1.8.2 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Per-instance override with foobar.service.d
foobar@.service and foobar@.service.d/myinstance.conf foobar@.service and foobar@myinstance.service.d/myinstance.conf This would be possible, if somebody implements it. which don't work so I guess this isn't implemented. If so, would something like that be a reasonable request to be considered ? I was thinking... foobar@.service foobar@.service.d/myfirstinstance.conf foobar@.service.d/mysecondinstance.conf The idea is that different sources (rpms, administrator, whatever) provide snippets that are then merged. So there's no central registration of snippet names, and the namespace cannot be reused for instances. where the relevant .conf would be selected based on the instance name. I was also wondering why the need for a separate sub-directory when there's only one file inside it. Could a file like foobar.service.conf be considered as an alternative (and, perhaps, foo...@myinstance.service.conf) There can be multiple files. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH V2] core/device.c: fix possible segfault
From: Harald Hoyer har...@redhat.com https://bugs.freedesktop.org/show_bug.cgi?id=63189 better fail than segfault systemd[1]: Failed to load device unit: Invalid argument systemd[1]: Failed to process udev device event: Invalid argument --- V2: Now checking for (r 0) rather than (r). src/core/device.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/device.c b/src/core/device.c index fb94868..734d3f3 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -312,6 +312,7 @@ fail: static int device_process_new_device(Manager *m, struct udev_device *dev, bool update_state) { const char *sysfs, *dn; struct udev_list_entry *item = NULL, *first = NULL; +int r; assert(m); @@ -319,7 +320,9 @@ static int device_process_new_device(Manager *m, struct udev_device *dev, bool u return -ENOMEM; /* Add the main unit named after the sysfs path */ -device_update_unit(m, dev, sysfs, true); +r = device_update_unit(m, dev, sysfs, true); +if (r 0) +return r; /* Add an additional unit for the device node */ if ((dn = udev_device_get_devnode(dev))) -- 1.8.2 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] PATCH - add ARM based Chromebook lid switch
Thanks Kay for pointing me in the right direction From fced3673ee1001dc905206f9a92ea2062f951d3c Mon Sep 17 00:00:00 2001 From: Robert Schweikert rjsch...@suse.com Date: Fri, 12 Apr 2013 12:08:16 -0400 Subject: [PATCH] rules: add lid switch of ARM based Chromebook as a power switch to logind --- src/login/70-power-switch.rules | 1 + 1 file changed, 1 insertion(+) diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules index 36fb827..d925ab7 100644 --- a/src/login/70-power-switch.rules +++ b/src/login/70-power-switch.rules @@ -9,5 +9,6 @@ ACTION==remove, GOTO=power_switch_end SUBSYSTEM==input, KERNEL==event*, SUBSYSTEMS==acpi, TAG+=power-switch SUBSYSTEM==input, KERNEL==event*, KERNELS==thinkpad_acpi, TAG+=power-switch +SUBSYSTEM==input, KERNEL==event*, KERNELS==gpio-keys.8, TAG+=power-switch LABEL=power_switch_end -- 1.8.1.4 -- Robert Schweikert MAY THE SOURCE BE WITH YOU SUSE-IBM Software Integration Center LINUX Tech Lead rjsch...@suse.com rschw...@ca.ibm.com 781-464-8147 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Python journal reader
Hi, In the python journal Reader, the splitting out of monotonic and realtime stamps, has affected `get_next` function as timestamp values are no longer present in the dictionary returned. Also the new `get_monotonic` and `get_realtime` functions are not run through the converters. Equally, the 'get' method added is not run through the converters. I also noted the additional `next` method doesn't work on python2, as it clashes with the iter `next` method (python3 not affected as it changes iter method to `__next__`) My suggestion with the python Reader `get_next` method is that the realtime and monotonic timestamps remain part of it, as these are key parts of a log entry, and two more lines in everyone's code to get them seems cumbersome. Equally also the cursor value. This also makes the output fields the same as the journalctl json format. (I agree it makes sense the _Reader object element to remain separate so close to actual C API). I'm not sure what the best approach to the `next` method issue is… Proposed changes below. I've add `get_cursor` to go through converters for consistency, even if not required currently. ``` diff --git a/src/python-systemd/journal.py b/src/python-systemd/journal.py index 48f57ac..c163ff7 100644 --- a/src/python-systemd/journal.py +++ b/src/python-systemd/journal.py @@ -189,6 +189,21 @@ class Reader(_Reader): for arg in args: super(Reader, self).add_match(arg) +def get(self, key): +return self._convert_field(key, super(Reader, self).get(key)) + +def get_realtime(self): +return self._convert_field( +'__REALTIME_TIMESTAMP', super(Reader, self).get_realtime()) + +def get_monotonic(self): +return self._convert_field( +'__MONOTONIC_TIMESTAMP', super(Reader, self).get_monotonic()) + +def get_cursor(self): +return self._convert_field( +'__CURSOR', super(Reader, self).get_cursor()) + def get_next(self, skip=1): Return the next log entry as a dictionary of fields. @@ -197,8 +212,13 @@ class Reader(_Reader): Entries will be processed with converters specified during Reader creation. -return self._convert_entry( +entry = self._convert_entry( super(Reader, self).get_next(skip)) +entry['__REALTIME_TIMESTAMP'] = self.get_realtime() +entry['__MONOTONIC_TIMESTAMP'] = self.get_monotonic() +entry['__CURSOR'] = self.get_cursor() + +return entry def query_unique(self, field): Return unique values appearing in the journal for given `field`. ``` Thanks -- Steven Hiscocks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] PATCH - add ARM based Chromebook lid switch
Op 12 apr. 2013, om 18:24 heeft Robert Schweikert rjsch...@suse.com het volgende geschreven: Thanks Kay for pointing me in the right direction From fced3673ee1001dc905206f9a92ea2062f951d3c Mon Sep 17 00:00:00 2001 From: Robert Schweikert rjsch...@suse.com Date: Fri, 12 Apr 2013 12:08:16 -0400 Subject: [PATCH] rules: add lid switch of ARM based Chromebook as a power switch to logind --- src/login/70-power-switch.rules | 1 + 1 file changed, 1 insertion(+) diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules index 36fb827..d925ab7 100644 --- a/src/login/70-power-switch.rules +++ b/src/login/70-power-switch.rules @@ -9,5 +9,6 @@ ACTION==remove, GOTO=power_switch_end SUBSYSTEM==input, KERNEL==event*, SUBSYSTEMS==acpi, TAG+=power-switch SUBSYSTEM==input, KERNEL==event*, KERNELS==thinkpad_acpi, TAG+=power-switch +SUBSYSTEM==input, KERNEL==event*, KERNELS==gpio-keys.8, TAG+=power-switch Won't that trigger on every gpio-keys entry that devicetree labels as 8? I don't think it's a lid switch for all boards with gpio-keys.8 out there and even if it was, the .8 is just as stable as ethX, you shouldn't depend on it. regards, Koen ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] PATCH - add ARM based Chromebook lid switch
El 12/04/13 13:24, Robert Schweikert escribió: Thanks Kay for pointing me in the right direction From fced3673ee1001dc905206f9a92ea2062f951d3c Mon Sep 17 00:00:00 2001 From: Robert Schweikert rjsch...@suse.com Date: Fri, 12 Apr 2013 12:08:16 -0400 Subject: [PATCH] rules: add lid switch of ARM based Chromebook as a power switch to logind --- src/login/70-power-switch.rules | 1 + 1 file changed, 1 insertion(+) diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules index 36fb827..d925ab7 100644 --- a/src/login/70-power-switch.rules +++ b/src/login/70-power-switch.rules @@ -9,5 +9,6 @@ ACTION==remove, GOTO=power_switch_end SUBSYSTEM==input, KERNEL==event*, SUBSYSTEMS==acpi, TAG+=power-switch SUBSYSTEM==input, KERNEL==event*, KERNELS==thinkpad_acpi, TAG+=power-switch +SUBSYSTEM==input, KERNEL==event*, KERNELS==gpio-keys.8, TAG+=power-switch LABEL=power_switch_end Hrmm.. I think we need a vendor/device check here too.. otherwise it will trigger on other unrelated machines.. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] Add support for initial state of NumLock
El 12/04/13 13:53, Stanislav Brabec escribió: Add support for setting of initial state of NumLock. Supported values are yes, no and bios (on x86 platforms). It sets NumLock in virtual consoles. If NumLock should be turned on, it also creates empty /run/numlock-on, which can be used e. g. for setting of X session default. This ports a feature that exists for a long time in SUSE to systemd. +AC_PATH_PROG([SETLEDS], [setleds], [/bin/setleds], [/usr/sbin:/sbin:/usr/bin:/bin]) +#include config.h +#include fcntl.h +#include sysexits.h +#include unistd.h + +int main (int argc, char *argv[]) { +static char *args[] = { SETLEDS, -D, +num, NULL }; + +if (argc != 2) +return EX_USAGE; +close (STDIN_FILENO); +if (open (argv[1], O_RDONLY) != STDIN_FILENO) +return EX_IOERR; +return execv(args[0], args); +} my objections start here ;) Why do we need a third party binary for an operation that could be done with single ioctl(0, KDSETLED... ? +#if defined(__i386__) || defined(__x86_64__) +if (vc_kbd_numlock strcasecmp(vc_kbd_numlock, bios) == 0) { + int fd; + char c; + + fd = open (/dev/mem, O_RDONLY); + lseek (fd, BIOS_DATA_AREA + BDA_KEYBOARD_STATUS_FLAGS_4, SEEK_SET); + read (fd, c, sizeof(char)); + if (c BDA_KSF4_NUMLOCK_MASK) + numlock = true; + close(fd); +} else +#endif huh, there is no error handling here.. +if (numlock) +close(open(/run/numlock-on, O_WRONLY|O_CREAT, 0644)); +else There is a touch function defined in util.h for that.,. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Journal issues
Hi, I'm having two issues in relation to the journal with my recent upgrade to v201. One issue, is that it appears that _MACHINE_ID field is missing the = character. I had a quick look, and I think the bug was introduced on the last part of the following commit: http://cgit.freedesktop.org/systemd/systemd/commit/src/journal/journald-server.c?id=adb435bb70815461eeddf44dd5d6f1fc2ad9026d The second issue, is it appears that _SOURCE_MONOTONIC_TIMESTAMP is being truncated to just _SOURC. I'm not clear where this issue was introduced. Both issues can be easily seen with journalctl output in export format. I've seen this issue on two of Arch Linux x86_64 systems. Thanks :) -- Steven Hiscocks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] Add support for initial state of NumLock
El 12/04/13 13:53, Stanislav Brabec escribió: Add support for setting of initial state of NumLock. Supported values are yes, no and bios (on x86 platforms). It sets NumLock in virtual consoles. If NumLock should be turned on, it also creates empty /run/numlock-on, which can be used e. g. for setting of X session default. This ports a feature that exists for a long time in SUSE to systemd. Please apply the attached patch on top of this one. From ae8b7d5c34c8301e60fc4b8617de4acac038c914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= crrodrig...@opensuse.org Date: Fri, 12 Apr 2013 19:32:47 -0300 Subject: [PATCH] Add error reporting and cleanup to kdb numlock patch. - Ensure we catch errors reading /dev/mem - declaration of fd shadows previous fd. - free vc_kbd_numlock too. --- src/vconsole/vconsole-setup.c | 33 + 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c index 1115985..8e2c378 100644 --- a/src/vconsole/vconsole-setup.c +++ b/src/vconsole/vconsole-setup.c @@ -285,19 +285,35 @@ int main(int argc, char **argv) { } #if defined(__i386__) || defined(__x86_64__) -if (vc_kbd_numlock strcasecmp(vc_kbd_numlock, bios) == 0) { - int fd; +if (vc_kbd_numlock strcaseeq(vc_kbd_numlock, bios)) { + int _cleanup_close_ fdmem; char c; - fd = open (/dev/mem, O_RDONLY); - lseek (fd, BIOS_DATA_AREA + BDA_KEYBOARD_STATUS_FLAGS_4, SEEK_SET); - read (fd, c, sizeof(char)); + fdmem = open (/dev/mem, O_RDONLY); + + if(fdmem 0) { + r = EXIT_FAILURE; + log_error(Failed to open /dev/mem: %m); + goto finish; + } + + if(lseek(fdmem, BIOS_DATA_AREA + BDA_KEYBOARD_STATUS_FLAGS_4, SEEK_SET) == (off_t) -1) { +r = EXIT_FAILURE; +log_error(Failed to seek /dev/mem: %m); +goto finish; + } + + if(read (fdmem, c, sizeof(char)) == -1) { +r = EXIT_FAILURE; +log_error(Failed to read /dev/mem: %m); +goto finish; + } + if (c BDA_KSF4_NUMLOCK_MASK) numlock = true; - close(fd); } else #endif - numlock = vc_kbd_numlock strcasecmp(vc_kbd_numlock, yes) == 0; + numlock = vc_kbd_numlock strcaseeq(vc_kbd_numlock, yes); if (utf8) enable_utf8(fd); else @@ -312,7 +328,7 @@ finish: if (keymap_pid 0) wait_for_terminate_and_warn(KBD_LOADKEYS, keymap_pid); if (numlock) -close(open(/run/numlock-on, O_WRONLY|O_CREAT, 0644)); +touch(/run/numlock-on); else unlink(/run/numlock-on); @@ -326,6 +342,7 @@ finish: free(vc_font); free(vc_font_map); free(vc_font_unimap); +free(vc_kbd_numlock); if (fd = 0) close_nointr_nofail(fd); -- 1.8.1.4 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Journal issues
2013/4/12 Steven Hiscocks steven-syst...@hiscocks.me.uk Hi, I'm having two issues in relation to the journal with my recent upgrade to v201. One issue, is that it appears that _MACHINE_ID field is missing the = character. I had a quick look, and I think the bug was introduced on the last part of the following commit: http://cgit.freedesktop.org/**systemd/systemd/commit/src/** journal/journald-server.c?id=**adb435bb70815461eeddf44dd5d6f1**fc2ad9026dhttp://cgit.freedesktop.org/systemd/systemd/commit/src/journal/journald-server.c?id=adb435bb70815461eeddf44dd5d6f1fc2ad9026d The second issue, is it appears that _SOURCE_MONOTONIC_TIMESTAMP is being truncated to just _SOURC. I'm not clear where this issue was introduced. Hi My guess is http://cgit.freedesktop.org/systemd/systemd/commit/src/journal/journald-server.c?id=a569398925430de1f8479262e8ab39502054f2e9 Both issues can be easily seen with journalctl output in export format. I've seen this issue on two of Arch Linux x86_64 systems. Thanks :) A patch to fix this follows up. On an unrelated note: Is DECIMAL_STR_MAX() in macro.h broken for types longer than 64 bit, or am I just too thick to understand this line: sizeof(type) = 8 ? 20 : sizeof(int[-2*(sizeof(type) 8)]))) ? Thanks Mirco ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Journal issues
On Sat, Apr 13, 2013 at 01:00:02AM +0200, Mirco Tischler wrote: 2013/4/12 Steven Hiscocks steven-syst...@hiscocks.me.uk Hi, I'm having two issues in relation to the journal with my recent upgrade to v201. One issue, is that it appears that _MACHINE_ID field is missing the = character. I had a quick look, and I think the bug was introduced on the last part of the following commit: http://cgit.freedesktop.org/**systemd/systemd/commit/src/** journal/journald-server.c?id=**adb435bb70815461eeddf44dd5d6f1**fc2ad9026dhttp://cgit.freedesktop.org/systemd/systemd/commit/src/journal/journald-server.c?id=adb435bb70815461eeddf44dd5d6f1fc2ad9026d The second issue, is it appears that _SOURCE_MONOTONIC_TIMESTAMP is being truncated to just _SOURC. I'm not clear where this issue was introduced. Hi My guess is http://cgit.freedesktop.org/systemd/systemd/commit/src/journal/journald-server.c?id=a569398925430de1f8479262e8ab39502054f2e9 Both issues can be easily seen with journalctl output in export format. I've seen this issue on two of Arch Linux x86_64 systems. Thanks :) A patch to fix this follows up. On an unrelated note: Is DECIMAL_STR_MAX() in macro.h broken for types longer than 64 bit, or am I just too thick to understand this line: sizeof(type) = 8 ? 20 : sizeof(int[-2*(sizeof(type) 8)]))) That's what's called an inline compile time check ;) Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] journal: fix broken tags _SOURCE_REALTIME_TIMESTAMP and _MACHINE_ID
--- src/journal/journald-server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 53e3830..be84323 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -538,7 +538,7 @@ static void dispatch_message_real( char pid[sizeof(_PID=) + DECIMAL_STR_MAX(ucred-pid)], uid[sizeof(_UID=) + DECIMAL_STR_MAX(ucred-uid)], gid[sizeof(_GID=) + DECIMAL_STR_MAX(ucred-gid)], -source_time[sizeof(_SOURCE_REALTIME_TIMESTAMP= + DECIMAL_STR_MAX(usec_t))], +source_time[sizeof(_SOURCE_REALTIME_TIMESTAMP=) + DECIMAL_STR_MAX(usec_t)], boot_id[sizeof(_BOOT_ID=) + 32] = _BOOT_ID=, machine_id[sizeof(_MACHINE_ID=) + 32] = _MACHINE_ID=; @@ -699,7 +699,7 @@ static void dispatch_message_real( r = sd_id128_get_machine(id); if (r = 0) { -sd_id128_to_string(id, machine_id + sizeof(_MACHINE_ID) - 1); +sd_id128_to_string(id, machine_id + sizeof(_MACHINE_ID=) - 1); IOVEC_SET_STRING(iovec[n++], machine_id); } -- 1.8.2.1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Journal issues
On 13/04/13 00:00, Mirco Tischler wrote: 2013/4/12 Steven Hiscocks steven-syst...@hiscocks.me.uk mailto:steven-syst...@hiscocks.me.uk Hi, I'm having two issues in relation to the journal with my recent upgrade to v201. One issue, is that it appears that _MACHINE_ID field is missing the = character. I had a quick look, and I think the bug was introduced on the last part of the following commit: http://cgit.freedesktop.org/__systemd/systemd/commit/src/__journal/journald-server.c?id=__adb435bb70815461eeddf44dd5d6f1__fc2ad9026d http://cgit.freedesktop.org/systemd/systemd/commit/src/journal/journald-server.c?id=adb435bb70815461eeddf44dd5d6f1fc2ad9026d The second issue, is it appears that _SOURCE_MONOTONIC_TIMESTAMP is being truncated to just _SOURC. I'm not clear where this issue was introduced. Hi My guess is http://cgit.freedesktop.org/systemd/systemd/commit/src/journal/journald-server.c?id=a569398925430de1f8479262e8ab39502054f2e9 Ah. I did look at this and it seemed okay...but now I've seen your patch it's jumped out at me ;) Both issues can be easily seen with journalctl output in export format. I've seen this issue on two of Arch Linux x86_64 systems. Thanks :) A patch to fix this follows up. Thanks Mirco :) On an unrelated note: Is DECIMAL_STR_MAX() in macro.h broken for types longer than 64 bit, or am I just too thick to understand this line: sizeof(type) = 8 ? 20 : sizeof(int[-2*(sizeof(type) 8)]))) ? Thanks Mirco -- Steven Hiscocks ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] journal: fix broken tags _SOURCE_REALTIME_TIMESTAMP and _MACHINE_ID
On Sat, Apr 13, 2013 at 01:03:49AM +0200, Mirco Tischler wrote: --- src/journal/journald-server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Applied! Zbyszek diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 53e3830..be84323 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -538,7 +538,7 @@ static void dispatch_message_real( char pid[sizeof(_PID=) + DECIMAL_STR_MAX(ucred-pid)], uid[sizeof(_UID=) + DECIMAL_STR_MAX(ucred-uid)], gid[sizeof(_GID=) + DECIMAL_STR_MAX(ucred-gid)], -source_time[sizeof(_SOURCE_REALTIME_TIMESTAMP= + DECIMAL_STR_MAX(usec_t))], +source_time[sizeof(_SOURCE_REALTIME_TIMESTAMP=) + DECIMAL_STR_MAX(usec_t)], boot_id[sizeof(_BOOT_ID=) + 32] = _BOOT_ID=, machine_id[sizeof(_MACHINE_ID=) + 32] = _MACHINE_ID=; @@ -699,7 +699,7 @@ static void dispatch_message_real( r = sd_id128_get_machine(id); if (r = 0) { -sd_id128_to_string(id, machine_id + sizeof(_MACHINE_ID) - 1); +sd_id128_to_string(id, machine_id + sizeof(_MACHINE_ID=) - 1); IOVEC_SET_STRING(iovec[n++], machine_id); } -- 1.8.2.1 ___ 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] Journal issues
2013/4/13 Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl On Sat, Apr 13, 2013 at 01:00:02AM +0200, Mirco Tischler wrote: 2013/4/12 Steven Hiscocks steven-syst...@hiscocks.me.uk Hi, I'm having two issues in relation to the journal with my recent upgrade to v201. One issue, is that it appears that _MACHINE_ID field is missing the = character. I had a quick look, and I think the bug was introduced on the last part of the following commit: http://cgit.freedesktop.org/**systemd/systemd/commit/src/** journal/journald-server.c?id=**adb435bb70815461eeddf44dd5d6f1**fc2ad9026dhttp://cgit.freedesktop.org/systemd/systemd/commit/src/journal/journald-server.c?id=adb435bb70815461eeddf44dd5d6f1fc2ad9026d The second issue, is it appears that _SOURCE_MONOTONIC_TIMESTAMP is being truncated to just _SOURC. I'm not clear where this issue was introduced. Hi My guess is http://cgit.freedesktop.org/systemd/systemd/commit/src/journal/journald-server.c?id=a569398925430de1f8479262e8ab39502054f2e9 Both issues can be easily seen with journalctl output in export format. I've seen this issue on two of Arch Linux x86_64 systems. Thanks :) A patch to fix this follows up. On an unrelated note: Is DECIMAL_STR_MAX() in macro.h broken for types longer than 64 bit, or am I just too thick to understand this line: sizeof(type) = 8 ? 20 : sizeof(int[-2*(sizeof(type) 8)]))) That's what's called an inline compile time check ;) Zbyszek Makes sense. Thanks :) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] [RFCv4] Add Listen* to dbus properties
On Fri, Apr 05, 2013 at 07:16:59PM +0200, Lennart Poettering wrote: On Wed, 03.04.13 23:12, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote: So, consider adding some form of numbering to the list of listen addresses. Perhaps something like: 0: ListenStream: /tmp/stream1 1: ListenDatagram: /tmp/stream2 Hi, I forgot to reply to this, and just remembered looking at Lennart's TODO prunning. Numbering from 0 (or 1) would be misleading, because the sockets get passed as 3, 4, etc. But numbering from 3 would be misleading too, because when more than one .socket is used, the fd's from the second .socket and subsequent ones are shifted. I don't think that there's a way to sanely number those sockets without complicating things significantly. Also, it wouldn't fit the current layout scheme :) OTOH, just counting them by hand should be easy enough. I think that having more than one or two is quite rare. I fully agree with Zbyszek. The order matters enough to show them with the original order, but OTOH is too much of an implementation detail that should irrelevant to the admin to emphasize it in the output by prefixing them with numbering. BTW, semi-related to this: I wonder if we should add a new set of commands to systemctl that lists sockets, timers path units in an alternative output mode, i.e. where they aren't ordered by unit names, but rather by the resource name the units cover. For example, for systemctl list-sockets it could do: LISTEN UNIT ACIVATES 127.0.0.1:4711 foobar.socket foobar.service /run/systed/journal waldo.socket waldo.socket I pushed something like that. It's a bit bare-bones right now. A surprising amount of code was requried (300 lines), but adding smarts should be easy now. I think it would be nice to e.g. show socket-units listening on external addresses or those activating services under root in red or something. Zbyszek And for systemctl list-timers or so it could give a break-down of all active timer events with the time the expire next as first column. Something like this: NEXTLEFTUNIT ACTIVATES 2013-06-12 12:34:11 4 months 5 days foobar.timer foobar.service 2013-05-01 07:31:51 2 months 3 days waldo.timer waldo.service (The latter was proposed by viking-ice on the hackfest iirc, all i am suggesting is to do the same for sockets and other trigger units) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] PATCH - add ARM based Chromebook lid switch
On Fri, Apr 12, 2013 at 10:58 PM, Cristian Rodríguez crrodrig...@opensuse.org +SUBSYSTEM==input, KERNEL==event*, KERNELS==gpio-keys.8, TAG+=power-switch LABEL=power_switch_end Hrmm.. I think we need a vendor/device check here too.. otherwise it will trigger on other unrelated machines.. Yeah, we cannot ship such generic things that way. Does that box have any vendor/product information, which can be used to identify the hardware? On x86 we have DMI data, but that is usually not available on ARM. Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH v2] tools: add static-nodes tool
This tool reads modules.devname from the current kernel directory and outputs the information. For now only the tmpfiles.d(5) format is supported, but more could easily be added in the future if there is a need. When booting with systemd, the new tool is called at boot to instruct systemd-tmpfiles to create the necessary static modules before starting systemd-udevd. This means nothing but kmod needs to reads the private files under /lib/modules/. Cc: linux-hotp...@vger.kernel.org Cc: systemd-devel@lists.freedesktop.org --- v2: adressed concerns raised by Dave, and made the tool a bit more generic so more output formats may be added in the future as suggested by Lucas. Also included the systemd unit file to hook this up with systemd. Makefile.am| 20 - configure.ac | 8 ++ tools/kmod-static-nodes.service.in | 16 tools/kmod.c | 1 + tools/kmod.h | 1 + tools/static-nodes.c | 163 + 6 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 tools/kmod-static-nodes.service.in create mode 100644 tools/static-nodes.c diff --git a/Makefile.am b/Makefile.am index 9feaf96..333e861 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,6 +36,9 @@ SED_PROCESS = \ %.pc: %.pc.in Makefile $(SED_PROCESS) +%.service: %.service.in Makefile + $(SED_PROCESS) + LIBKMOD_CURRENT=4 LIBKMOD_REVISION=2 LIBKMOD_AGE=2 @@ -88,6 +91,17 @@ pkgconfig_DATA = libkmod/libkmod.pc EXTRA_DIST += libkmod/libkmod.pc.in CLEANFILES += libkmod/libkmod.pc +if HAVE_SYSTEMD +systemdsystemunit_DATA = tools/kmod-static-nodes.service +EXTRA_DIST += tools/kmod-static-nodes.service.in +CLEANFILES += tools/kmod-static-nodes.service + +install-data-hook: + $(MKDIR_P) $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants + ln -sf ../kmod-static-nodes.service \ + $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/kmod-static-nodes.service +endif + install-exec-hook: if test $(libdir) != $(rootlibdir); then \ $(MKDIR_P) $(DESTDIR)$(rootlibdir) \ @@ -109,7 +123,8 @@ noinst_SCRIPTS = tools/insmod tools/rmmod tools/lsmod \ tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/lsmod.c \ tools/rmmod.c tools/insmod.c \ tools/modinfo.c tools/modprobe.c \ -tools/depmod.c tools/log.h tools/log.c +tools/depmod.c tools/log.h tools/log.c \ +tools/static-nodes.c tools_kmod_LDADD = libkmod/libkmod-util.la \ libkmod/libkmod.la @@ -211,7 +226,8 @@ testsuite-distclean: DISTCLEAN_LOCAL_HOOKS += testsuite-distclean EXTRA_DIST += testsuite/rootfs-pristine -DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --sysconfdir=/etc --with-zlib +DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --sysconfdir=/etc --with-zlib \ + --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) distclean-local: $(DISTCLEAN_LOCAL_HOOKS) diff --git a/configure.ac b/configure.ac index 566b317..af5ed52 100644 --- a/configure.ac +++ b/configure.ac @@ -76,6 +76,13 @@ AS_IF([test x$with_zlib != xno], [ AC_MSG_NOTICE([zlib support not requested]) ]) +AC_ARG_WITH([systemdsystemunitdir], +AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), +[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) +if test x$with_systemdsystemunitdir != xno; then +AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) +fi +AM_CONDITIONAL(HAVE_SYSTEMD, [test -n $with_systemdsystemunitdir -a x$with_systemdsystemunitdir != xno ]) # # --enable- @@ -200,6 +207,7 @@ AC_MSG_RESULT([ compiler: ${CC} cflags: ${with_cflags} ${CFLAGS} ldflags:${with_ldflags} ${LDFLAGS} + systemdsystemunitdir: ${with_systemdsystemunitdir} tools: ${enable_tools} logging:${enable_logging} diff --git a/tools/kmod-static-nodes.service.in b/tools/kmod-static-nodes.service.in new file mode 100644 index 000..be8482e --- /dev/null +++ b/tools/kmod-static-nodes.service.in @@ -0,0 +1,16 @@ +# This file is part of kmod. +# +# kmod 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. + +[Unit] +Description=Create list of static nodes to be created in /dev +DefaultDependencies=no +Before=sysinit.target systemd-static-nodes.service + +[Service] +Type=oneshot +ExecStart=/bin/mkdir -p /run/tmpfiles.d +ExecStart=@prefix@/bin/kmod static-nodes
Re: [systemd-devel] [PATCH] Add support for initial state of NumLock
On Sat, Apr 13, 2013 at 12:36 AM, Cristian Rodríguez crrodrig...@opensuse.org wrote: El 12/04/13 13:53, Stanislav Brabec escribió: Add support for setting of initial state of NumLock. Supported values are yes, no and bios (on x86 platforms). It sets NumLock in virtual consoles. If NumLock should be turned on, it also creates empty /run/numlock-on, which can be used e. g. for setting of X session default. This ports a feature that exists for a long time in SUSE to systemd. Please apply the attached patch on top of this one. Upstream systemd should not add more features to the utterly broken kernel console font/keymap/... handling, it should stay as minimal as possible and not get any fancy things. What we have today does not even work, it's full of bugs, issues we can't solve, and full of promises we can't hold today. Kernel VTs are just a forgotten and not-really-working kernel facility, nobody will fix it for us, hence we should not make it more complicated as it already is, but work on leaving it behind. If things work out as planned, we will switch all the kernel VTs over to sane and proper font/keymap handling in userspace (kmscon or whatever it will be called then) and leave the original kernel VTs as a plain debug console which is no longer in use by default. If distributions needs and supports such a console features they better ship it downstream, upstream should not fiddle with even more weird kernel switches here. We do not consider these things as features everybody should have. Kernel VTs not the future, not the direction we are heading; every feature we add here now, we kind-of need to carry over to the new world where people are working on, and the fewer things we need to support the better. Thanks for understanding, Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel