Re: [systemd-devel] [PATCH 1/2] analyze: show generators on plot
On Wed, May 8, 2013 at 6:03 PM, Umut Tezduyar u...@tezduyar.com wrote: --- src/analyze/systemd-analyze.c | 42 src/core/dbus-manager.c |8 ++ src/core/manager.c|2 + src/core/manager.h|2 + 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c index bb86ec7..df3d307 100644 --- a/src/analyze/systemd-analyze.c +++ b/src/analyze/systemd-analyze.c @@ -78,6 +78,8 @@ struct boot_times { usec_t initrd_time; usec_t userspace_time; usec_t finish_time; +usec_t generators_start_time; +usec_t generators_finish_time; }; struct unit_times { char *name; @@ -303,7 +305,17 @@ static int acquire_boot_times(DBusConnection *bus, struct boot_times **bt) { /org/freedesktop/systemd1, org.freedesktop.systemd1.Manager, FinishTimestampMonotonic, -times.finish_time) 0) +times.finish_time) 0 || +bus_get_uint64_property(bus, +/org/freedesktop/systemd1, +org.freedesktop.systemd1.Manager, +GeneratorsStartTimestampMonotonic, +times.generators_start_time) 0 || +bus_get_uint64_property(bus, +/org/freedesktop/systemd1, +org.freedesktop.systemd1.Manager, +GeneratorsFinishTimestampMonotonic, +times.generators_finish_time) 0) return -EIO; if (times.finish_time = 0) { @@ -459,7 +471,8 @@ static int analyze_plot(DBusConnection *bus) { svg(svg width=\%.0fpx\ height=\%.0fpx\ version=\1.1\ xmlns=\http://www.w3.org/2000/svg\;\n\n, -80.0 + width, 150.0 + (m * SCALE_Y)); +80.0 + width, 150.0 + (m * SCALE_Y) + +4 * SCALE_Y /* legend */); /* write some basic info as a comment, including some help */ svg(!-- This file is a systemd-analyze SVG file. It is best rendered in a --\n @@ -480,6 +493,7 @@ static int analyze_plot(DBusConnection *bus) { rect.firmware { fill: rgb(150,150,150); fill-opacity: 0.7; }\n rect.loader { fill: rgb(150,150,150); fill-opacity: 0.7; }\n rect.userspace{ fill: rgb(150,150,150); fill-opacity: 0.7; }\n + rect.generators { fill: rgb(102,204,255); fill-opacity: 0.7; }\n rect.box { fill: rgb(240,240,240); stroke: rgb(192,192,192); }\n line { stroke: rgb(64,64,64); stroke-width: 1; }\n //line.sec1 { }\n @@ -495,8 +509,6 @@ static int analyze_plot(DBusConnection *bus) { svg(text x=\20\ y=\30\%s %s (%s %s) %s/text, isempty(osname) ? Linux : osname, name.nodename, name.release, name.version, name.machine); -svg(text x=\20\ y=\%.0f\Legend: Red = Activating; Pink = Active; Dark Pink = Deactivating/text, -120.0 + (m *SCALE_Y)); svg(g transform=\translate(%.3f,100)\\n, 20.0 + (SCALE_X * boot-firmware_time)); svg_graph_box(m, -boot-firmware_time, boot-finish_time); @@ -521,8 +533,9 @@ static int analyze_plot(DBusConnection *bus) { svg_text(true, boot-initrd_time, y, initrd); y++; } -svg_bar(userspace, boot-userspace_time, boot-finish_time, y); -svg_text(left, boot-userspace_time, y, userspace); +svg_bar(active, boot-userspace_time, boot-finish_time, y); +svg_bar(generators, boot-generators_start_time, boot-generators_finish_time, y); +svg_text(left, boot-userspace_time, y, systemd); y++; for (u = times; u times + n; u++) { @@ -544,6 +557,23 @@ static int analyze_plot(DBusConnection *bus) { svg_text(b, u-ixt, y, %s, u-name); y++; } + +/* Legend */ +y++; +svg_bar(activating, 0, 30, y); +svg_text(right, 40, y, Activating); +y++; +svg_bar(active, 0, 30, y); +svg_text(right, 40, y, Active); +y++; +svg_bar(deactivating, 0, 30, y); +svg_text(right, 40, y, Deactivating); +y++; +svg_bar(generators, 0, 30, y); +svg_text(right, 40, y, Generators); +y++; + + It would be nice to see a full screenshot that includes the new legend area. svg(/g\n\n); svg(/svg);
Re: [systemd-devel] Patch to show systemd generators
On Mon, May 6, 2013 at 2:51 PM, Lennart Poettering lenn...@poettering.net wrote: On Mon, 06.05.13 14:00, Umut Tezduyar (u...@tezduyar.com) wrote: Hi, Would you be interested in a patch that shows Systemd + Generators or maybe only Generators? Well, I guess it makes sense to show how much time is spent in the generators and how much time is spent in systemd's own unit file loading (especially given that the latter isn't particularly optimized yet...) I was looking for the relevant code parts for this. Is this basically what is done in manager_enumerate? Lennart -- Lennart Poettering - Red Hat, Inc. ___ 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 to show systemd generators
On Mon, May 6, 2013 at 4:07 PM, Tom Gundersen t...@jklm.no wrote: On Mon, May 6, 2013 at 2:51 PM, Lennart Poettering lenn...@poettering.net wrote: On Mon, 06.05.13 14:00, Umut Tezduyar (u...@tezduyar.com) wrote: Would you be interested in a patch that shows Systemd + Generators or maybe only Generators? Well, I guess it makes sense to show how much time is spent in the generators and how much time is spent in systemd's own unit file loading (especially given that the latter isn't particularly optimized yet...) Maybe also split out the SELinux loading as that seems to take a lot of time? Maybe a general Security loading to also include the case of using smack or ima? In main.c we have this. We could get the start time right after mount_setup_early and finish time after label_init? if (!skip_setup) { mount_setup_early(); if (selinux_setup(loaded_policy) 0) goto finish; if (ima_setup() 0) goto finish; if (smack_setup() 0) goto finish; } if (label_init(NULL) 0) goto finish; Umut, is this something you plan to work on? Otherwise I can prepare some patches. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Debugging systemd shutdown problem on openSuSE 12.3
Am 13.05.2013 16:16, schrieb Frederic Crozat: I waited at least 5 minutes one time even an hour. It seems most processes are beeing killed however something hangs. My guess was that perhaps autofs is not terminated correctly which might cause hanging NFS mounts, but this is only a guess because I cannot see what happens inside systemd. Thats why I look for ways to find out more. Did you try to enable a debug-shell, following http://freedesktop.org/wiki/Software/systemd/Debugging#Early_Debug_Shell ? In between I tried the debugging shell. On tty9 I get the shell, but no matter which command I try (mount, ps, ..) I do not get any results and the command seems to hang. I can even type nonesense like fff and get no error but again the command hangs. I can interrupt it by Ctrl-C and get a new shell prompt. The system is still active, eg I can change ttys the system reacts to magig sysreq key press. I disabled the autofs init-script and then tried to start up and reboot like before. This time it worked each time I tried. Next I tried to reenable autofs, reboot, then manually stopped the service (systemctl stop autofs) and then reboot. Again the system hangs but this time I still have a remote ssh open and it was not killed so I could run journalctl to get the log: http://userpages.uni-koblenz.de/~krienke/tmp/systemd/journalctl What is striking to me is that the logs shows: May 14 09:28:27 rzinstal3 systemd[1]: Unit autofs.service entered failed state This was exactly the time I manually stopped autofs, which worked. One existing NFS automount was umounted and no auto* process is now running any longer. I'll leave the system in that state (a working shell still open) if someone has an idea how to find out more about this problem. A list of all running processes can be seen here: http://userpages.uni-koblenz.de/~krienke/tmp/systemd/processes Thanks Rainer -- Rainer Krienke, Uni Koblenz, Rechenzentrum, A22, Universitaetsstrasse 1 56070 Koblenz, http://userpages.uni-koblenz.de/~krienke, Tel: +49261287 1312 PGP: http://userpages.uni-koblenz.de/~krienke/mypgp.html,Fax: +49261287 1001312 smime.p7s Description: S/MIME Kryptografische Unterschrift ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH 1/2] analyze: show generators on plot
Hi, Attached is a screen shot of the new legend area. It is placed on exactly where the previous text based legend was. On Tue, May 14, 2013 at 8:52 AM, Thomas H.P. Andersen pho...@gmail.comwrote: On Wed, May 8, 2013 at 6:03 PM, Umut Tezduyar u...@tezduyar.com wrote: --- src/analyze/systemd-analyze.c | 42 src/core/dbus-manager.c |8 ++ src/core/manager.c|2 + src/core/manager.h|2 + 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c index bb86ec7..df3d307 100644 --- a/src/analyze/systemd-analyze.c +++ b/src/analyze/systemd-analyze.c @@ -78,6 +78,8 @@ struct boot_times { usec_t initrd_time; usec_t userspace_time; usec_t finish_time; +usec_t generators_start_time; +usec_t generators_finish_time; }; struct unit_times { char *name; @@ -303,7 +305,17 @@ static int acquire_boot_times(DBusConnection *bus, struct boot_times **bt) { /org/freedesktop/systemd1, org.freedesktop.systemd1.Manager, FinishTimestampMonotonic, -times.finish_time) 0) +times.finish_time) 0 || +bus_get_uint64_property(bus, +/org/freedesktop/systemd1, +org.freedesktop.systemd1.Manager, +GeneratorsStartTimestampMonotonic, +times.generators_start_time) 0 || +bus_get_uint64_property(bus, +/org/freedesktop/systemd1, +org.freedesktop.systemd1.Manager, + GeneratorsFinishTimestampMonotonic, +times.generators_finish_time) 0) return -EIO; if (times.finish_time = 0) { @@ -459,7 +471,8 @@ static int analyze_plot(DBusConnection *bus) { svg(svg width=\%.0fpx\ height=\%.0fpx\ version=\1.1\ xmlns=\http://www.w3.org/2000/svg\;\n\n, -80.0 + width, 150.0 + (m * SCALE_Y)); +80.0 + width, 150.0 + (m * SCALE_Y) + +4 * SCALE_Y /* legend */); /* write some basic info as a comment, including some help */ svg(!-- This file is a systemd-analyze SVG file. It is best rendered in a --\n @@ -480,6 +493,7 @@ static int analyze_plot(DBusConnection *bus) { rect.firmware { fill: rgb(150,150,150); fill-opacity: 0.7; }\n rect.loader { fill: rgb(150,150,150); fill-opacity: 0.7; }\n rect.userspace{ fill: rgb(150,150,150); fill-opacity: 0.7; }\n + rect.generators { fill: rgb(102,204,255); fill-opacity: 0.7; }\n rect.box { fill: rgb(240,240,240); stroke: rgb(192,192,192); }\n line { stroke: rgb(64,64,64); stroke-width: 1; }\n //line.sec1 { }\n @@ -495,8 +509,6 @@ static int analyze_plot(DBusConnection *bus) { svg(text x=\20\ y=\30\%s %s (%s %s) %s/text, isempty(osname) ? Linux : osname, name.nodename, name.release, name.version, name.machine); -svg(text x=\20\ y=\%.0f\Legend: Red = Activating; Pink = Active; Dark Pink = Deactivating/text, -120.0 + (m *SCALE_Y)); svg(g transform=\translate(%.3f,100)\\n, 20.0 + (SCALE_X * boot-firmware_time)); svg_graph_box(m, -boot-firmware_time, boot-finish_time); @@ -521,8 +533,9 @@ static int analyze_plot(DBusConnection *bus) { svg_text(true, boot-initrd_time, y, initrd); y++; } -svg_bar(userspace, boot-userspace_time, boot-finish_time, y); -svg_text(left, boot-userspace_time, y, userspace); +svg_bar(active, boot-userspace_time, boot-finish_time, y); +svg_bar(generators, boot-generators_start_time, boot-generators_finish_time, y); +svg_text(left, boot-userspace_time, y, systemd); y++; for (u = times; u times + n; u++) { @@ -544,6 +557,23 @@ static int analyze_plot(DBusConnection *bus) { svg_text(b, u-ixt, y, %s, u-name); y++; } + +/* Legend */ +y++; +svg_bar(activating, 0, 30, y); +svg_text(right, 40, y, Activating); +y++; +svg_bar(active, 0, 30, y); +svg_text(right, 40, y, Active); +y++; +svg_bar(deactivating, 0, 30, y); +svg_text(right, 40, y, Deactivating);
Re: [systemd-devel] Patch to show systemd generators
On Tue, May 14, 2013 at 9:14 AM, Thomas H.P. Andersen pho...@gmail.comwrote: On Mon, May 6, 2013 at 4:07 PM, Tom Gundersen t...@jklm.no wrote: On Mon, May 6, 2013 at 2:51 PM, Lennart Poettering lenn...@poettering.net wrote: On Mon, 06.05.13 14:00, Umut Tezduyar (u...@tezduyar.com) wrote: Would you be interested in a patch that shows Systemd + Generators or maybe only Generators? Well, I guess it makes sense to show how much time is spent in the generators and how much time is spent in systemd's own unit file loading (especially given that the latter isn't particularly optimized yet...) Maybe also split out the SELinux loading as that seems to take a lot of time? Maybe a general Security loading to also include the case of using smack or ima? In main.c we have this. We could get the start time right after mount_setup_early and finish time after label_init? if (!skip_setup) { mount_setup_early(); if (selinux_setup(loaded_policy) 0) goto finish; if (ima_setup() 0) goto finish; if (smack_setup() 0) goto finish; } if (label_init(NULL) 0) goto finish; Umut, is this something you plan to work on? Otherwise I can prepare some patches. Umut: Hi. I am not planning to measure anything other than generators at the moment. Please feel free to add stuff. You could also move the time keeping to manager_init if you want. Otherwise, I will send an updated patch tomorrow. ___ 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] Debugging systemd shutdown problem on openSuSE 12.3
On Tue, May 14, 2013 at 11:43 AM, Rainer Krienke krie...@uni-koblenz.de wrote: Next I tried to reenable autofs, reboot, then manually stopped the service (systemctl stop autofs) and then reboot. Again the system hangs but this time I still have a remote ssh open and it was not killed so I could run journalctl to get the log: http://userpages.uni-koblenz.de/~krienke/tmp/systemd/journalctl What is striking to me is that the logs shows: May 14 09:28:27 rzinstal3 systemd[1]: Unit autofs.service entered failed state This was exactly the time I manually stopped autofs, which worked. No, it did not. May 14 09:28:25 rzinstal3 systemd[1]: Stopping Automounts filesystems on demand... May 14 09:28:25 rzinstal3 systemd[1]: About to execute /sbin/killproc -t 45 -p $PIDFILE automount May 14 09:28:25 rzinstal3 systemd[1]: Forked /sbin/killproc as 3361 May 14 09:28:25 rzinstal3 systemd[1]: autofs.service changed running - stop May 14 09:28:26 rzinstal3 killproc[3361]: killproc: Usage: May 14 09:28:26 rzinstal3 systemd[1]: Received SIGCHLD from PID 3361 (killproc). May 14 09:28:26 rzinstal3 systemd[1]: Got SIGCHLD for process 3361 (killproc) May 14 09:28:26 rzinstal3 systemd[1]: Child 3361 died (code=exited, status=2/INVALIDARGUMENT) May 14 09:28:26 rzinstal3 systemd[1]: Child 3361 belongs to autofs.service May 14 09:28:26 rzinstal3 systemd[1]: autofs.service: control process exited, code=exited status=2 It failed to properly stop and had to kill. One existing NFS automount was umounted and no auto* process is now running any longer. I'll leave the system in that state (a working shell still open) if someone has an idea how to find out more about this problem. A list of all running processes can be seen here: http://userpages.uni-koblenz.de/~krienke/tmp/systemd/processes Thanks Rainer -- Rainer Krienke, Uni Koblenz, Rechenzentrum, A22, Universitaetsstrasse 1 56070 Koblenz, http://userpages.uni-koblenz.de/~krienke, Tel: +49261287 1312 PGP: http://userpages.uni-koblenz.de/~krienke/mypgp.html,Fax: +49261287 1001312 ___ 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] greedy_realloc()
On Tue, 14.05.13 11:32, Daniel Buch (boogiewasth...@gmail.com) wrote: http://cgit.freedesktop.org/systemd/systemd/tree/TODO#n115 I wonder if this isnt covered with GREEDY_REALLOC()? Yes, that's why we added it. However, there are probably a few byte-wise uses of realloc() in our sources remaining, where greedy_realloc() would be more appropriate. We'd need to identify those, check if greedy_realloc() might be the better choice there, and if so, fix this. Lennart -- Lennart Poettering - Red Hat, Inc. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Debugging systemd shutdown problem on openSuSE 12.3
Am 14.05.2013 12:00, schrieb Andrey Borzenkov: On Tue, May 14, 2013 at 11:43 AM, Rainer Krienke krie...@uni-koblenz.de wrote: Next I tried to reenable autofs, reboot, then manually stopped the service (systemctl stop autofs) and then reboot. Again the system hangs but this time I still have a remote ssh open and it was not killed so I could run journalctl to get the log: http://userpages.uni-koblenz.de/~krienke/tmp/systemd/journalctl What is striking to me is that the logs shows: May 14 09:28:27 rzinstal3 systemd[1]: Unit autofs.service entered failed state This was exactly the time I manually stopped autofs, which worked. No, it did not. May 14 09:28:25 rzinstal3 systemd[1]: Stopping Automounts filesystems on demand... May 14 09:28:25 rzinstal3 systemd[1]: About to execute /sbin/killproc -t 45 -p $PIDFILE automount May 14 09:28:25 rzinstal3 systemd[1]: Forked /sbin/killproc as 3361 May 14 09:28:25 rzinstal3 systemd[1]: autofs.service changed running - stop May 14 09:28:26 rzinstal3 killproc[3361]: killproc: Usage: May 14 09:28:26 rzinstal3 systemd[1]: Received SIGCHLD from PID 3361 (killproc). May 14 09:28:26 rzinstal3 systemd[1]: Got SIGCHLD for process 3361 (killproc) May 14 09:28:26 rzinstal3 systemd[1]: Child 3361 died (code=exited, status=2/INVALIDARGUMENT) May 14 09:28:26 rzinstal3 systemd[1]: Child 3361 belongs to autofs.service May 14 09:28:26 rzinstal3 systemd[1]: autofs.service: control process exited, code=exited status=2 It failed to properly stop and had to kill. One Thanks for the hint. I tried to find out whats wrong with autofs. The reason that autofs failed was not that it had problems mounting or umounting but was rooted in /etc/nsswitch.conf, where long before systemd was present in openSuSE I had entered ldap as an additional source of maps and those old sysv init days this caused no problems (eg in openSuSE 12.1 using still sysv init): automount: files nis ldap Actually autmount gets its maps from NIS and our LDAP server is not yet providing automounter maps and the ldap client isn't configured either for this. For this reason automount reports an error since it cannot get maps from ldap: May 14 13:44:54 rzinstal3 automount[3496]: get_query_dn: lookup(ldap): query failed for ((objectclass=nisMap)(nisMapName=auto.direct)): Invalid DN syntax So I simply removed the ldap entry from nsswitch.conf because its actually not needed at the moment. After this things now work and my system reboots. After all I still do not understand why this small error prevented systemd from rebooting the whole system. autofs reported an error but on the other hand it successfully umounted existing NFS mounts and terminated the automount process. There was no hanging mount, just the exit status != 0. After all the question in my eyes is if this is a bug or a feature of systemd? Thanks Rainer -- Rainer Krienke, Uni Koblenz, Rechenzentrum, A22, Universitaetsstrasse 1 56070 Koblenz, http://userpages.uni-koblenz.de/~krienke, Tel: +49261287 1312 PGP: http://userpages.uni-koblenz.de/~krienke/mypgp.html,Fax: +49261287 1001312 smime.p7s Description: S/MIME Kryptografische Unterschrift ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [U-Boot] 2013 Plumber's CFP: Fastboot
Dear Mehaffey, John, On Mon, 13 May 2013 23:51:46 +, Mehaffey, John wrote: I am proposing a microconference on fastboot at the Linux Plumber's conference 2013 in New Orleans. The goal is to get to sub 1S boot times for a large (IVI) system using NAND flash. This pushes the state of the art, and will require innovative solutions in may areas of Linux plumbing, including bootloader, kernel init, UBI, and systemd. Beware that the 'fastboot' you're talking about (making Linux boot fast), especially written this way, may easily be confused with 'fastboot', which is the Android-specific protocol to flash a system through USB (see http://en.wikipedia.org/wiki/Android_software_development#Fastboot). Besides this minor comment, I'm looking forward for the notes of this discussion on this very interesting topic. Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] 2013 Plumber's CFP: Fastboot
On Tue, May 14, 2013 at 1:51 AM, Mehaffey, John john_mehaf...@mentor.com wrote: Hello All, I am proposing a microconference on fastboot at the Linux Plumber's conference 2013 in New Orleans. The goal is to get to sub 1S boot times for a large (IVI) system using NAND flash. This pushes the state of the art, and will require innovative solutions in may areas of Linux plumbing, including bootloader, kernel init, UBI, and systemd. Note that fastboot improvements will (generally) help all architectures so I am not limiting this to automotive systems. Please visit http://wiki.linuxplumbersconf.org/2013:fastboot for more information or if you want to submit a topic. If you want to reply to this message, please trim the cc list! Why trimming the CC? Changing the CC list is a _very_ bad habit. Anyway, a few notes on UBI fastmap. Before we talk about optimizing it we have to make sure that it is stable. Currently it has not much users because embedded folks are a few kernel releases behind. I expect that we'll face some issues (hey it's software!). Instead of making the code more complicated we have to make very sure that it works well. Fastmap got much more complicated than I thought while developing the first proof of concept implementation. We also have to think more about userland support, e.g. making tools like ubinize fastmap aware... User want ready to use fastmap UBI images and not images which have to be converted by the kernel on the very first boot. Sharing UBI EBA table between U-Boot and the kernel would be a nice feature, but we also have to make sure that we can share the EBA table between two kernels (think of kexec). So, a more general solution is needed. -- Thanks, //richard ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] systemd-delta: add support for drop-in snippets
--- TODO | 3 - man/systemd-delta.xml | 7 ++ src/delta/delta.c | 182 -- 3 files changed, 170 insertions(+), 22 deletions(-) diff --git a/TODO b/TODO index 62016e1..3af9c33 100644 --- a/TODO +++ b/TODO @@ -89,9 +89,6 @@ Features: kmod static-nodes call kmod as an early service, and drop CAP_MKNOD from udevd.service -* systemd-delta needs to be made aware of *.d/*.conf drop-in files for - units. - * seems that when we follow symlinks to units we prefer the symlink destination path over /etc and /usr. We shouldn't do that. Instead /etc should always override /run+/usr and also any symlink diff --git a/man/systemd-delta.xml b/man/systemd-delta.xml index 9293c9b..0c7a54a 100644 --- a/man/systemd-delta.xml +++ b/man/systemd-delta.xml @@ -141,6 +141,13 @@ /varlistentry varlistentry + termvarnameextended/varname/term + +listitemparaShow *.conf files in drop-in +directories for units./para/listitem +/varlistentry + +varlistentry termvarnameunchanged/varname/term listitemparaShow unmodified diff --git a/src/delta/delta.c b/src/delta/delta.c index aec3dc8..c3cf1a9 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -31,6 +31,7 @@ #include log.h #include pager.h #include build.h +#include strv.h static bool arg_no_pager = false; static int arg_diff = -1; @@ -41,9 +42,10 @@ static enum { SHOW_REDIRECTED = 1 2, SHOW_OVERRIDDEN = 1 3, SHOW_UNCHANGED = 1 4, +SHOW_EXTENDED = 1 5, SHOW_DEFAULTS = -(SHOW_MASKED | SHOW_EQUIVALENT | SHOW_REDIRECTED | SHOW_OVERRIDDEN) +(SHOW_MASKED | SHOW_EQUIVALENT | SHOW_REDIRECTED | SHOW_OVERRIDDEN | SHOW_EXTENDED) } arg_flags = 0; static int equivalent(const char *a, const char *b) { @@ -92,6 +94,14 @@ static int notify_override_overridden(const char *top, const char *bottom) { return 1; } +static int notify_override_extended(const char *top, const char *bottom) { +if (!(arg_flags SHOW_EXTENDED)) + return 0; + +printf(ANSI_HIGHLIGHT_ON [EXTENDED] ANSI_HIGHLIGHT_OFF%s → %s\n, top, bottom); +return 1; +} + static int notify_override_unchanged(const char *f) { if (!(arg_flags SHOW_UNCHANGED)) return 0; @@ -148,11 +158,114 @@ static int found_override(const char *top, const char *bottom) { return 0; } -static int enumerate_dir(Hashmap *top, Hashmap *bottom, const char *path) { +static int enumerate_dir_d(Hashmap *top, Hashmap *bottom, Hashmap *drops, const char *toppath, const char *drop) { +_cleanup_free_ char *conf = NULL; +_cleanup_free_ char *path = NULL; +_cleanup_strv_free_ char **list = NULL; +char **file; +char *c; +int r; + +path = strjoin(toppath, /, drop, NULL); +if (!path) +return -ENOMEM; + +path_kill_slashes(path); + +conf = strdup(drop); +if (!conf) +return -ENOMEM; + +c = strrchr(conf, '.'); +if(!c) +return -EINVAL; +*c = 0; + +r = get_files_in_directory(path, list); +if (r 0){ +log_error(Failed to enumerate %s: %s, path, strerror(-r)); +return r; +} + +STRV_FOREACH(file, list) { +Hashmap *h; +int k; +char *p; +char *d; + +if (!endswith(*file, .conf)) +continue; + +p = strjoin(path, /, *file, NULL); +if (!p) +return -ENOMEM; + +path_kill_slashes(p); + +d = strrchr(p, '/'); +if (!d || d == p) { +free(p); +return -EINVAL; +} +d --; +d = strrchr(p, '/'); + +if (!d || d == p) { +free(p); +return -EINVAL; +} + +k = hashmap_put(top, d, p); +if (k = 0) { +p = strdup(p); +if (!p) +return -ENOMEM; +d = strrchr(p, '/'); +d --; +d = strrchr(p, '/'); +} else if (k != -EEXIST) { +free(p); +return k; +
Re: [systemd-devel] [PATCH] [RFCv6] Optionally save core dumps as plain files
Colin Walters walt...@verbum.org writes: So...what do you think about dropping the User/Group settings, having /var/log/coredump have the same permissions as the journal? I.e. owned by root:root and with an ACL for access by adm or whatever? I like this ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] [RFCv7] Optionally save core dumps as plain files
Introduce configuration file: /etc/systemd/coredump.conf with configurable core dumps backend storages (journal/file/both/none), per storage size limits and preprocessing. Default filestorage choosed as /run/log/coredump or /var/log/coredump with next reason: 1. These files produced with systemd component 2. These files registered with journal Main differences between v7 and v6: 1. As Colin suggested, create-then-drop policy used when storing to files. 2. {/var/,/run}/log/coredump/MACHINE-ID folder will be created with root:systemd-journal owner and drwxr-s-- permissions. 3. Trivial preprocessing support added. For example: PreprocessFile=gzip -9 %i%o PreprocessJournal=gdb -nw --batch --quiet --silent --ex 'thread \ apply all bt' --core %i %e %o This will save to file storage compressed cores and backtraces to journal COREDUMP= section. 4. Copying optimizations removed for now. Now core always stored to temporary folder, then optionaly preprocessed to temporary files, then temporary files copied to storage. Weak places: coredump.c:495 To prevent copying of large memory segments, I contruct virtual space manually. Probably it will not work as expected in some cases, so recomendations and comments needed.. --- Makefile-man.am | 1 + Makefile.am | 14 +- man/coredump.conf.xml| 217 +++ src/core/manager.c | 1 + src/journal/coredump-gperf.gperf | 24 ++ src/journal/coredump.c | 764 --- src/journal/coredump.conf| 18 + src/journal/coredump.h | 89 + src/journal/journald-server.h| 2 +- 9 files changed, 992 insertions(+), 138 deletions(-) create mode 100644 man/coredump.conf.xml create mode 100644 src/journal/coredump-gperf.gperf create mode 100644 src/journal/coredump.conf create mode 100644 src/journal/coredump.h diff --git a/Makefile-man.am b/Makefile-man.am index 481423a..e3ff8dd 100644 --- a/Makefile-man.am +++ b/Makefile-man.am @@ -8,6 +8,7 @@ MANPAGES += \ man/hostname.5 \ man/journalctl.1 \ man/journald.conf.5 \ + man/coredump.conf.5 \ man/kernel-command-line.7 \ man/kernel-install.8 \ man/locale.conf.5 \ diff --git a/Makefile.am b/Makefile.am index eb85c8d..96e5bc3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2908,7 +2908,8 @@ nodist_systemunit_DATA += \ units/systemd-journal-flush.service dist_pkgsysconf_DATA += \ - src/journal/journald.conf + src/journal/journald.conf \ + src/journal/coredump.conf pkgconfiglib_DATA += \ src/journal/libsystemd-journal.pc @@ -2927,10 +2928,12 @@ EXTRA_DIST += \ src/journal/libsystemd-journal.sym \ units/systemd-journald.service.in \ units/systemd-journal-flush.service.in \ - src/journal/journald-gperf.gperf + src/journal/journald-gperf.gperf \ + src/journal/coredump-gperf.gperf CLEANFILES += \ - src/journal/journald-gperf.c + src/journal/journald-gperf.c \ + src/journal/coredump-gperf.c # -- if HAVE_MICROHTTPD @@ -2975,10 +2978,13 @@ EXTRA_DIST += \ # -- if ENABLE_COREDUMP systemd_coredump_SOURCES = \ - src/journal/coredump.c + src/shared/specifier.c \ + src/journal/coredump.c \ + src/journal/coredump-gperf.c systemd_coredump_LDADD = \ libsystemd-journal-internal.la \ + libsystemd-id128-internal.la \ libsystemd-label.la \ libsystemd-shared.la diff --git a/man/coredump.conf.xml b/man/coredump.conf.xml new file mode 100644 index 000..491b9d0 --- /dev/null +++ b/man/coredump.conf.xml @@ -0,0 +1,217 @@ +?xml version='1.0'? !--*-nxml-*-- +?xml-stylesheet type=text/xsl href=http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl;? +!DOCTYPE refentry PUBLIC -//OASIS//DTD DocBook XML V4.2//EN +http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd; + +!-- + This file is part of systemd. + + Copyright 2013 Lennart Poettering + Oleksii Shevchuk + + 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. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see http://www.gnu.org/licenses/. +-- + +refentry id=coredump.conf +refentryinfo +