1

I try to write a network/environment configurator for a distributed OVA appliance, similar to what Github Enterprise does, see https://github-images.s3.amazonaws.com/enterprise/Enterprise-QS-Virtualbox-Console.png. I use CoreOS and Systemd as init system. autologin is deactivated and my current approach is to write a .service unit that will setup up the network and then restart with these configurations. The reason for doing so that during systemd startup I have sufficient permissions to change network and don't have to allow the user to login. The downside is that this process basically hangs/stalls systemd startup.

My question is how to configure Systemd (in CoreOS) so that, after boot up, a user is presented with an interactive program/script and the user can't "escape" that program/script?

1

If you want to do the network config is one fell swoop you can check out Ignition. It runs before systemd is initialized, meaning you can write out your network units on the first boot.

As for dropping an SSH user into a installer/configurator, you could use ForceCommand that runs a container with your installer in it. Best practice would be to lock that down to a specific user. More info: https://stackoverflow.com/questions/33713680/ssh-force-command-execution-on-login-even-without-shell

Let me know how that works out!

  • Thanks for the tip to Ignition. Instead of before systemd, I try to let the user do the network configuration as it's an On-Premises appliance that the customer needs to adjust to their needs but can only do so after boot up from an VM console (see screenshot in original post). So SSH's ForceCommand is also not desired as at that state the user already knows (and likely has configured) the network. – Kreisquadratur May 17 '16 at 4:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.