LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-15-2022, 07:11 PM   #1
shanebagel
Member
 
Registered: Apr 2022
Posts: 52

Rep: Reputation: 2
Question How do you reboot a server when Systemd is unavailable?


I'm in minimal mode trying to reset the root users password.
"System has not been booted with systemd as init system (PID 1). Can't operate"

I can't run any systemctl commands as the systemd daemon is unavailable. If you didn't have direct console access to this server - how would you reboot it? Other than just pulling the plug physically, and booting it back online?
 
Old 06-15-2022, 08:54 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
What init system is it using?

Anyway, regardless of the init system in use, most will have a halt and/or reboot command.

Evo2.

Last edited by evo2; 06-15-2022 at 08:56 PM.
 
Old 06-15-2022, 09:08 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Not necessarily, if the OP used init=/bin/bash then as a shell process there isn't any basic power management commands available.
In my ignorance I just stopped the process via the exit command and virtually pulled the plug (I was playing with a VM). Here is one way...

Quote:
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
https://www.linuxjournal.com/content...ting-magic-way

You should unmount any filesystem that you manually mounted as well as remount /(root) as read only.
 
2 members found this post helpful.
Old 06-15-2022, 09:15 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by michaelk View Post
Not necessarily, if the OP used init=/bin/bash then as a shell process there isn't any basic power management commands available.
Good catch. I missed the first line in OPs post :

Quote:
Originally Posted by shanebagel View Post
I'm in minimal mode trying to reset the root users password.
Cheers,

Evo2.
 
Old 06-16-2022, 11:46 AM   #5
shanebagel
Member
 
Registered: Apr 2022
Posts: 52

Original Poster
Rep: Reputation: 2
Thumbs up

I didn't realize you can just exit the shell lol.
Thanks all!
 
1 members found this post helpful.
Old 06-16-2022, 11:53 AM   #6
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,599

Rep: Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546Reputation: 2546

See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html and https://en.wikipedia.org/wiki/Magic_SysRq_key

Quote:
Originally Posted by https://en.wikipedia.org/wiki/Magic_SysRq_key
A common use of the magic SysRq key is to perform a safe reboot of a Linux computer which has otherwise locked up (abbr. REISUB). This can prevent a fsck being required on reboot and gives some programs a chance to save emergency backups of unsaved work. The QWERTY (or AZERTY) mnemonics: "Raising Elephants Is So Utterly Boring", "Reboot Even If System Utterly Broken" or simply the word "BUSIER" read backwards, are often used to remember the following SysRq-keys sequence:

unRaw (take control of keyboard back from X),
tErminate (send SIGTERM to all processes, allowing them to terminate gracefully),
kIll (send SIGKILL to all processes except init, forcing them to terminate immediately),
Sync (flush data to disk),
Unmount (remount all filesystems read-only),
reBoot.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unkown cause for systemd failure state - systemd-logind cannot start org.freedesktop.systemd1 after server reboot mario.p Linux - Server 5 07-30-2018 02:11 AM
LXer: The Story Behind ‘init’ and ‘systemd’: Why ‘init’ Needed to be Replaced with ‘systemd’ in Linu LXer Syndicated Linux News 1 04-07-2017 11:33 PM
LXer: Why pro-systemd and anti-systemd people will never get along LXer Syndicated Linux News 0 05-15-2015 11:44 PM
LXer: Is systemd as bad as boycott systemd is trying to make it? LXer Syndicated Linux News 0 09-03-2014 05:50 PM
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 09:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration