how to make a symbolic link to a folder at first logon
I have an Ubuntu 18.04.3 installation with 20 users (no superusers) and I just copied 2 pdf files in the /usr/share/coure_share/ folder where everybody has access to. I want to make a symbolic link on that folder to every user at first login. Now I've red on forums that to make a symbolic link one can put a script.sh file in the /etc/profile.d/ folder. This is what I did so I wrote this in a share.sh file which I put there:
ln -sfn /usr/share/course_share /home/userxx/Desktop/course_shareBut at first login of any user I get the message "/home/userxx/Desktop/course_share" "Faile to create symbolic link. No such file or directory". When I do it later (when I logged in and opened the shell) it works perfectly. I guess at first login the desktop folder is not created but I am not shure. Any help would be appreciated
1 Answer
I think that the scripts in /etc/profile.d are executed before xdg-user-dirs-update creates the folders for the new user. One possible solution would be to create the Desktop folder in /etc/skel. Your script should now work for newly created users.
Also, is chmod -R a+rwx /home/userxx/Desktopreally necessary in your case?
More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"