M BUZZ CRAZE NEWS
// general

how to make a symbolic link to a folder at first logon

By Jessica Wood

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_share

But 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?

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy