30

I added some scripts from root inside etc/profile.d to execute at startup time. But when will these scripts be executed if I login into system as a non root user? I want to start LDAP-server at start-up time, independently from which user has first logged in.

I use CentOS 6.3.

MyTitle
  • 611
  • 1
  • 10
  • 18

3 Answers3

37

Files in /etc/profile.d/ are run when a user logs in (unless you've modified /etc/profile to not do this) and are generally used to set environment variables.

iconoclast
  • 1,890
  • 2
  • 19
  • 30
0

In order to add a script to be started during system startup, you need to use chkconfig after putting the script in /etc/init.d folder.

This has nothing to do with user login.

Khaled
  • 37,789
0

If you want to run it at system startup you can add it to /etc/rc.d/rc.local.

Or make an init script with a suitable runlevel.