LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Graphical Login issue after changing /etc/profile.d (https://www.linuxquestions.org/questions/linux-newbie-8/graphical-login-issue-after-changing-etc-profile-d-913607/)

Pir Ovais 11-15-2011 02:56 AM

Graphical Login issue after changing /etc/profile.d
 
Hi all,

I need help.
I am storing a shell script in /etc/profile.d , so that to make it run at startup.
it works fine in suse but in rhel same script halts my graphic login.
when i delete this script from shell, only then i see graphical mode on system.
Waiting for comments..

Thanks...

jschiwal 11-15-2011 03:08 AM

Without seeing the script, there is little we can comment on. You didn't even mention which shell the script uses. It is supported by RHEL?

Scripts in /etc/profile.d/ are meant to be configuration scripts, that are sourced when you boot; setting environmental variables and aliases. This isn't a place to start a service. If that is all your script does, perhaps a value based on your SuSE script, has side effects in RHEL. For example, setting the WINDOWMANAGER variable to a value not installed on RHEL could cause booting into X to fail, if RHEL doesn't have a fallback value.

Pir Ovais 11-15-2011 03:59 AM

i solved the issue..:))

Pir Ovais 11-15-2011 04:13 AM

i solved this issue.
can you please tell me where should i place my shell script in RHEL, so that it will start at system startup.

chrism01 11-15-2011 06:50 PM

If you want to control it as a service, then /etc/init.d and add symlinks from the relevant rcX.d dirs (where X = 0-6) under /etc/rc.d.
Best approach is to copy an extant script there and amend as reqd.

A very basic approach, assuming you don't need to worry about a clean shutdown is to just call it directly from the /etc/rc.d/rc.local file.

Pir Ovais 11-15-2011 11:14 PM

Thanks for the reply CHris..
I want that for every user this script should run at startup.

Thanks

chrism01 11-15-2011 11:47 PM

You seem to be confusing 'system startup' with user logins...
Do you want it to start once at system startup ie boot time, or once for each user when they login?
My answer is for system startup; for user logins /etc/profile.d is the place.

Pir Ovais 11-15-2011 11:59 PM

Thanks for reply CHris.
I want it for every user and i placed it profile.d anf it worked fine for suse flavor but in RHEL it caused login issues :(
See now i am placing my script in /etc and adding a link to it in rc.local.
It seems to be working, but not for all users.

any comments..

chrism01 11-16-2011 06:15 PM

You need to show us the script I think (x out any pvt info). rc.local is for system startup as I said..


All times are GMT -5. The time now is 03:46 PM.