V
5  
Tags
There are no tags for this page.
Attachments
Dobrica Pavlinušić's random unstructured stuff
systemd

running old distributions under systemd-nspawn



install on host

apt install systemd-container

setup old distribution

os-release

root@saturn4:~# cat /saturn/etc/os-release
PRETTY_NAME="Debian GNU/Linux 4 (etch)"
NAME="Debian GNU/Linux"
VERSION_ID="4"
VERSION="4 (etch)"
VERSION_CODENAME=etch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

console

root@saturn4:/saturn/etc# machinectl shell saturn /usr/bin/uptime
Failed to get shell PTY: Protocol error

fix it by adding console to inittab

dpavlin@saturn:~$ grep console /etc/inittab
0:2345:respawn:/sbin/getty 38400 console

network config

full access to host network, services are configured to listen to localhost

root@saturn4:/etc/systemd# mkdir nspawn

root@saturn4:/etc/systemd# cat > nspawn/saturn.nspawn
[Network]
VirtualEthernet=no

start it

root@saturn4:~# mv /saturn/ /var/lib/machines/
root@saturn4:~# machinectl enable saturn
Created symlink /etc/systemd/system/machines.target.wants/systemd-nspawn@saturn.service �/lib/systemd/system/systemd-nspawn@.service.
root@saturn4:~# machinectl start saturn

alternative

it seems that I'm unable to get console to work with systemd-nspawn and Debian etch. So alternative approach is just to run services from systemd service file using chroot

root@saturn4:/etc/systemd/system# cat saturn\@.service
[Unit]
Description=SocialText saturn services

[Service]
User=root
Type=forking
ExecStart=/etc/systemd/system/saturn.sh /etc/init.d/%i start
ExecStop=/etc/systemd/system/saturn.sh /etc/init.d/%i stop
Restart=on-failure

[Install]
WantedBy=multi-user.target

root@saturn4:/etc/systemd/system# systemctl start saturn@postgresql-8.1
root@saturn4:/etc/systemd/system# systemctl start saturn@ceqlotron
root@saturn4:/etc/systemd/system# systemctl start saturn@st-apache
root@saturn4:/etc/systemd/system# systemctl start saturn@apache2



 

Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

 
 
 
File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

 
 
 
Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.

Tag: 

Suggestions: