I can confirm that your changes fixed the issue. I did several 10-20
restarts entering my password in different ways, quickly and also very
slowly... all boots were done without a problem.
Thanks a lot Jamie!

2021. 11.  2, kedd keltezéssel 09.07-kor Jamie Strandboge ezt írta:
> On Tue, 02 Nov 2021, Jamie Strandboge wrote:
> 
> > On Mon, 01 Nov 2021, Gera Zoltán wrote:
> > 
> > > It is the ufw oneshot service hanging indefinitely.
> > > 
> > > If you are using disk encryption, there is a high chance you
> > > cannot
> > > input your password fast enough, and around 50% of the time, ufw
> > > startjob hangs. Probably being on a slower wifi network also
> > > helps in
> > > reproduction as some people reported this happening only when
> > > being on
> > > a public wifi.
> > > 
> > > I guess, there is a dependency problem which does not come up
> > > when
> > > everything runs down smoothly and without delay. Probably finding
> > > it
> > > would be the best.
> > > 
> > > I am on Debian bullseye with disk encryption and hit this daily,
> > > so
> > > tell me what info to send! There are also many others affected:
> > > https://unix.stackexchange.com/questions/665144/ufw-not-allowing-to-boot-debian-11
> > 
> > I tried to reproduce this in a VM with LVM encryption and could
> > not. The
> > other thread mentioned that firewalld was not affected by this, so
> > I
> > took a look at its systemd unit. Can you edit
> > /lib/systemd/system/ufw.service to have:
> > 
> > #Before=network.target
> > Before=network-pre.target
> > Wants=network-pre.target
> > 
> > (ie, comment out 'Before=network.target' and then add Before and
> > Wants
> > for network-pre.target). Everything else should be the same.
> > 
> > After making this change, run:
> > 
> > $ sudo systemctl daemon-reload
> > 
> > Then reboot and see if it resolves the issue for you.
> 
> Actually, since you mentioned encrypted partitions, can you also make
> sure that DefaultDependencies=no is commented out? The complete file
> should look like:
> 
> [Unit]
> Description=Uncomplicated firewall
> Documentation=man:ufw(8)
> #DefaultDependencies=no
> #Before=network.target
> Before=network-pre.target
> Wants=network-pre.target
> 
> [Service]
> Type=oneshot
> RemainAfterExit=yes
> ExecStart=/lib/ufw/ufw-init start quiet
> ExecStop=/lib/ufw/ufw-init stop
> 
> [Install]
> WantedBy=multi-user.target
> 
> Thanks!
> 

Reply via email to