/etc/profile doesn't get sourced at start of session

Hello to everyone :D. I've been using Windows my entire life until January when someone recommended me Ubuntu. I tried (and loved it) for some months but got sick of the lack of control, the pre-installed packages and the incorporation of Unity in 11.04, so went all out for Arch.
It took me 2-whole-days to install everything correctly (because of issues related with the PC rather than Arch itself) and I've been configuring it bit by bit in the last two weeks (wasted my whole winter vacations on it, but it was worth it :P), ran through a lot of trouble which I've been (somehow) able to overcome almost completely by just using the Wikia (and Googling through old forum posts). I also learned a whole lot about Linux in that time and I'm very happy with my new system :D. So a thanks a lot to all the community for the great documentation you've developed, it really made a complete Linux-newbie (with a whole lot of patience :P) get a working system all by himself which is saying a lot.
------------------------------------------------------------------START READING HERE TO SKIP PERSONAL INTRO :P ---------------------------------------------------------------------
However right now I'm having a couple of minor issues which don't prevent me from enjoying the system but I would rather fix in order to have a clean system (and avoid further trouble in the future). I have LXDE installed with Slim as a login manager which I start through inittab in run level 5 to start X (relevant files attached at the end of the post). The system was working perfectly but I noticed that my session wasn't being registered by ConsoleKit (it didn't appear in the "who" command which was a problem for some scripts I was building) so I read the wikia and added the following lines at "slim.conf":
sessionstart_cmd    /usr/bin/sessreg -a -l $DISPLAY %user
sessionstop_cmd     /usr/bin/sessreg -d -l $DISPLAY %user
Which happily made the session appear at the "who" command as I needed. However some days after that, for no apparent reason (actually me touching config files probably), my PATH environment variable was wrong after booting (just had the /bin and /usr/bin on it, not /sbin or /usr/sbin). This just happens when I boot directly to X, when booting from a terminal the variable value was correct.
After some research (and adding debugging commands in the initialization scripts) I concluded that my "/etc/profile" script wasn't getting ran when I boot directly to X. In order to bypass this problem temporally I made a (absolutely horrible and temporal) patch by adding the line "source /etc/profile" at ".xinitrc" which sourced the file and gave me the right value for the PATH variable. However by doing it seems I ruined the former problem and my session doesn't appear at the "who" command again :S (by removing it again, the session appears again but the PATH variable is wrong). So I've been searching exactly when /etc/profile is sourced and, apparently, it's when the "login" command is executed (which I guess is done by either the LXDE session or Slim itself).
Since none of these packages got updates when the problem appeared I'm pretty sure it must have been one of my editions of the config files. So I leave the ones I think are relevant to the issue (and the ones that I tinkered it with the most).
If anyone has the time to point me in the right direction I would greatly appreciate it:
/etc/rc.conf: http://pastebin.com/qd5xYYsT
/etc/inittab: http://pastebin.com/M1h60Hym
/etc/slim.conf: http://pastebin.com/iaRqya07
/etc/profile: http://pastebin.com/JLtNCMtn
~/.xinitrc: http://pastebin.com/XGrNuhpv
My rc.local file is completely blank and rc.sysinit and rc.multi haven't been modified from their default values. If you need any more files, logs or any kind of experiment to gather more info just let me know and I'll post it as soon as I read it.
Thanks a lot in advance :-).
Last edited by facucosta (2011-07-27 08:29:50)

There is quite some confusion about the different startup files For real terminal work you can check the bash manual. Graphical login managers however do not always follow these rules even though Slim should read /etc/profile as /etc/slim.conf seems to invoke bash with --login... You could try to put the settings in /etc/environment (see the arch wiki). There might also be a slim specific bug
--edit--
On second look line 35 seems odd in your slim.conf. You could try to change it to:
login_cmd           exec /bin/sh --login ~/.xinitrc %session
Last edited by FarmerF (2011-07-27 11:10:15)

Similar Messages

  • When I turn on my MacBook on, it doesn't get past the start up screen up screen

    When I turn on my macbook, it turns white and then the apple comes up. Then the pinwheel appears. After that, it just keeps spinning and nothing happens. What is the problem???

    Take each of these steps that you haven't already tried. Stop when the problem is resolved.
    Step 1
    The first step in dealing with a boot failure is to secure your data. If you want to preserve the contents of the startup drive, and you don't already have at least one current backup, you must try to back up now, before you do anything else. It may or may not be possible. If you don't care about the data that has changed since your last backup, you can skip this step.   
    There are several ways to back up a Mac that is unable to boot. You need an external hard drive to hold the backup data.
         a. Boot into the Recovery partition, or from a local Time Machine backup volume (option key at startup.) When the OS X Utilities screen appears, launch Disk Utility and follow the instructions in this support article, under “Instructions for backing up to an external hard disk via Disk Utility.”
    b. If you have access to a working Mac, and both it and the non-working Mac have FireWire or Thunderbolt ports, boot the non-working Mac in target disk mode. Use the working Mac to copy the data to another drive. This technique won't work with USB, Ethernet, Wi-Fi, or Bluetooth.
    c. If the internal drive of the non-working Mac is user-replaceable, remove it and mount it in an external enclosure or drive dock. Use another Mac to copy the data.
    Step 2
    Press and hold the power button until the power shuts off. Disconnect all wired peripherals except those needed to boot, and remove all aftermarket expansion cards. Use a different keyboard and/or mouse, if those devices are wired. If you can boot now, one of the devices you disconnected, or a combination of them, is causing the problem. Finding out which one is a process of elimination.
    If you've booted from an external storage device, make sure that your internal boot volume is selected in the Startup Disk pane of System Preferences.
    Step 3
    Boot in safe mode. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Post for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    When you boot in safe mode, it's normal to see a dark gray progress bar on a light gray background. If the progress bar gets stuck for more than a few minutes, or if the system shuts down automatically while the progress bar is displayed, your boot volume is damaged and the drive is probably malfunctioning. In that case, go to step 5.
    If you can boot and log in now, empty the Trash, and then open the Finder Info window on your boot volume ("Macintosh HD," unless you gave it a different name.) Check that you have at least 9 GB of available space, as shown in the window. If you don't, copy as many files as necessary to another volume (not another folder on the same volume) and delete the originals. Deletion isn't complete until you empty the Trash again. Do this until the available space is more than 9 GB. Then reboot as usual (i.e., not in safe mode.)
    If the boot process hangs again, the problem is likely caused by a third-party system modification that you installed. Post for further instructions.
    Step 4
    Sometimes a boot failure can be resolved by resetting the NVRAM.
    Step 5
    Launch Disk Utility in Recovery mode (see Step 1.) Select your startup volume, then run Repair Disk. If any problems are found, repeat until clear. If Disk Utility reports that the volume can't be repaired, the drive has malfunctioned and should be replaced. You might choose to tolerate one such malfunction in the life of the drive. In that case, erase the volume and restore from a backup. If the same thing ever happens again, replace the drive immediately.
    This is one of the rare situations in which you should also run Repair Permissions, ignoring the false warnings it may produce. Look for the line "Permissions repair complete" at the end of the output. Then reboot as usual.
    Step 6
    Reinstall the OS. If your Mac was upgraded from an older version of OS X, you’ll need the Apple ID and password you used to upgrade.
    Step 7
    Repeat step 6, but this time erase the boot volume in Disk Utility before installing. The system should automatically reboot into the Setup Assistant. Follow the prompts to transfer your data from a Time Machine or other backup.
    Step 8
    This step applies only to a Mac Pro tower, not to any other model. A dead logic-board battery can cause a gray screen at boot. Typically the boot failure will be preceded by loss of the startup disk and system clock settings. See the user manual for replacement instructions.
    Step 9
    If you get this far, you're probably dealing with a hardware fault. Make a "Genius" appointment at an Apple Store to have the machine tested.

  • Cannot source /etc/profile from within the PKGBUILD anymore

    Hi,
    Short story: the command
    source /etc/profile
    within the build() section of my PKGBUILD now returns a build() error. It used to work before, is there a reason for this? Should it be executed in another section than build()? (Note source /etc/profile works properly in console, within the build directory)
    Long story:
    I need to use $JAVA_HOME in my PKGBUILD (to patch a lua source file with the current JDK path, which can be detected with $JAVA_HOME. Patching is done with a sed command). However, if java-environment is installed for the first time (as a makedepends) along with my package, then I need to source /etc/profile first to set the $JAVA_HOME environment variable, before being able to use it within my build() section. Otherwise it is not set yet and building fails.
    Many thanks for your help.
    Last edited by zebulon (2012-12-28 14:57:23)

    Hi,
    Many thanks for the advice. I was unclear though: I maintain the aacskeys package in AUR, not the lua package. However, the file I am patching in aacskeys is named premake.lua, used for the project file generator premake.sourceforge.net.
    I'll try your first suggestion, since this is the only one which may work without touching the system. Another alternative would be to directly source the /etc/profile.d/jdk.sh file. EDIT: nope, because there could be openjdk6.sh instead. I really need to be able to source the correct file. The maintainer of opencascade uses:
    if [ -z $JAVA_HOME ]; then
    [ -e /etc/profile.d/openjdk6.sh ] && source /etc/profile.d/openjdk6.sh
    [ -e /etc/profile.d/jdk.sh ] && source /etc/profile.d/jdk.sh
    fi
    which is efficacious but less generic.
    Besides, is it normal that we get this error code, since the Arch documentation only recommends to set LANG in /etc/locale.conf? SHould I report it as a bug or request a design change for /etc/profile.d/locale.sh there (as suggested in your (b) entry)? I am asking this because my PKGBUILD is not the only one to use this trick, and this problem breaks them all.
    Thanks.
    Last edited by zebulon (2012-12-30 06:14:58)

  • .bashrc not getting sourced at login [SOLVED]

    Setup Arch on a laptop and added some custom stuff to ~/.bashrc but it doesn't get sourced when I ssh into the box or when I open a shell.  What am I missing?
    EDIT:  the ~/.bash_profile was empty!
    Now it contains:
    . $HOME/.bashrc
    <<headsmack>>
    Last edited by graysky (2010-07-19 01:10:00)

    This may sound like a stupid question, but in your .bashrc script, your checking for an interactive shell,  Doesn't it need to start with an if? and end with an end?
    I am asking because, just suppose that the .bashrc file is being sourced like it should be, only, it is encountering that statement and quietly dieing at that point.
    So, what happens if that -z line were commented out?

  • Aterm now opens with source /etc/profile

    I was in aterm when I did source /etc/profile, but now whenever I open aterm I get the results of source /etc/profile. Xterm doesn't do this, only aterm. Why is it doing this and how can I fix it?

    just add "source /etc/profile" (without the quotes) to .bashrc (thats located in ur home directory)

  • /etc/profile isn't sourced on startx

    the command
    source /etc/profile
    isn't used on startx
    and now all paths and locales aren't set, has anyone an idea whats wrong here?
    if i login on console it behaves normal. But if i login on X with qingy or slim it doesn't work.
    It also doesn't work if i startx on a console with /etc/profile sourced.
    i hope someone can help me.
    so long
    ukognos

    but if i run X, there's no locale set, or environment variable, so how can i set that at startup of X?

  • I am downloading the Creative Cloud desktop app on my Mac, and it starts to download but just stalls in the process and doesn't get any closer to finishing. Anyone have any suggestions. I've restarted my computer multiple times and restarted the download,

    I am downloading the Creative Cloud desktop app on my Mac, and it starts to download but just stalls in the process and doesn't get any closer to finishing. Anyone have any suggestions. I've restarted my computer multiple times and restarted the download, but to no avail.

    uninstall anything cc that's already installed, clean (Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6) and the reinstall, Adobe: Creative, marketing, and document management solutions

  • Jdev CPU profiler doesn't show inherint method timing - Any way to get it

    Hi,
    CPU profiler both in HOTSPOT and Callstack doesn't give method's inherint timings . it only shows parent + descendant timing (inclusive timing) . This doesn't help me to quickly find which method inherintly is expensive (ie timing withouts its child included ) .Is there a way to get the timing of a method without including its child method timing ..
    Regards,
    Indraneel

    Depending on what version of JDeveloper 11 you are running, exclusive time in a method is called "CPU Exclusive" or "CPU Shallow" in the CPU profiler column headings. The column is there; there is data in the column for some methods (Click on the 'CPU Exclusive/Shallow' column to sort by those values). So it's hard to understand how the profiler does not report it.
    Perhaps your issue is that the profiler doesn't report it accurately?

  • I can't get Firefox to start. It says that Firefox is already running after re-install and re-start it again. I have deleted all profiles, but no luck. HELP!

    I can't get Firefox to start. It says that Firefox is already running after re-install and re-start it again. I have deleted all profiles, but no luck. HELP! edit

    -> [[Firefox is already running but is not responding]]
    -> Profile in use
    * http://kb.mozillazine.org/Profile_in_use
    Check and tell if its working.

  • My iPhone shut down and factory reset itself for no reason, and now when I plug it into my computer or any power source, the apple shines but it doesn't get any further than that. How can I fix it?

    My iPhone shut down and factory reset itself for no reason, and now when I plug it into my computer or any power source, the apple shines but it doesn't get any further than that. How can I fix it?

    Try Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...
    Be sure to Follow ALL the Steps...
    But... if the Device has been Modified... this will Not necessarily work.

  • Flash Builder 4.0.1 profiler doesn't always start correctly

    Hi,
    I'm using Flash Builder 4.0.1 Premium to profile my application but the profiler doesn't always start (hook) correctly. Sometimes it works at first try, sometimes I have to restart the profiler up to 10 times before it finally hooks.
    It's very annoying and waste of time. Do you have any solution for this?
    Thanks!
    Matetnic

    Everything is set up correctly with the path folder - as this error occurs with an empty, blank, default AIR app built via "new".
    I believe this is an error with 4.0.1 - as when I installed 4.5 demo (on OS X); this problem doesn't exist and I had no problems building an AIR app.
    So either there's a problem with my version/copy/install of Flash Builder or it has something to do with the AIR/FB/and VMWare/Win7.
    -Will

  • What hardware, software, etc. is required to get started developing with iOS?

    What hardware, software, etc. is required to get started developing with iOS? Looking to get started...
    Thanks!

    You need an Intel Mac, at least OS X 10.6.8 (Lion if you intend full capability) and Xcode.
    See http://developer.apple.com/

  • Startup scripts in rc3.d not sourcing /etc/profile

    I'm trying to set some global parameters for the entire system e.g. JAVA_HOME
    I have placed these in /etc/profile
    If I login in as whoever /etc/profile is sourced.
    However when the system boots up /etc/profile is not sourced before a startup script e.g. /etc/rc3.d/S99xxxx is called
    Why is this and where can I set global parameters so that they are visible in the startup scripts and for anyone logging in etc.?

    /etc/profile (and $HOME/.profile) are not normally sourced by non-interactive shell invocations.
    Modify the script to source it explicitly if that's what you want.
    Darren

  • I have an iPad that is now over twelve months old, it doesn't get over used, however in the last few days, it has started to get very hot after only a few minutes use, is this a fixable issue

    I have an iPad that is now over twelve months old, it doesn't get over used, however in the last few days, it has started to get very hot after only a few minutes use, is this a fixable issue

    Is it getting hot only when charging?
    Not normal. Take it to an Apple Store for evaluation.
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/
     Cheers, Tom

  • What can I do when I try to access a URL and get the message "MAC OSX doesn't recognize internet addresses starting with "c:"?

    I recently tried to download a pdf file from a website in the UK.  Up popped a message saying the website could not be accessed, followed by this message: "MAC OSX doesn't recognize internet addresses starting with "c:".  I was able to access the website easily (its domain was "www") and the page listing the pdfs, but could not download a pdf.  Of course," c:" appears not to be a valid domain name, but why would anyone use "c:" in place of a domain name in their URL?  And what can I do about the problem?  I'm using Snow Leopard 10.6.8 and Safari 5.1.10, but also have Firefox and Chrome loaded.  Thanks.

    An address starting with c: wouldn't be any kind of domain name. C: is the drive lettering system DOS and and later uses. By default, A: and B: are reserved for your first and second floppy disk drive. All hard drives are then named C: through Z:, if you have that many. C: is normally your startup disk.
    Anyway, their PDF file is incorrectly linked to a file directly on the C: drive of someone's computer. It's not going to work no matter what you do.

Maybe you are looking for

  • Installer says it is corrupt.

    First a little backgorund. My macbook is currently running 10.7.3. I have had numerous failed attempts to update to 10.7.4. Everytime I try and run the updater or installer it says the download is corrupt and to try downloading it again. I've tried u

  • Hard Drive Format Fails under Lion 10.7.4

    Long-time Mac user, first time I've ever seen this problem. OS X 10.7.4, Mac Pro. I am attempting to format a RAID JBOD disk through Disk Utility 12.1.1 (Lion version) and it fails consistently with this error: "Partition Failed with the error: Wipin

  • My Applet loads only if java sdk is installed...

    I have developed an Applet which reads an image from the server (its serving host) , edits it and then writes a stream back to server, which is captured by servlet that writes the stream to a file. I have deployed this in a web application (in Tomcat

  • Safari 4.0.3 and Google

    I just updated to 10.5.8 and Safari 4.0.3 (or whatever it is, the latest one). Every time I try to access Google with Safari, Safari crashes. I tested with another browser (Camino) and it's working fine. So, in some way it does have to do with Safari

  • ADF Tree Table

    I am using JDev 11g. I created tree table and warped around with toolbar with commandToolbarButton in it. How can I delete leaves or root node? Thanks.