You are not logged in.

#1 2017-10-13 10:36:40

reup
Member
Registered: 2017-02-09
Posts: 6

systemd in chroot

some interesting issue I had yesterday

I have a virtual server with OVH.
yesterday I was connected to my box with ssh, managing my website
after an upgrade, ssh failed because of some new option that was added at the bottom of the sshd_config

I got kicked out of the server and when I try to reconnect I had connection refused by the server
so I reboot in rescue mode and connect by ssh to the rescue mode, then mount the root partition to /mnt and chroot to it
however, any of the following failed because I was on chroot : systemctl {start|stop|status}

I fixed my issue after few hours but still would like to know if there is a way to chroot to a system with systemd and still be able to start services, at least to see why those services fails

reup

Offline

#2 2017-10-13 11:21:15

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: systemd in chroot

I don't think it's possible with a standard chroot. If your rescue environment uses systemd then you could use systemd-nspawn as an alternative.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-10-13 11:55:48

reup
Member
Registered: 2017-02-09
Posts: 6

Re: systemd in chroot

Slithery

I did try systemd-spawn
log as root to the ssh rescue system, mount sda2 (root fs) to /mnt
systemd-spawn -b -D /mnt
I got dbus errors, "Failed to open system d-bus, no such file or directory"
the system did not start
I unfortunately cannot try it now, it would mean taking my system down again but maybe my mistake was the -b ? this means boot if I understand well. maybe I was not supposed to boot it but just connect to it ?

Offline

Board footer

Powered by FluxBB