Re: [systemd-devel] systemd[1]: Stopped (with error) /dev/mapper/wxyz.

2016-07-24 Thread Andrei Borzenkov
25.07.2016 06:11, Dave T пишет:
> I have a fileserver with several HDDs (btrfs and dm-crypt for all except
> one which is lvm2 and dm-crypt).
> 
> Within the last week when I umount a USB drive, all my other mounts
> immediately get unmounted too. I lose /home and almost everything else
> except the system device. The USB drive is the ESP (EFI system partition)
> mounted at /boot. It is intended to be unmounted after boot and it worked
> appropriately until the last week.
> 
> If I reboot, all is fine until I umount the USB device (ESP).
> 
> I have *not* tried to reproduce the behavior by umounting other devices as
> this is a live fileserver. However, I can trigger this behavior 100% of the
> time if I umount /boot.
> 
> journalctl shows a number of messages similar to this:
> 
> Jul 24 20:25:41 myserver systemd[1]: Stopped (with error)
> /dev/mapper/wxyz.
> -- Subject: Unit dev-mapper-wxyz.device has finished shutting down
> -- Defined-By: systemd
> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> --
> -- Unit dev-mapper-wxyz.device has finished shutting down.
> 
> As I said, the system has started, in the last week, unmounting all these
> other devices. Why?
> 
> I am not a developer and I am new to systemd. I am happy to provide
> additional information upon request.
> 

Boot, trigger problem, send output of "journalctl -b". New clean boot is
better to limit size of journal output.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd[1]: Stopped (with error) /dev/mapper/wxyz.

2016-07-24 Thread Dave T
I have a fileserver with several HDDs (btrfs and dm-crypt for all except
one which is lvm2 and dm-crypt).

Within the last week when I umount a USB drive, all my other mounts
immediately get unmounted too. I lose /home and almost everything else
except the system device. The USB drive is the ESP (EFI system partition)
mounted at /boot. It is intended to be unmounted after boot and it worked
appropriately until the last week.

If I reboot, all is fine until I umount the USB device (ESP).

I have *not* tried to reproduce the behavior by umounting other devices as
this is a live fileserver. However, I can trigger this behavior 100% of the
time if I umount /boot.

journalctl shows a number of messages similar to this:

Jul 24 20:25:41 myserver systemd[1]: Stopped (with error)
/dev/mapper/wxyz.
-- Subject: Unit dev-mapper-wxyz.device has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit dev-mapper-wxyz.device has finished shutting down.

As I said, the system has started, in the last week, unmounting all these
other devices. Why?

I am not a developer and I am new to systemd. I am happy to provide
additional information upon request.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Redirecting logfile to journald

2016-07-24 Thread Juanjo Presa
Hi, I'm running a service that only writes output to log file, not
configurable. Then I'm trying to link the log file to /dev/stdout but I
guess that is not enough to be received by journald because is not working.

As I've read here: https://github.com/coreos/rkt/issues/2640 really
/dev/stdout is redirected to /proc/self/fd/1 and then to a journald
inaccesible socket.

Is there another way to feed journald?
Maybe an systemd-cat wrapper, but I'm trying hard to get rid of shell
scripts.

I'm running:

systemd 229
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP
+GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN

Ubuntu 16.04.1 LTS (Xenial Xerus)

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


Re: [systemd-devel] systemd-coredump, coredump is truncated to exactly 2GiB

2016-07-24 Thread Zbigniew Jędrzejewski-Szmek
On Sat, Jul 23, 2016 at 02:10:51PM -0600, Chris Murphy wrote:
> On Sat, Jul 23, 2016 at 11:41 AM, Zbigniew Jędrzejewski-Szmek
>  wrote:
> > On Fri, Jul 22, 2016 at 07:40:25PM -0600, Chris Murphy wrote:
> >> qemu-system-x86 core dumped on me for some reason, and I see it in the 
> >> journal:
> >>
> >> Jul 22 13:24:30 f24m systemd-coredump[3914]: Process 3829
> >> (qemu-system-x86) of user 107 dumped core.
> >>
> >> OK no problem.
> >>
> >> [chris@f24m ~]$ sudo coredumpctl gdb 3829
> >> [...snip...]
> >> BFD: Warning: /var/tmp/coredump-DtRBEA is truncated: expected core
> >> file size >= 4115308544, found: 2147483648.
> >>
> >> OK let's extract the coredump to its own file:
> >>
> >> # sudo coredumpctl -o qemu-system-x86.coredump dump 
> >> /usr/bin/qemu-system-x86_64
> >> # ls -l
> >> -rw-r--r--. 1 chris chris 2147483648 Jul 22 14:08 qemu-system-x86.coredump
> >>
> >> Huh, 2147483648 is 0x8000 or exactly 2GiB. Suspicious? Is there a
> >> misconfiguration of some kind causing this truncation? Or?
> >>
> >> This is Fedora 24, systemd-229-8.fc24.x86_64
> >
> > Sounds like a bug in the logic. 2GiB is the default value for 
> > ProcessSizeMax=
> > and ExternalSizeMax=. coredump.conf(5) implies coredumps larger than that
> > will not be stored. I don't think it's useful to have truncated coredumps,
> > so I think we should:
> > 1. make sure that coredumps which exceed the allowed size not saved
> > 2. consider increasing the maximum coredump size. 2GiB feels a bit low
> >in this day and age.
> 
> What's the significance of the path in the gdb complaint...
> 
> BFD: Warning: /var/tmp/coredump-S2qIGu is truncated: expected core
> file size >= 4115308544, found: 2147483648.
> 
> ...compared to the path coredumpctl info reports?
> 
>   Coredump:
> /var/lib/systemd/coredump/core.qemu-system-x86.107.b91161300395440f96b49cd0b879488d.3829.1469215461.lz4
> 
> Does 'coredumpctl gdb' grab the compressed coredump and decompresses
> it into /var/tmp and then hands it off to gdb? I just want to make
> sure there's no other source for truncation.

Yes, coredumps are stored with lz4 compression. GDB (and also other
tools) needs it uncompressed.

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


[systemd-devel] systemd-networkd-wait-online: Wait for specific address family to be online

2016-07-24 Thread Ernst Bammer
Hi,

I have a service that depends on a non-loopback IPv4 address to be
available at start-up. My network configuration is done with networkd,
it's very simple and basically just:

[Match]
Name=eth*
[Network]
DHCP=v4

I've added the following to my service:

[Unit]
Requires=network-online.target
After=network-online.target

Unfortunately, there is no IPv4 address when the service tries to
start (and then crashes).
For debugging purposes, I added this to [Service]:

ExecStartPre=/bin/sh -c "/bin/cat /run/systemd/netif/links/*"
ExecStartPre=/bin/sh -c "/bin/cat /run/systemd/netif/leases/*"

On reboot, I see this in the journal:

Jul 24 11:41:59 myhost sh[492]: # This is private data. Do not parse.
Jul 24 11:41:59 myhost sh[492]: ADMIN_STATE=configured
Jul 24 11:41:59 myhost sh[492]: OPER_STATE=degraded
Jul 24 11:41:59 myhost sh[492]: FLAGS=69699
Jul 24 11:42:00 myhost sh[529]: /bin/cat: /run/systemd/netif/leases/*:
No such file or directory
Jul 24 11:42:00 myhost systemd[1]: test.service: control process
exited, code=exited status=1
Jul 24 11:42:00 myhost systemd[1]: Failed to start Test.
Jul 24 11:42:00 myhost systemd[1]: Unit test.service entered failed state.

I suspect the problem might be that the network interface also gets a
link-local IPv6 address, and thus systemd-networkd-wait-online
immediately returns. If I disable IPv6 on my system (by blacklisting
the ipv6 module), it works as expected (s-n-w-o waiting for DHCPv4
address).

Is there a way to get s-n-w-o to wait for an address family (in my
case IPv4) to be available? Or is there any other workaround?

FWIW, I'm using Debian 8 Jessie (systemd version 215).

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


Re: [systemd-devel] Preserve all active encrypted device when shutting down into initramfs

2016-07-24 Thread Ivan Kabaivanov
sorry for top-replying, yahoo web client is braindead.
This is how I got around this:
diff -Naurw systemd-230.original/src/core/shutdown.c 
systemd-230/src/core/shutdown.c --- systemd-230.original/src/core/shutdown.c 
2016-05-22 01:31:29.0 +0300+++ systemd-230/src/core/shutdown.c 
2016-07-23 13:17:58.008983291 +0300@@ -272,6 +272,10 @@                         
        log_error_errno(r, "Failed to detach loop devices: %m");                
 } +                if (!in_container && !in_initrd() &&+                    
access("/run/initramfs/shutdown", X_OK) == 0) {+                        
log_info("Keeping all DM devices attached for easy access in the initramfs", 
r);+                } else {                 if (need_dm_detach) {              
           log_info("Detaching DM devices.");                         r = 
dm_detach_all();@@ -283,6 +287,7 @@                         else        
                         log_error_errno(r, "Failed to detach DM devices: %m"); 
                }+                }                  if (!need_umount && 
!need_swapoff && !need_loop_detach && !need_dm_detach) {                        
 if (retries > 0)

Judging by your response, this is unlikely to be accepted, so I have to 
maintain it myself, but as long as it does what I need, that's fine.
Thanks,IvanK.



On Friday, July 22, 2016 9:28 PM, Lennart Poettering 
 wrote:
 
 

 On Fri, 22.07.16 17:24, Ivan Kabaivanov (chep...@yahoo.com) wrote:



> Hi,
> I'm running LFS (Linux From Scratch) with systemd-230, compiled from source.  
> I have three LUKS-encrypted devices:
> /dev/mapper/swap/dev/mapper/root/dev/mapper/home
> I want to drop into initramfs and do some maintenance work, for which I 
> require all three of these encrypted devices to remain active.
> I create /run/initramfs with a populated and working initramfs.  I create 
> /run/initramfs/shutdown with permissions 0755 and the following content:
> #/bin/shexec busybox sh
> When I issue the shutdown command I get dropped into the initramfs and I get 
> the busybox shell.  Howerver, only /dev/mapper/root (my / ) remains active.  
> /dev/mapper/swap and /dev/mapper/home point to non-existent /dev/dm-* block 
> devices.
> Manually trying cryptsetup open /dev/sdaN label just hangs without activating 
> the device.
> I'm guessing systemd goes on a killing spree and kills all the crypt 
> processes, except the ones associated with / (/oldroot in the initramfs).
> Is there a way to tell systemd to keep the encrypted devices active, even if 
> it unmounts their filesystems?

No, this is currently not available. The killing spree will try to
unmount everything it can, detach all loopbacks it can, and
disassemble all DM devices it can (of which LUKS is one type). You are
shutting down after all...

Lennart

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