Thursday, February 22, 2024

switch_root PID 1

I am developing an initramfs with a custom init. For dev/test purposes I am spawning a bash shell at the end of the init startup sequence (but before the switch_root would normally happen) so I can work on complex parts of the boot process without doing a lot of build iteration.

I thought I had everything working, and did a test run - "exec switch_root /sysroot /sbin/init". That got me a nice kernel panic, the kind you get when init exits. Which is precisely what happens when you fork /bin/bash at the end of your init and exec switch_root from the forked shell.

The init process is PID 1 and the forked bash shell is... not PID 1. Attempting a switch_root from any process other than one running as PID 1 will not work.

The solution was to exec /bin/bash at the end of init so that the new shell becomes PID 1. Once I am happy with the way things work, I can get rid of the shell call and replace it with exec switch_root /sysroot /sbin/init.

Tuesday, January 30, 2024

Failed to connect to bus: No medium found

If you are trying to run a systemctl --user command as a non root user and getting "Failed to connect to bus: No medium found" this is probably because a few things are out of place.

First make sure you have linger turned on "sudo loginctl enable-linger $USER". This ensures that your services will hang around when you are not logged in.

Next, use the env command to make sure you have XDG_SESSION_ID and XDG_RUNTIME_DIR defined in your environment. If you do not see them, then you probably did not do a proper login. My guess is that you logged in as a different user and use the su command to change to your current user.

In that case, you pretty much have two choices.

  1. You can define XDG_RUNTIME_DIR manually with the following command: export XDG_RUNTIME_DIR=/run/user/$(id -u $USER)
  2. Log out and ssh back in directly as the desired user. This should trigger the PAM module that sets up the correct session variables.

Saturday, January 27, 2024

Fair and Honest Discourse

What follows are my personal rules and general philosophy for engaging in discourse. All of this information is tentative and will change in response to better information.

  • The purpose of discourse is to discard incorrect ideas.
  • I am a better person when I hold fewer incorrect ideas.
  • Discourse on a particular idea shall stop when:
    • requested.
    • it becomes unproductive.
    • everyone involved finds that they are in agreement.
  • Discourse that stops without general agreement is evidence of incomplete understanding.
  • General agreement is not evidence of the correctness of an idea.
  • Without the consent of those it affects, sensitive information shall be excluded from discourse.
  • A single piece of evidence is sufficient to disprove an idea.
  • An idea that has not been disproved must account for all relevant existing evidence.
  • An idea can never be proven to zero uncertainty.
  • Honest participation requires fair and full treatment of all proffered evidence.
  • One who discards an idea should graciously acknowledge the act.
  • One who discards an idea should credit the person who provided the evidence.
  • Goal posts can be moved as long as one clearly acknowledges their prior insufficiency.
  • The validity of a claim is not affected by its source.
  • The burden of proof is on the person making the claim.
  • Extraordinary claims require extraordinary evidence.
  • That which can be claimed without evidence can be discarded without evidence.

Monday, January 15, 2024

Furnace Maintenance

Disclaimer: Do your own research!  This information worked for me, but it may not be suitable for you. I am not responsible for anything that goes wrong when using this information.

This information applies to the following residential furnaces:

Carrier 58MVB, 58MVC, or 58MVP
Bryant: 355AAV, 355BAV, 355CAV, 355MAV
Payne: PG9UAA

All part numbers in the description below are current as of the date of this post. Manufacturers have a tendency to update part numbers, so do your research. The Carrier Enterprise site seems to be a good source of information, but unless you are an approved vendor you only have access to a minimal amount of information.

If your furnace is making a lot of grinding noises, your draft inducer assembly is probably going bad and needs to be replaced. This is an expensive part, but it is a small fraction of the cost of a new furnace and the replacement is something a reasonably handy homeowner can do on their own. The current draft inducer part number is 340793-762.

You will also need to ensure you have the correct pressure switch. If you have an old draft inducer assembly, your pressure switch will not fit on the new assembly and you will need to get a new one. If you have a 40,000 BTU/Hr furnace, you are going to need part number HK06NB025. For all other furnaces, you will need part number HK06NB023.

These pressure switches can be mounted to the bracket that comes with the 340793-762 draft inducer assembly, but you will need to find a few screws to make it happen. There are plenty of mount points on the pressure switch bodies, just be sure your screws are not so long that they pierce the plastic body of the pressure switch.

While undertaking this repair, it is important to check that the condensate trap and the hoses leading in to it are draining reliably. If any of these are plugged, condensation will back up and damage internal components of your furnace.

You might also find that some of your hoses are in bad shape. Part number 319873-715 is the hose that connects to the pressure switch (it has a pink label), and part number 319873-714 (green label) is the hose that connects to the condensate trap.

You should be able to find maintenance, troubleshooting, and installation manuals online. They will help a great deal when undertaking a repair like this.