Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Log out and log in again is enough to execute script mentioned in Start up Applications but it needs complete restart to execute script mentioned in rc.local file.
why?
Because the rc.local script is called by the init system at boot time, while the Start up Applications system is managed by your desktop environment. Both serve different purposes, rc.local is the place for things you want run only once at boot systemwide, while the Start up Applications system is for things that have to be started on a per user basis (different users can have different applications there).
Thanks for the accurate answer.
one more thing,
Start up applications are stored in ~/.config/autostart as .desktop files.
If a Linux system has no desktop environment (only command line), the black screen with prompt appears when system boots successfully, in this case, the .desktop file can not be generated, correct? or still generated and used?
Can each user define start up task for his account using .desktop file but when there is no desktop environment then can he update rc.local for his account to run a script ?
Files in ~/.config/autostart are only used for starting applications if the desktop environment supports that. If you don't start a desktop environment those files will not be used.
For per user application starting without a desktop environment usually the configuration file of the user's shell is used, in most cases ~/.bashrc.
rc.local can not be used for user specific settings or application starts, it is executed before the login prompt even appears and can not know which user will log in.
Login will execute /sbin/bash --login
This will execute /etc/profile, which is where your prompt style is set, the PATH is set
and other things.
The user may have a ~/.profile which will be executed next.
Each user can put any bash script in their own profile. Including modified lines from /etc/profile is the usual use, or making a simple prompt style (maybe because including directory name in the prompt string has become a problem).
This applies to any login.
If you open a Konsole and do not see the colors when you "ls" (like you do when you use a real console), then fix that as follows:
Start Konsole, select profile settings from the menu, edit the profile you are using (usually shell), and change the line "/sbin/bash" to "/sbin/bash --login".
This will then also run the profile scripts when using Konsole.
I run Slackware. If you do not find profile, then it may be bashrc or some other file name on your distribution.
Last edited by selfprogrammed; 06-24-2014 at 09:37 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.