I have one script that will run when a specific user logs in. Where should this script and its assets be placed? I was planning to put it in /usr or /bin or /var, but I was wondering if there's a standard for this sort of thing, and where they should be placed to be out of the way but accessible.
Startup scripts and assets are usually put in the user's home directory.
(The home directory can either be found by
getent passwd username or by logging in as the user and inspecting the value of $HOME.)
As this is a executable script, it is good to place it at
- avoid typing full path of the script like
- ever you want to test it from terminal , just type my_script
I think there is no standard of doing this, place it anywhere (obviously not at
/var/www, etc.) you like, finally it depends on your choice.