Description of problem: Some rpm packages require a user to be added to run as. rpm-ostree will create the user fine, except that it won't create the home directory correctly. When you reboot into the new tree, the home directory is missing. Version-Release number of selected component (if applicable): rpm-ostree-2019.3-1.fc29.x86_64 rpm-ostree-2019.3-1.fc30.x86_64 How reproducible: 100% Steps to Reproduce: 1. rpm-ostree install mozilla-iot-gateway 2. systemctl reboot 3. ls /home Actual results: <nornal user directory> Expected results: <nornal user directory> moz-iot-gateway Additional info: Using the exact same commands as root on the console, creates a user correctly. It's only when the user is created as a script during an rpm install.
Howdy Troy! :) So the background info on this is https://bugzilla.redhat.com/show_bug.cgi?id=1352154. I.e. rpm-ostree doesn't want `/var` to be modified during package scriptlets for correct offline upgrades. For example, rpm-ostree synthesizes tmpfiles.d entries from directories created in /var in scriptlets. IOW, instead of scriptlets modifying /var at install time, /var should instead be modified at runtime. This also benefits image creation tools other than rpm-ostree. Specifically for this case, looking at the spec file... why is moz-iot-gateway doing `useradd -r -m`? Does a system account really need a $HOME? Why not keep its data in /var/lib/ somewhere?
At least in mozilla-iot-gateway version 0.7, yes the configuration and data need to be in the users $HOME directory. That directory can be anywhere, but it must be the users $HOME area.
Basically what you are saying, is that this is a feature and not a bug. Can you give me an example of a package that does it right, so I can emulate it.
Hmm, so I think it should work to instead create a sysusers entry with: ``` u moz-iot-gateway - "Mozilla IoT Gateway User" /var/lib/moz-iot-gateway /sbin/nologin m moz-iot-gateway dialout ``` Then the user will be created on the next boot.
I have fixed my package by creating a sysusers entry, with the home area in /var/lib/moz-iot-gateway. I am closing this bug with NOT-A-BUG, since this is a feature. Thanks for the information.