I am in the process of setting up a Raspberry Pi with the Pi Desktop from element14. I try to build it so, that the home directory of pi is always fresh as I prepared it. The reason is that I plan to use it in my classroom and don't want to ever clean up behind my students. Of course I took the sudo privileges fro the pi.
So I copied the finished home of the pi into the new home of the new user "default"
like
Code: Select all
cp -a /home/pi* /home/default
Than I added some code in the /etc/rc.local:
Code: Select all
/bin/rm -rf /home/pi/
/bin/cp -a /home/default/pi /home/
/bin/chown pi:pi -R /home/pi
The first problem with this is, that I do not end up in the Desktop but at the login screen.
Next - and I guess it is the same problem - I can't login. I have to wait some 10 seconds before I log in. If I try it earlier, the login screen disappears, the screen gets black and after a few seconds I am back at the login screen. If I wait long enough I can login with no problems.
I am kind of unexperienced if it comes to Linux but something tells me that there is a problem with the copy-process or something about rights.
I tried to add the following line to the rc.local but without effect:
Code: Select all
sleep 60
I found another solution but I am not sure how to manage it:
Code: Select all
usermod --login new_user --home /home/new_user --move-home pi
am I deleting or renaming the User "new_user" or am I simply copying the directory?
Advice would be very much appreciated!