Re: [systemd-devel] Need help with setting up systemd for Apache on Debian 10

2020-08-23 Thread Reindl Harald



Am 23.08.20 um 19:19 schrieb Tom Browder:
> There is no official Apache systemd setup for Apache from source, and
> I didn't get any help from users there. I tried to mimic a good
> solution by first installing Apache with the Debian package and
> finding all the systemd files with "httpd" or "apache" in the name.
> That resulted in the following list:
> 
> /etc/systemd/system/multi-user.target.wants/apache2.service
> /run/systemd/units/invocation:apache2.service
> /usr/lib/systemd/system/apache2.service
> /var/lib/systemd/deb-systemd-helper-enabled/apache2.service.dsh-also
> 
> /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/apache2.service
> 
> The contents of the "apache2.service" file are:
> 
> [Unit]
> Description=The Apache HTTP Server
> After=network.target remote-fs.target nss-lookup.target
> 
> [Service]
> Type=forking
> Environment=APACHE_STARTED_BY_SYSTEMD=true
> ExecStart=/usr/sbin/apachectl start
> ExecStop=/usr/sbin/apachectl stop
> ExecReload=/usr/sbin/apachectl graceful
> PrivateTmp=true
> Restart=on-abort
> 
> [Install]
> WantedBy=multi-user.target

what is your specific problem?

besdies there is no need for ExecStop at all and you can use type=simple
combined with "-D FOREGROUND"

EnvironmentFile=-/etc/sysconfig/httpd
Environment="PATH=/usr/bin:/usr/sbin"
Environment="LANG=C.UTF-8"
ExecStart=/usr/sbin/httpd $OPTIONS -D FOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful

DUNNO what's about all that useless "deb-systemd-helper"

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


Re: [systemd-devel] Need help with setting up systemd for Apache on Debian 10

2020-08-23 Thread Tom Browder
On Sun, Aug 23, 2020 at 12:36 PM Tomasz Torcz  wrote:
>
...
>   First of all, you got correct installation by installing distribution
> package.  You can stop there.
>   If you want to do the work, anyway, do the following:
>   – read man systemd.unit, systemd.service, maybe some systemd tutorials
>   – devise your own service unit file for apache httd; you have two
> examples already
>   – in your package, install the unit into /usr/lib/systemd/system/

Thanks, Tomasz.

Best regards.

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


Re: [systemd-devel] Need help with setting up systemd for Apache on Debian 10

2020-08-23 Thread Tomasz Torcz
On Sun, Aug 23, 2020 at 12:19:15PM -0500, Tom Browder wrote:
> There is no official Apache systemd setup for Apache from source, and
> I didn't get any help from users there. I tried to mimic a good
> solution by first installing Apache with the Debian package and
> finding all the systemd files with "httpd" or "apache" in the name.
> That resulted in the following list:
> 
> /etc/systemd/system/multi-user.target.wants/apache2.service

  That a symlink causing apache httpd to be started on boot.

> /run/systemd/units/invocation:apache2.service

  Internal stuff, ignore.

> /usr/lib/systemd/system/apache2.service

  This is the only file that matters.

> /var/lib/systemd/deb-systemd-helper-enabled/apache2.service.dsh-also
> 
> /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/apache2.service

  This is some Debian stuff.

> The contents of the "apache2.service" file are:

  That's one way correct way to do it. To see other, check httpd.service
as shipped by Fedora: https://src.fedoraproject.org/rpms/httpd/tree/master

 
> I assume the data are correct, and I'm pretty sure there is some
> fancy, automated sysstemctl way to get it all working.  I would
> greatly appreciate some guidance as to how to install the files
> correctly.

  First of all, you got correct installation by installing distribution
package.  You can stop there.
  If you want to do the work, anyway, do the following:
  – read man systemd.unit, systemd.service, maybe some systemd tutorials
  – devise your own service unit file for apache httd; you have two
examples already
  – in your package, install the unit into /usr/lib/systemd/system/


-- 
Tomasz TorczTo co nierealne – tutaj jest normalne.
to...@pipebreaker.pl  Ziomale na życie mają tu patenty specjalne.

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


Re: [systemd-devel] Need help with setting up systemd for Apache on Debian 10

2020-08-23 Thread Michael Biebl
Am So., 23. Aug. 2020 um 19:20 Uhr schrieb Tom Browder :

> I assume the data are correct, and I'm pretty sure there is some
> fancy, automated sysstemctl way to get it all working.  I would
> greatly appreciate some guidance as to how to install the files
> correctly.

Those files are installed correctly. What's your specific question?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Need help with setting up systemd for Apache on Debian 10

2020-08-23 Thread Tom Browder
There is no official Apache systemd setup for Apache from source, and
I didn't get any help from users there. I tried to mimic a good
solution by first installing Apache with the Debian package and
finding all the systemd files with "httpd" or "apache" in the name.
That resulted in the following list:

/etc/systemd/system/multi-user.target.wants/apache2.service
/run/systemd/units/invocation:apache2.service
/usr/lib/systemd/system/apache2.service
/var/lib/systemd/deb-systemd-helper-enabled/apache2.service.dsh-also

/var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/apache2.service

The contents of the "apache2.service" file are:

[Unit]
Description=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
Environment=APACHE_STARTED_BY_SYSTEMD=true
ExecStart=/usr/sbin/apachectl start
ExecStop=/usr/sbin/apachectl stop
ExecReload=/usr/sbin/apachectl graceful
PrivateTmp=true
Restart=on-abort

[Install]
WantedBy=multi-user.target

For each of the files in the list O executed "ls -l" and got the
following results:

File 1 (links to File 3 below)
==
/etc/systemd/system/multi-user.target.wants/apache2.service
  lrwxrwxrwx 1 root root 35 Jun 18 16:01
  /etc/systemd/system/multi-user.target.wants/apache2.service
  -> /lib/systemd/system/apache2.service

File 2 (links to some hash)??
=
/run/systemd/units/invocation:apache2.service
  lrwxrwxrwx 1 root root 32 Jun 18 16:01
  /run/systemd/units/invocation:apache2.service
  -> 5b87576fe6a04e079651d979d8a9c7f6

File 3
==
/usr/lib/systemd/system/apache2.service
  -rw-r--r-- 1 root root 395 Oct 13  2019
  /usr/lib/systemd/system/apache2.service

File 4
==
/var/lib/systemd/deb-systemd-helper-enabled/apache2.service.dsh-also
  -rw-r--r-- 1 root root 60 Jun 18 16:01
  /var/lib/systemd/deb-systemd-helper-enabled/apache2.service.dsh-also

File 5
==
/var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/apache2.service
  -rw-r--r-- 1 root root 0 Jun 18 16:01
  
/var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/apache2.service

I assume the data are correct, and I'm pretty sure there is some
fancy, automated sysstemctl way to get it all working.  I would
greatly appreciate some guidance as to how to install the files
correctly.

Thanks.

Best regards,

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


Re: [systemd-devel] [Help] Can't log in to homed user account: "No space left on device"

2020-08-23 Thread Andrii Zymohliad
> Here is the log after authentication attempt: 
> https://gitlab.com/-/snippets/2007113
> And just in case here is the full log since boot: 
> https://gitlab.com/-/snippets/2007112

Sorry, links are broken, re-uploaded:

Authentication part: https://gitlab.com/-/snippets/2007123
Full log: https://gitlab.com/-/snippets/2007124
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [Help] Can't log in to homed user account: "No space left on device"

2020-08-23 Thread Andrii Zymohliad


> As far as I can tell if discards are disabled, systemd tries to allocate
> full size of backing file. It is possible that there is simply not
> enough space to ensure full 400G (i.e. available space it consumed by
> something else). Are there are snapshots

Sorry, I think I lack some background to fully understand what you wrote. Do 
you mean if I had "discard" mount option enabled on both home and root 
filesystems, it would not need to allocate the full size of home partition file?

First thing that confuses me is, why I have less than 400G allocated on my root 
partition before authentication if home file is 400G? I thought that in case of 
LUKS, /home/azymohliad.home should be an opaque file that always takes 400G on 
the root filesystem. But `btrfs fi du /home` shows that it's only 256G (which 
is the actual usage of internal partition on it). `btrfs fi usage /` shows that 
I have 176G free space, which as I understand should be enough to allocate the 
remaining 400G - 256G = <150G for home, although I suppose simple arithmetic 
doesn't work here, I'm not really familiar with btrfs.

Not sure what are snapshots, but I haven't made any explicitly.


> Try enabling debug log level, this will give more details about what
> happens.

I added these kernel arguments:

systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M 
printk.devkmsg=on enforcing=0

Here is the log after authentication attempt: 
https://gitlab.com/-/snippets/2007113
And just in case here is the full log since boot: 
https://gitlab.com/-/snippets/2007112
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Shut down system after all sshd instances terminate

2020-08-23 Thread Daan De Meyer
That works! Thanks so much for the quick response.

I still feel it's a bit unintuitive though. I did find multiple open
issues asking for inhibitors that work with root as well. I think that
would be necessary for an intuitive solution.

Ideally, the following unit file would work:

```
[Unit]
Description=SSH Server for {args.devserver_name} devserver
After=network.target
After=exit.target

[Service]
ExecStart=/usr/sbin/sshd -i
StandardInput=socket
SuccessAction=exit
FailureAction=exit
Inhibit=exit:delay
InhibitDelaySec=infinite
```

This would tell systemd to start a normal exit when the first instance
exits. The Inhibit options tell systemd to delay exit infinitely if
any instance is still running.

For now, your solution is a great alternative.

Daan

On Sun, 23 Aug 2020 at 16:13, Benjamin Berg  wrote:
>
> Hi,
>
> you can use Wants= to pull in another service, and then use
> StopWhenUnneeded= to make that shutdown after the last sshd@.service
> disappears.
>
> So, I guess something like the below:
>
> sshd@.service drop-in:
> ```
> [Unit]
> Wants=sshd-running.service
> ```
>
> sshd-running.service
> ```
> [Unit]
> StopWhenUnneeded=true
>
> [Service]
> Type=oneshot
> RemainAfterExit=yes
>
> # Not sure if SuccessAction works
> # probably does but you might need a dummy ExecStart=/sbin/true then
> ExecStop=systemctl poweroff
> #SuccessAction=exit
> ```
>
> Benjamin
>
> On Sun, 2020-08-23 at 16:02 +0100, Daan De Meyer wrote:
> > Nvm, that wouldn't work at all because inhibitor locks are ignored if
> > the user is privileged enough.
> >
> > So getting the system to shut down after an sshd instance exits is
> > easy enough with SuccessAction. Waiting for all sshd instances to
> > finish before shutting down turns out to be extremely hard. I've been
> > trying out stuff for multiple hours now and haven't come even close.
> > There definitely seems to be at least a documentation issue here so
> > if
> > there's a solution I intend to make a PR that clarifies this
> > somewhere
> > in the official documentation.
> >
> > My last (failed) attempt is this (sshd@.service) :
> >
> > ```
> > [Unit]
> > Description=SSH Server for {args.devserver_name} devserver
> > After=network.target
> > After=exit.target
> >
> > [Service]
> > ExecStart=/usr/sbin/sshd -i
> > KillMode=none
> > TimeoutStopSec=infinity
> > StandardInput=socket
> > SuccessAction=exit
> > FailureAction=exit
> > ```
> >
> > When an ssh connection comes in, an instance of this template is
> > started to handle the connection. Now, what I want to achieve is that
> > when all instances of this sshd template exit after at least one
> > instance has started, the system shuts down.
> >
> > Daan
> >
> > On Sun, 23 Aug 2020 at 14:47, Daan De Meyer  > > wrote:
> > > Hi,
> > >
> > > After following
> > > http://0pointer.de/blog/projects/socket-activated-containers.html
> > > which details how to set up a socket activated container, I'm
> > > looking
> > > into ways to have the container automatically shut down when the
> > > last
> > > ssh connection terminates.
> > >
> > > My idea was to have each sshd instance take an inhibitor lock (the
> > > blocking kind) that prevents poweroff and make each sshd instance
> > > pull
> > > in poweroff.target. The problem is that the inhibitor documentation
> > > mentions that poweroff operations will fail if a blocking inhibitor
> > > lock is taken. For this to work, I need poweroff.target to wait
> > > indefinitely until all locks are released. Is this possible at the
> > > moment?
> > >
> > > Any other suggestions on how to achieve this are appreciated as
> > > well.
> > >
> > > Cheers,
> > >
> > > Daan
> > ___
> > systemd-devel mailing list
> > systemd-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> >
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Shut down system after all sshd instances terminate

2020-08-23 Thread Benjamin Berg
Hi,

you can use Wants= to pull in another service, and then use
StopWhenUnneeded= to make that shutdown after the last sshd@.service
disappears.

So, I guess something like the below:

sshd@.service drop-in:
```
[Unit]
Wants=sshd-running.service
```

sshd-running.service
```
[Unit]
StopWhenUnneeded=true

[Service]
Type=oneshot
RemainAfterExit=yes

# Not sure if SuccessAction works
# probably does but you might need a dummy ExecStart=/sbin/true then
ExecStop=systemctl poweroff
#SuccessAction=exit
```

Benjamin

On Sun, 2020-08-23 at 16:02 +0100, Daan De Meyer wrote:
> Nvm, that wouldn't work at all because inhibitor locks are ignored if
> the user is privileged enough.
> 
> So getting the system to shut down after an sshd instance exits is
> easy enough with SuccessAction. Waiting for all sshd instances to
> finish before shutting down turns out to be extremely hard. I've been
> trying out stuff for multiple hours now and haven't come even close.
> There definitely seems to be at least a documentation issue here so
> if
> there's a solution I intend to make a PR that clarifies this
> somewhere
> in the official documentation.
> 
> My last (failed) attempt is this (sshd@.service) :
> 
> ```
> [Unit]
> Description=SSH Server for {args.devserver_name} devserver
> After=network.target
> After=exit.target
> 
> [Service]
> ExecStart=/usr/sbin/sshd -i
> KillMode=none
> TimeoutStopSec=infinity
> StandardInput=socket
> SuccessAction=exit
> FailureAction=exit
> ```
> 
> When an ssh connection comes in, an instance of this template is
> started to handle the connection. Now, what I want to achieve is that
> when all instances of this sshd template exit after at least one
> instance has started, the system shuts down.
> 
> Daan
> 
> On Sun, 23 Aug 2020 at 14:47, Daan De Meyer  > wrote:
> > Hi,
> > 
> > After following
> > http://0pointer.de/blog/projects/socket-activated-containers.html
> > which details how to set up a socket activated container, I'm
> > looking
> > into ways to have the container automatically shut down when the
> > last
> > ssh connection terminates.
> > 
> > My idea was to have each sshd instance take an inhibitor lock (the
> > blocking kind) that prevents poweroff and make each sshd instance
> > pull
> > in poweroff.target. The problem is that the inhibitor documentation
> > mentions that poweroff operations will fail if a blocking inhibitor
> > lock is taken. For this to work, I need poweroff.target to wait
> > indefinitely until all locks are released. Is this possible at the
> > moment?
> > 
> > Any other suggestions on how to achieve this are appreciated as
> > well.
> > 
> > Cheers,
> > 
> > Daan
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 


signature.asc
Description: This is a digitally signed message part
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Shut down system after all sshd instances terminate

2020-08-23 Thread Daan De Meyer
Nvm, that wouldn't work at all because inhibitor locks are ignored if
the user is privileged enough.

So getting the system to shut down after an sshd instance exits is
easy enough with SuccessAction. Waiting for all sshd instances to
finish before shutting down turns out to be extremely hard. I've been
trying out stuff for multiple hours now and haven't come even close.
There definitely seems to be at least a documentation issue here so if
there's a solution I intend to make a PR that clarifies this somewhere
in the official documentation.

My last (failed) attempt is this (sshd@.service) :

```
[Unit]
Description=SSH Server for {args.devserver_name} devserver
After=network.target
After=exit.target

[Service]
ExecStart=/usr/sbin/sshd -i
KillMode=none
TimeoutStopSec=infinity
StandardInput=socket
SuccessAction=exit
FailureAction=exit
```

When an ssh connection comes in, an instance of this template is
started to handle the connection. Now, what I want to achieve is that
when all instances of this sshd template exit after at least one
instance has started, the system shuts down.

Daan

On Sun, 23 Aug 2020 at 14:47, Daan De Meyer  wrote:
>
> Hi,
>
> After following
> http://0pointer.de/blog/projects/socket-activated-containers.html
> which details how to set up a socket activated container, I'm looking
> into ways to have the container automatically shut down when the last
> ssh connection terminates.
>
> My idea was to have each sshd instance take an inhibitor lock (the
> blocking kind) that prevents poweroff and make each sshd instance pull
> in poweroff.target. The problem is that the inhibitor documentation
> mentions that poweroff operations will fail if a blocking inhibitor
> lock is taken. For this to work, I need poweroff.target to wait
> indefinitely until all locks are released. Is this possible at the
> moment?
>
> Any other suggestions on how to achieve this are appreciated as well.
>
> Cheers,
>
> Daan
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Shut down system after all sshd instances terminate

2020-08-23 Thread Daan De Meyer
Hi,

After following
http://0pointer.de/blog/projects/socket-activated-containers.html
which details how to set up a socket activated container, I'm looking
into ways to have the container automatically shut down when the last
ssh connection terminates.

My idea was to have each sshd instance take an inhibitor lock (the
blocking kind) that prevents poweroff and make each sshd instance pull
in poweroff.target. The problem is that the inhibitor documentation
mentions that poweroff operations will fail if a blocking inhibitor
lock is taken. For this to work, I need poweroff.target to wait
indefinitely until all locks are released. Is this possible at the
moment?

Any other suggestions on how to achieve this are appreciated as well.

Cheers,

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


Re: [systemd-devel] [Help] Can't log in to homed user account: "No space left on device"

2020-08-23 Thread Andrei Borzenkov
23.08.2020 15:34, Andrii Zymohliad пишет:
>> Here is the log after authentication attempt: 
>> https://gitlab.com/-/snippets/2007113
>> And just in case here is the full log since boot: 
>> https://gitlab.com/-/snippets/2007112
> 
> Sorry, links are broken, re-uploaded:
> 
> Authentication part: https://gitlab.com/-/snippets/2007123
> Full log: https://gitlab.com/-/snippets/2007124
> 

Yes, as suspected:

> сер 23 14:12:48 az-wolf-pc systemd-homed[917]: Not enough disk space
to fully allocate home.

This comes from

if (fallocate(backing_fd, FALLOC_FL_KEEP_SIZE, 0, st->st_size) <
0) {

...
if (ERRNO_IS_DISK_SPACE(errno)) {
log_debug_errno(errno, "Not enough disk space to
fully allocate home.");
return -ENOSPC; /* make recognizable */
}

return log_error_errno(errno, "Failed to allocate
backing file blocks: %m");
}

So fallocate syscall failed. Try manually

fallocate -l 403G -n /home/azymohliad.home

if it fails too, the question is better asked on btrfs list.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [Help] Can't log in to homed user account: "No space left on device"

2020-08-23 Thread Andrii Zymohliad
Hello! I've lost the ability to log in to my systemd-homed user account. I 
would be very grateful for any help!

If I log in as root and try to authenticate:

# homectl authenticate azymohliad

Then after typing my password I get the following output:

Operation on home azymohliad failed: Not enough disk space for home azymohliad

It also produces the following system logs:

сер 22 09:11:08 az-wolf-pc systemd-homed[425]: azymohliad: changing state 
inactive → authenticating

сер 22 09:11:08 az-wolf-pc systemd-homework[1215]: None of the supplied 
plaintext passwords unlocks the user record's hashed passwords.

сер 22 09:11:08 az-wolf-pc systemd-homed[425]: Authentication failed: Required 
key not available

сер 22 09:11:08 az-wolf-pc systemd-homed[425]: azymohliad: changing state 
authenticating → inactive

сер 22 09:11:23 az-wolf-pc systemd-homed[425]: azymohliad: changing state 
inactive → authenticating

сер 22 09:11:23 az-wolf-pc systemd-homework[1216]: Provided password unlocks 
user record.

сер 22 09:11:23 az-wolf-pc systemd-homed[425]: Authentication failed: No space 
left on device

сер 22 09:11:23 az-wolf-pc systemd-homed[425]: azymohliad: changing state 
authenticating → inactive

And here 
[https://pastebin.com/BwkkvbZr](https://pastebin.com/BwkkvbZr]here[/url) is the 
full log since the last boot.

My root filesystem is BTRFS, home is LUKS-encrypted BTRFS on a loopback file. 
Here's the details:

# homectl inspect azymohliad

User name: azymohliad
State: inactive
Disposition: regular
Last Change: Thu 2020-06-25 17:41:52 EEST
Last Passw.: Thu 2020-06-04 19:04:43 EEST
Login OK: yes
Password OK: yes
UID: 60265
GID: 60265 (azymohliad)
Aux. Groups: audio
docker
wheel
Real Name: Andrii Zymohliad
Directory: /home/azymohliad
Storage: luks (strong encryption)
Image Path: /home/azymohliad.home
Removable: no
Shell: /usr/bin/fish
LUKS Discard: online=no offline=yes
LUKS UUID: 4ed4c05040e4429ca0163bb40587ec2d
Part UUID: 3ed283c030ab42778c1fb75aeeccc88e
FS UUID: 4ffae38b42c94e5389a13d21cd862938
File System: btrfs
LUKS Cipher: aes
Cipher Mode: xts-plain64
Volume Key: 256bit
Mount Flags: nosuid nodev exec
Disk Size: 402.7G
Disk Floor: 256.0M
Disk Ceiling: 429.3G
Good Auth.: 362
Last Good: Fri 2020-08-21 19:23:27 EEST
Bad Auth.: 128
Last Bad: Sat 2020-08-22 09:45:32 EEST
Next Try: anytime
Auth. Limit: 30 attempts per 1min
Passwords: 1
Local Sig.: yes
Service: io.systemd.Home

My root partition is 475G, and as you can see, home file size is ~400G (I guess 
it was stupid to leave only 75G for root in the first place). But for some 
reason `btrfs fi usage /` shows that only 352G are allocated on the device 
before I try to authenticate (every time after boot), and full 475G after 
authentication attempt.

I've posted some more btrfs info outputs on Arch forum 
(https://bbs.archlinux.org/viewtopic.php?id=258382). I'm not sure how to 
properly format snippets on mail list and how convenient it is to read them 
here, first time on tech mail list.

I can unlock and mount my /home/azymohliad.home file manually, so that confirms 
that it's not corrupted. I haven't tried to resize it manually (outside of 
homectl), I'm afraid to do anything wrong.

Thanks for taking time to read this far! Is there anything obvious here that I 
can do to fix it? Or any hints where to look?___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [Help] Can't log in to homed user account: "No space left on device"

2020-08-23 Thread Andrei Borzenkov
23.08.2020 09:34, Andrii Zymohliad пишет:
> Hello! I've lost the ability to log in to my systemd-homed user account. I 
> would be very grateful for any help!
> 
> If I log in as root and try to authenticate:
> 
> # homectl authenticate azymohliad
> 
> Then after typing my password I get the following output:
> 
> Operation on home azymohliad failed: Not enough disk space for home azymohliad
> 
> It also produces the following system logs:
> 
> сер 22 09:11:08 az-wolf-pc systemd-homed[425]: azymohliad: changing state 
> inactive → authenticating
> 
> сер 22 09:11:08 az-wolf-pc systemd-homework[1215]: None of the supplied 
> plaintext passwords unlocks the user record's hashed passwords.
> 
> сер 22 09:11:08 az-wolf-pc systemd-homed[425]: Authentication failed: 
> Required key not available
> 
> сер 22 09:11:08 az-wolf-pc systemd-homed[425]: azymohliad: changing state 
> authenticating → inactive
> 
> сер 22 09:11:23 az-wolf-pc systemd-homed[425]: azymohliad: changing state 
> inactive → authenticating
> 
> сер 22 09:11:23 az-wolf-pc systemd-homework[1216]: Provided password unlocks 
> user record.
> 
> сер 22 09:11:23 az-wolf-pc systemd-homed[425]: Authentication failed: No 
> space left on device
> 
> сер 22 09:11:23 az-wolf-pc systemd-homed[425]: azymohliad: changing state 
> authenticating → inactive
> 
> And here 
> [https://pastebin.com/BwkkvbZr](https://pastebin.com/BwkkvbZr]here[/url) is 
> the full log since the last boot.
> 
> My root filesystem is BTRFS, home is LUKS-encrypted BTRFS on a loopback file. 
> Here's the details:
> 
> # homectl inspect azymohliad
> 
> User name: azymohliad
> State: inactive
> Disposition: regular
> Last Change: Thu 2020-06-25 17:41:52 EEST
> Last Passw.: Thu 2020-06-04 19:04:43 EEST
> Login OK: yes
> Password OK: yes
> UID: 60265
> GID: 60265 (azymohliad)
> Aux. Groups: audio
> docker
> wheel
> Real Name: Andrii Zymohliad
> Directory: /home/azymohliad
> Storage: luks (strong encryption)
> Image Path: /home/azymohliad.home
> Removable: no
> Shell: /usr/bin/fish
> LUKS Discard: online=no offline=yes
...>
> My root partition is 475G, and as you can see, home file size is ~400G (I 
> guess it was stupid to leave only 75G for root in the first place). But for 
> some reason `btrfs fi usage /` shows that only 352G are allocated on the 
> device before I try to authenticate (every time after boot), and full 475G 
> after authentication attempt.

As far as I can tell if discards are disabled, systemd tries to allocate
full size of backing file. It is possible that there is simply not
enough space to ensure full 400G (i.e. available space it consumed by
something else). Are there are snapshots

Try enabling debug log level, this will give more details about what
happens.

> 
> I've posted some more btrfs info outputs on Arch forum 
> (https://bbs.archlinux.org/viewtopic.php?id=258382). I'm not sure how to 
> properly format snippets on mail list and how convenient it is to read them 
> here, first time on tech mail list.
> 
> I can unlock and mount my /home/azymohliad.home file manually, so that 
> confirms that it's not corrupted. I haven't tried to resize it manually 
> (outside of homectl), I'm afraid to do anything wrong.
> 
> Thanks for taking time to read this far! Is there anything obvious here that 
> I can do to fix it? Or any hints where to look?
> 
> 
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 

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