A few months ago, I blogged about getting a Raspberry Pi set up with a GitHub Runner to keep a website up-to-date. It's been working well--until today. I made some updates, pushed them to GitHub, then later checked the website--it had not updated.
Then it dawned on me: the power had gone out for a couple of hours last week and even though the computer was back on, I had not logged in and started the GitHub runner--and had forgotten to make that automatic.
Setting up Linux to login and auto-start a program isn't terribly difficult but the commands are a little different depending on which distribution and version of Linux you're running. I have Ubuntu Server 22.04 running and found what I needed on AskUbuntu.com to automatically login on a the terminal:
- Create a directory for the terminal you want to use if it doesn't already exist:
mkdir -p /firstname.lastname@example.org
- Create an autologin.conf file and specify the
--autologinparameter with the user desired:
ExecStart=-/sbin/agetty --noclear -n --autologin david %I $TERM
Once I rebooted the machine to make sure that worked, I needed to automatically start the GitHub runner. This was a simple add-on to the .profile file in my user's home directory:
This final piece of automation for my web-builder machine is now in place. :-)