[gentoo-user] Cannot shutdown or reboot because of logind disconnection

2022-09-16 Thread johnstrass
Dear friends,


After compiling gcc,  I ran reboot or shutdown, and it shows
" Failed to reboot system via logind: connection timed out".


If use "systemctl daemon-reexec" or "systemctl daemon-reload", it shows "Failed 
to reload daemon: Transport endpoint is not connected".


Compiling gcc uses alot of memory, sometimes only less then 10MB left free ( I 
am doing this on a small yeeloong netbook with only 1GB memory).  This may 
cause the logind disconnected. However, after the compilation, there should be 
enough memery left. However the logind is still disconnected.


If this happens, what is the best way to reboot or shutdown?


Why does the systemd need logind to shutdown? Is it possible to design a way to 
just shutdown without access of the logind?


Thanks.

Re: [gentoo-user] Separate /usr partition

2022-09-16 Thread Rich Freeman
On Fri, Sep 16, 2022 at 11:16 AM Peter Humphrey  wrote:
>
>
> 1.  dracut: 90crypt: Could not find any command of '/lib/systemd/systemd-
> cryptsetup cryptsetup'!
>
> ...and similar for bluetooth.
>
> What do I have to include in /etc/dracut.conf.d/mine.conf to silence these? I
> already omit the relevant modules:
>
> $ grep -e crypt -e blue /etc/dracut.conf.d/mine.conf
> omit_dracutmodules+=" bluetoothd "
> omit_dracutmodules+=" systemd-cryptsetup "
> omit_dracutmodules+=" cryptsetup "
>

There are no modules by any of those names, so these config settings
are a no-op.

systemd-cryptsetup is called by the crypt module
There is also a bluetooth module.

Modules are located in /usr/lib/dracut/modules.d.

I suspect the output of dracut mentions the names of the modules it is
loading as well, or probably has a verbosity flag to have it talk more
about what it is doing.

For the most part modules tend to be automagic.  Each one figures out
if you're using it, and installs stuff if needed, and if not it
no-ops.  So if it can't find cryptsetup then it won't go trying to put
support for it in the initramfs.  I do get though that people prefer
to have commands avoid output in a successful state, so omitting those
modules should do the trick.

Dracut modules are pretty simple in their operation.  They all have a
module-setup.sh script which is run by dracut and which does any
logic, tells dracut what to install in the initramfs, and which
registers scripts to run during various phases of boot.  I haven't
looked at them in ages but I did write up this article on how they
work: https://rich0gentoo.wordpress.com/2012/01/21/a-quick-dracut-module/

-- 
Rich



Re: [gentoo-user] Separate /usr partition

2022-09-16 Thread Peter Humphrey
On Friday, 16 September 2022 16:25:31 BST Dale wrote:

> On the ones you want to omit, is there supposed to be a space in there? 
> Should it be like this instead:
> 
> omit_dracutmodules+="bluetoothd"
> omit_dracutmodules+="systemd-cryptsetup"
> omit_dracutmodules+="cryptsetup"
> 
> It may not matter but then again, it just might.  Worth a try I'd guess. 

The wiki says "note the leading and trailing spaces", so no.

> :-)  :-) 
> 
> P. S.  Finally, someone broke it.  ROFLMBO 

Anything you can do, I can do better!   :-)  :-)  :-)

-- 
Regards,
Peter.






Re: [gentoo-user] Separate /usr partition

2022-09-16 Thread Dale
Peter Humphrey wrote:
> On Thursday, 15 September 2022 09:57:44 BST I wrote:
>> On Wednesday, 14 September 2022 23:09:59 BST Neil Bothwick wrote:
>>> On Wed, 14 Sep 2022 16:50:45 +0100, Peter Humphrey wrote:
 I'm thinking of separating /usr onto its own partition so that I can
 have it mounted read-only except while updating it. I'd prefer not to
 have to make an init thingy, not having needed one up to now. Besides,
 some machines have things like early-ucode or amd-uc.
>>> Most of this has already been answered, except for your final point. You
>>> can load more than one initrd at boot, so you can still apply microcode
>>> updates. For example, with systemd-boot
>>>
>>> title   Desktop
>>> version 5.15.59-gentoo
>>> linux   /vmlinuz-5.15.59-gentoo
>>> options root=LABEL=blah blah
>>> initrd  /amd-uc.img
>>> initrd  /initramfs-5.15.59-gentoo.img
>>>
>>> I use dracut to create the initrd, which is so straighforward even Dale
>>> can't break it ;-)
>> :
>> :)
>>
>> That seems to be the way to go then - even dinosaurs die out in the end.
>> Perhaps Dale will show us the command he referred to.
> Well, it's taken a few hours, but I have it working. Just a few wrinkles to 
> clear up:
>
> 1.  dracut: 90crypt: Could not find any command of '/lib/systemd/systemd-
> cryptsetup cryptsetup'!
>
> ...and similar for bluetooth.
>
> What do I have to include in /etc/dracut.conf.d/mine.conf to silence these? I 
> already omit the relevant modules:
>
> $ grep -e crypt -e blue /etc/dracut.conf.d/mine.conf
> omit_dracutmodules+=" bluetoothd "
> omit_dracutmodules+=" systemd-cryptsetup "
> omit_dracutmodules+=" cryptsetup "
>
> 2.  dracut: No KEYMAP configured.
>
> $ grep i18n /etc/dracut.conf.d/mine.conf
> i18n_vars="/etc/conf.d/keymaps:KEYMAP /etc/conf.d/keymaps:WINDOWKEYS /
> etc/conf.d/consolefont:FONT"
>
> Notice that only KEYMAP is complained about. The FONT in consolefont points 
> to 
> /usr as well as KEYMAP. 
>


On the ones you want to omit, is there supposed to be a space in there? 
Should it be like this instead:


omit_dracutmodules+="bluetoothd"
omit_dracutmodules+="systemd-cryptsetup"
omit_dracutmodules+="cryptsetup"


It may not matter but then again, it just might.  Worth a try I'd guess. 

Hope that helps. 

Dale

:-)  :-) 

P. S.  Finally, someone broke it.  ROFLMBO 



Re: [gentoo-user] Separate /usr partition

2022-09-16 Thread Peter Humphrey
On Thursday, 15 September 2022 09:57:44 BST I wrote:
> On Wednesday, 14 September 2022 23:09:59 BST Neil Bothwick wrote:
> > On Wed, 14 Sep 2022 16:50:45 +0100, Peter Humphrey wrote:
> > > I'm thinking of separating /usr onto its own partition so that I can
> > > have it mounted read-only except while updating it. I'd prefer not to
> > > have to make an init thingy, not having needed one up to now. Besides,
> > > some machines have things like early-ucode or amd-uc.
> > 
> > Most of this has already been answered, except for your final point. You
> > can load more than one initrd at boot, so you can still apply microcode
> > updates. For example, with systemd-boot
> > 
> > title   Desktop
> > version 5.15.59-gentoo
> > linux   /vmlinuz-5.15.59-gentoo
> > options root=LABEL=blah blah
> > initrd  /amd-uc.img
> > initrd  /initramfs-5.15.59-gentoo.img
> > 
> > I use dracut to create the initrd, which is so straighforward even Dale
> > can't break it ;-)
> :
> :)
> 
> That seems to be the way to go then - even dinosaurs die out in the end.
> Perhaps Dale will show us the command he referred to.

Well, it's taken a few hours, but I have it working. Just a few wrinkles to 
clear up:

1.  dracut: 90crypt: Could not find any command of '/lib/systemd/systemd-
cryptsetup cryptsetup'!

...and similar for bluetooth.

What do I have to include in /etc/dracut.conf.d/mine.conf to silence these? I 
already omit the relevant modules:

$ grep -e crypt -e blue /etc/dracut.conf.d/mine.conf
omit_dracutmodules+=" bluetoothd "
omit_dracutmodules+=" systemd-cryptsetup "
omit_dracutmodules+=" cryptsetup "

2.  dracut: No KEYMAP configured.

$ grep i18n /etc/dracut.conf.d/mine.conf
i18n_vars="/etc/conf.d/keymaps:KEYMAP /etc/conf.d/keymaps:WINDOWKEYS /
etc/conf.d/consolefont:FONT"

Notice that only KEYMAP is complained about. The FONT in consolefont points to 
/usr as well as KEYMAP. 

-- 
Regards,
Peter.