RPi-Distro / pi-gen

Tool used to create the official Raspberry Pi OS images
BSD 3-Clause "New" or "Revised" License
2.58k stars 1.61k forks source link

How to install a systemd service for the first user? #660

Open jedahan opened 1 year ago

jedahan commented 1 year ago

Now that Raspberry Pi OS does not come with a default pi user, what is the correct way to add a user service to a pi-gen build? Is there any way to hook into the Raspberry Pi Imager first user?

Thanks

j123b567 commented 9 months ago

You can create a user service in /usr/lib/systemd/user/ or in /etc/systemd/user/ and later enable it for all users using systemctl --global enable, if you don't mind running it for all logged in users (you will probably have only one user on the target system anyway).