DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 8th January 2023
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default Single User Shell Terminated

I am running OpenBSD -current on a ThinkPad X220.
Trying to do a sysupgrade this morning. All files download with no problem. However upon rebooting I get an endless stream of:

init: single user shell terminated, restarting.

Any suggestions would be appreciated.

Thank you
Reply With Quote
  #2   (View Single Post)  
Old 8th January 2023
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I'll have to guess. Most likely, you had provisioned root's shell to use a third party package shell. Third party package shells are stored in /usr/local, and I'll guess that it isn't mounted. To recover to the default shell:
  1. Boot into single-user mode (boot> -s), and when prompted for the shell to use, take the default "sh" offered to you, or reply with "/bin/sh" explicitly.
  2. Mount all filesystems with # mount -a, which will also mount the root partition read/write so you can make changes.
  3. Change root's shell back to its default ksh shell with # chsh -s /bin/ksh root
  4. Reboot with # reboot

Last edited by jggimi; 8th January 2023 at 03:44 PM. Reason: clarity
Reply With Quote
  #3   (View Single Post)  
Old 8th January 2023
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

I never changed root's shell and have no 3rd party package shells installed.
Even so, I tried your suggestion - no good.
Upon rebooting I noticed a message:
bsd.upgrade is not u+x
I chenged to permissions on bsd.upgrade and tried again - same error message - single user shell terminated.

The only changes I've made recently is provisioning proton vpn. I disabled openvpn, undid all the proton vpn changes and tried again - still no good.

I would appreciate any other suggestions you may have.

Thank you
Reply With Quote
  #4   (View Single Post)  
Old 9th January 2023
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I don't know what went wrong for you. You have a couple of options for recovery. Restoring from backup is, of course, the safest.

The other option is to bring up your damaged system and run sysupgrade again. I cannot tell you if the problem will repeat, or if the problem will be circumvented.

Steps are similar:
  1. Boot into single-user mode, as above.
  2. Mount all filesystems, as above.
  3. Start your network, with # sh /etc/netstart
  4. Rerun # sysupgrade.
Reply With Quote
  #5   (View Single Post)  
Old 9th January 2023
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

jggimi - I did as you suggested. Now when I run sysupgrade I get:

#sysupgrade
Fetching from https://cdn.openbsd.org/pub/OpenBSD/snapshots/amd64/
su: Approval failure

I guess I will have to restore from backup unless you have another suggestion.
Thanks you for your help.
Reply With Quote
  #6   (View Single Post)  
Old 9th January 2023
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Unfortunately, I don't have any other suggestions -- your system will not boot multi-user and you cannot correct the error through re-running sysupgrade in single-user mode.

I've just run sysugrade and had no errors. This snapshot's amd64 kernel was built on January 8 at 23:26 MST.
Code:
kern.version=OpenBSD 7.2-current (GENERIC.MP) #927: Sun Jan  8 23:26:27 MST 2023
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
Reply With Quote
  #7   (View Single Post)  
Old 9th January 2023
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

I believe I am completely screwed and I'd like to know why.

I have a flash drive with 7.1 on it. I installed 7.1, ran syspatch, upgraded to 7.2 and ran syspatch again all with no problem.

I then ran syspatch -s and again an endless stream of:

init: single user shell terminated, restarting.

I'm just curious if you or anyone has any idea what could have happened.

Thanks
Reply With Quote
  #8   (View Single Post)  
Old 9th January 2023
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bitchy Nerd Elitist
 
Join Date: Dec 2015
Location: London
Posts: 461
Default

Quote:
Originally Posted by stanl View Post
any idea what could have happened
Perhaps the disk drive is dying.

I've used the latest snapshot of bsd.rd to recover a broken -current system in the past. That was before sysupgrade was available and it worked well. Is that an option for you?

I did find a reference to that error message on the mailing lists:

https://marc.info/?l=openbsd-misc&m=126915189823995&w=2

But unfortunately it has no replies.

These are the risks of running a development branch though. Next time stick to -release & -stable if you want a consistently reliable system.

Last edited by Head_on_a_Stick; 9th January 2023 at 05:04 PM. Reason: changed syspatch to sysupgrade; thanks jggimi!
Reply With Quote
  #9   (View Single Post)  
Old 9th January 2023
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Don't confuse sysupgrade with syspatch. Only sysupgrade has the -s option.

I don't see anything in the Following -current FAQ that would account for this. https://www.openbsd.org/faq/current.html

Since you started with a working 7.1, you might just use it to download a snapshot.
Reply With Quote
Old 9th January 2023
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

The syspatch -s in my earlier post was a typo. Should be sysupgrade -s. I tried the bsd.rd suggestion and got the same stream of error messages. I removed the hd and replaced it with an old one from an old laptop which has 7.2 install on it. After installing and trying sysupgrade -s got the same stream of errors.
So it isn’t the hd and must be the laptop itself (; cpu?).
I guess I can either stick with what I have and give up on -current or buy a new laptop.

Thanks to Head_on_a_Stick and to jggimi for their assistance.
Reply With Quote
Old 9th January 2023
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Have you ever attempted to install a snapshot? That is, not starting with a prior release? If so, did you get the same failure?
Reply With Quote
Old 9th January 2023
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

I've been running -currrent for a while now and doing sysupgrade -s maybe evry 2 weeks with no problem.

I do recall several days ago power went out in the neighborhood for about a minute. My laptop was powered on but i wasn't using it at the time. Do you think the power outage could have messed something up internally?
Reply With Quote
Old 10th January 2023
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

If the laptop had a battery installed, it would have continued running after a power failure. But, a brownout or a surge could have caused damage.

Until you test a directly installed snapshot, you won't know if its something you did to cause the breakage, some sort of rare problem in the sysupgrade process, or some sort of hardware problem.

A failed direct install would seem to indicate a hardware problem. A working install would inform you that the problem *isn't* hardware.

Last edited by jggimi; 10th January 2023 at 12:19 AM. Reason: clarity
Reply With Quote
Old 10th January 2023
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

jggimi - It took me a while to understand what I "think" you're trying to tell me: Go to one of the mirror sites, download a snapshot directly and try to install it.
When I did I got the same stream of errors:
init: single user shell terminated, restarting.
I guess this means a hardware problem and it is time for a new laptop. Any suggestions?
And, as always, thank you for your help.
Stan
Reply With Quote
Old 10th January 2023
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I think it is a hardware issue...but more likely to be a bug in the latest snapshots rather than bad hardware.

If this was happening in one of my systems, I would be bisecting kernel builds to find the commit which introduced the problem, so that I could report it to the openbsd project.
Reply With Quote
Old 10th January 2023
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 304
Default

When you sysupgrade -s does it complete the install then when rebooting, spit out the errors or does booting into the installer cause them?

During install, /bin/sh is running from the ramdisk, not what's been previously installed.
Reply With Quote
Old 10th January 2023
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

jggimi - If it was a bug in the latest snapshot wouldn't it affect everyone, not just me? As for bisecting kernel builds that is way out my abilities. Do you think I should wait a week or so and try another snapshot?

TronDD - sysupgrade -s downloads the files with no problem. Laptop reboots, bsd.upgrade detected,runs thru about a screenful of details and then goes into an endless stream of:
init: single user shell terminated, restarting.

I had no problem upgrading from 7.1 to 7.2. I just can't upgrade to a snapshot.

My thanks to both of you.

Stan
Reply With Quote
Old 10th January 2023
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 304
Default

So sounds like it's after the upgrade runs and it tries to reboot back into the installed system?

WHen it's broken, at the boot> prompt can you 'boot bsd.rd' and get to a prompt? Or 'boot bsd.sp'? Try the different kernels.

If you can get to a ramdisk, you can mount and chroot into your installed system and see what might be going on.
Reply With Quote
Old 11th January 2023
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

My working assumption is that you have something unique about your hardware platform, and therefore you are one of only a few people suffering from the problem.

You certainly could run 7.2 for now, and wait and try what will become 7.3 another day. I recommend careful backup before your next test.
Reply With Quote
Old 12th January 2023
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by stanl View Post
As for bisecting kernel builds that is way out my abilities.
  • By itself, kernel building is easy. You "cd" into the appropriate directory and issue three short `make` commands. This results in a single "bsd" kernel file stored in a sub directory.
  • Testing that freshly built kernel is also easy. You copy the "bsd" into your system's root directory, giving it any sort of file name you wish, and then simply boot that kernel to test it, selecting it by name at the "boot>" prompt. If it works, great. If it fails, also great, because you haven't overlaid anything and can reboot with your default and known-to-be-good kernel.
  • Bisecting through the source code to find the commit where the problem begins? Mostly tedious. You start with two known states: a point-in-time where source code is known to be good, and a point-in-time where the source code is known to be bad. Then you revise the state of the source code's working directory tree back and forth until you find the failure point. Once you've narrowed down the failure to a single commit, you have determined the commit that introduced the problem.
OpenBSD's source code is maintained via CVS, and users can use the Project's AnonCVS servers with the cvs(1) utility to manage local working source trees. While it is possible to manually bisect by date/time, or even by individual commit, I find it cumbersome to do so. I prefer using the Project's GitHub Mirror to establish and maintain my source tree, as the devel/git package includes the git-bisect(1) tool which automates the hunt for the problem commit.

I can usually identify the commit with less than a dozen build/test cycles.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Login user without shell and run a script then logout SimpL OpenBSD Security 7 10th March 2021 11:34 AM
Single user modes appears to be a bit dangerous. amphibious OpenBSD General 11 31st May 2017 08:20 PM
Shell aliases for regular user dbach OpenBSD General 5 30th December 2011 11:41 PM
Running a command as a different user w/o starting the login shell Carpetsmoker General software and network 4 1st July 2011 10:33 PM
Single and Multi User Mode Logging chicago OpenBSD General 2 13th May 2011 06:51 PM


All times are GMT. The time now is 02:03 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick