Re: [systemd-devel] systemd-coredump gets terminated during shutdown

2017-10-24 Thread Joel Holdsworth

On 24/10/17 02:38, Lennart Poettering wrote:

On Do, 12.10.17 12:23, Joel Holdsworth (joel.holdswo...@vcatechnology.com) 
wrote:


Hi All,

I have an issue with the standard unit file:
./units/systemd-cored...@.service.in

In my use case if the main application crashes twice in 2-minutes, the
system will reboot into a recovery environment. I'm using systemd-coredump
to capture the coredump files, but the problem is that if the reboot is
triggered, then the coredump process is killed during shutdown before the
coredump has been written to disk.

First of all, I'm having trouble correcting this behaviour. The
systemd-coredump@.service should have no Conflicts=shutdown.target, and it
must have Before=shutdown.target. I tried making similar changes to the
corresponding .slice and .socket - but for some reason the coredump process
is still getting killed. Is there any way to make systemd log the reason why
a process was chosen for termination?

Also, the coredump process need to complete before the the relevant
partition is unmounted. Is there a way to do that?

These are all systemd n00b questions. But the bigger question is about
whether this is a bug in the standard unit files.

Quite frankly you hit a misdesign in the coredump service there. To
make this safe I figure it needs to become a Type=oneshot service
(i.e. instead of being a long-running service that shall be terminated
at shutdown it would the be a short-running service that we'll wait
for before shutting down).

COuld you please file a bug about this in the github issue tracker, so
that we fix this for good upstream?

Lennart


Hi Lennart, thanks for the response.

I filed a bug: https://github.com/systemd/systemd/issues/7176

For the time being, I found a hack setting 
KillSignal= gives me the behavior I want, but 
obviously it would be better to have a proper solution to prevent this.


Joel

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd-coredump gets terminated during shutdown

2017-10-12 Thread Joel Holdsworth

Hi All,

I have an issue with the standard unit file: 
./units/systemd-cored...@.service.in


In my use case if the main application crashes twice in 2-minutes, the 
system will reboot into a recovery environment. I'm using 
systemd-coredump to capture the coredump files, but the problem is that 
if the reboot is triggered, then the coredump process is killed during 
shutdown before the coredump has been written to disk.


First of all, I'm having trouble correcting this behaviour. The 
systemd-coredump@.service should have no Conflicts=shutdown.target, and 
it must have Before=shutdown.target. I tried making similar changes to 
the corresponding .slice and .socket - but for some reason the coredump 
process is still getting killed. Is there any way to make systemd log 
the reason why a process was chosen for termination?


Also, the coredump process need to complete before the the relevant 
partition is unmounted. Is there a way to do that?


These are all systemd n00b questions. But the bigger question is about 
whether this is a bug in the standard unit files.


Thanks

Joel Holdsworth

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-journald error

2016-11-25 Thread Joel
Lennart -


Thank you for the reply.


It's not clear whether you are instructing me to do something (restart journald 
or rebuild initrd) or asking a question.


Please note that while I have some experience with Linux and the SuSE distro 
(about 11 years or so), this is the first time I am delving into systemd.


I was simply trying to find out where else the value (storage=persistent) is 
registered or cached.


Please clarify.  Thanks.


Joel Miller


From: Lennart Poettering <lenn...@poettering.net>
Sent: Friday, November 25, 2016 11:33:28 AM
To: Joel Miller
Cc: systemd-devel@lists.freedesktop.org
Subject: Re: [systemd-devel] systemd-journald error

On Fri, 25.11.16 05:33, Joel Miller (jm-hotm...@hotmail.com) wrote:

> Because I had misspelled the word "persistent" as "persisten" (dropping the
> final "t"), I received the following error:
>
> [1.485872] systemd-journald[104]: [/etc/systemd/journald.conf:11] Failed
> to parse storage setting, ignoring: persisten
>
> Despite correcting the .conf file (/etc/systemd/journald.conf in SuSE Leap
> 42.1), the error remains, perhaps because the value is cached somewhere in
> the system, but it is not causing any issues that I can detect.  I welcome
> any suggestions of where to look.

You have to restart journald of course?

Or maybe rebuild your initrd because the config file is also added to
the initrd on your distro?

Lennart

--
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd-journald error

2016-11-25 Thread Joel Miller
Because I had misspelled the word "persistent" as "persisten" (dropping 
the final "t"), I received the following error:


[1.485872] systemd-journald[104]: [/etc/systemd/journald.conf:11] 
Failed to parse storage setting, ignoring: persisten


Despite correcting the .conf file (/etc/systemd/journald.conf in SuSE 
Leap 42.1), the error remains, perhaps because the value is cached 
somewhere in the system, but it is not causing any issues that I can 
detect.  I welcome any suggestions of where to look.


I am aware that I could reload the configuration for journald or the 
entire systemd.  And should neither of those work, I could reinstall 
systemd.


If I should have posted this on a different list, please let me know (I 
do have a thread on an openSuSE forum).


Thanks.

Joel Miller
973 736 8306
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] nspawn: Fix a race condition

2014-03-10 Thread Joel Teichroeb
If the master process registers the child before the child
has initialized, when the child tries to setup /dev/console
it gets operation not permitted.
---
 src/nspawn/nspawn.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 92b6728..a83d1f3 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -1776,7 +1776,7 @@ finish:

 int main(int argc, char *argv[]) {

-_cleanup_close_ int master = -1, kdbus_fd = -1, sync_fd = -1;
+_cleanup_close_ int master = -1, kdbus_fd = -1, sync_fd = -1,
sync_fd2 = -1;
 _cleanup_close_pipe_ int kmsg_socket_pair[2] = { -1, -1 };
 _cleanup_free_ char *kdbus_domain = NULL;
 _cleanup_fdset_free_ FDSet *fds = NULL;
@@ -1925,9 +1925,11 @@ int main(int argc, char *argv[]) {

 for (;;) {
 siginfo_t status;
+eventfd_t x;

 sync_fd = eventfd(0, EFD_CLOEXEC);
-if (sync_fd  0) {
+sync_fd2 = eventfd(0, EFD_CLOEXEC);
+if (sync_fd  0 || sync_fd2  0) {
 log_error(Failed to create event fd: %m);
 goto finish;
 }
@@ -1964,7 +1966,6 @@ int main(int argc, char *argv[]) {
 NULL
 };
 char **env_use;
-eventfd_t x;

 envp[n_env] = strv_find_prefix(environ, TERM=);
 if (envp[n_env])
@@ -2201,6 +2202,9 @@ int main(int argc, char *argv[]) {
 goto child_fail;
 }
 }
+eventfd_write(sync_fd2, 1);
+close_nointr_nofail(sync_fd2);
+sync_fd2 = -1;

 eventfd_read(sync_fd, x);
 close_nointr_nofail(sync_fd);
@@ -2256,6 +2260,10 @@ int main(int argc, char *argv[]) {
 _exit(EXIT_FAILURE);
 }

+eventfd_read(sync_fd2, x);
+close_nointr_nofail(sync_fd2);
+sync_fd2 = -1;
+
 fdset_free(fds);
 fds = NULL;

-- 
1.9.0
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd boot hang

2011-08-09 Thread Joel A Fernandes
Hi, I'm using kernel 3.0.1 and systemd, the boot process hangs. I am
booting from an SD Card using the BeagleBoard.

I am passing systemd.log_target=kmsg systemd.log_level=debug in my
boot arguments but I don't see any debug messages.

Could anyone help me out? Thanks

Starting udev Coldplug all Devices...
Starting udev Kernel Device Manager...
Started Load Kernel Modules.
Started Set Up Additional Binary Formats.
[4.701141] udevd[52]: starting version 173
Started Apply Kernel Variables.
Starting Syslog Kernel Log Buffer Bridge...
Started Syslog Kernel Log Buffer Bridge.
Starting /var/volatile...
Starting /tmp...
Starting Setup Virtual Console...
Started Opkg first boot configure.
Starting Remount API VFS...
Starting File System Check on Root Device...
Starting Lock Directory...
Starting Media Directory...
Started Runtime Directory.
Started udev Kernel Device Manager.
Started /var/volatile.
[4.932647] systemd-fsck[61]: Root directory is writable, skipping check.
Started /tmp.
Started File System Check on Root Device.
Started Lock Directory.
Started Remount API VFS.
Started Media Directory.
Starting Remount Root FS...
Starting /var/tmp...
Started /var/tmp.
Starting Stdio Syslog Bridge...
[5.081146] systemd-vconsole-setup[57]: /usr/bin/loadkeys failed
with error code 1.
Started Stdio Syslog Bridge.
[5.135314] systemd-vconsole-setup[57]: cannot open file us
Started udev Coldplug all Devices.
Started Setup Virtual Console.
Started Remount Root FS.
Starting Load Random Seed...
Starting Recreate Volatile Files and Directories...
Started Load Random Seed.
Started Recreate Volatile Files and Directories.
Starting Console System Startup Logging...
Starting ntpd.service...
Starting xinetd.service...
Started SSH Key Generation.
Starting D-Bus System Message Bus...
Starting Login Service...
Starting Permit User Sessions...
Started Permit User Sessions.
Starting ntpd: Started Console System Startup Logging.
Started D-Bus System Message Bus.
Starting internet superserver: xinetd.
[5.773284] ntpd[137]: ntpd 4.2.6p3@1.2290 Fri Jul 29 17:35:18 UTC 2011 (2)
done
[5.809906] ntpd[154]: proto: precision = 30.517 usec
[5.829437] ntpd[154]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
[5.849182] xinetd[156]: 156 {init_services} no services. Exiting...
[5.864044] ntpd[154]: Listen and drop on 1 v6wildcard :: UDP 123
[5.882141] ntpd[154]: Listen normally on 2 lo 127.0.0.1 UDP 123
[5.906188] ntpd[154]: Listen normally on 3 lo ::1 UDP 123
[5.935424] ntpd[154]: peers refreshed
[5.939361] ntpd[154]: Deferring DNS for pool.ntp.org 1
[6.385498] twl_rtc twl_rtc: rtc core: registered twl_rtc as rtc0
[7.948211] ntpd_intres[162]: host name not found: pool.ntp.org
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel