/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?

Similar Messages

  • 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

  • /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)

  • 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)

  • 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)

  • /etc/profile.d scripts

    A while ago, I was helping a friend installing archlinux on his laptop.
    He wanted to use tcsh as his main shell, as he is used to this from FreeBSD.
    We then discovered that his path was never updated after installing new packages (for instance firefox) and then running source /etc/profile
    The reason, we later found out, was that most (if not all) of the scripts in /etc/profile.d does not have a valid shebang (usually the top row of a script, looking something like #!/bin/sh , telling the computer which shell to run the script in).
    This, in combination with tcsh (and probably csh as well, we never tested that though), results in our problem, since tcsh does not have the command export, which is built in in bash (and sh, zsh, and most of other shells out there).
    Tcsh uses the command set instead.
    My little question is this: Why doesn't those scripts have proper shebangs, so that it would be possible to use archlinux with tcsh?
    Does anybode have a good answer to that, and is this something that should be corrected in some way?

    As those files are getting sourced through /etc/profile they don't need a proper shebang.
    The only distro I know with support for csh is Slackware, don't expect it in Arch.

  • Build fails no /etc/profile.d/gnome.sh

    I am trying to build gnome-system-tools and I keep failing here:
    [root@localhost system-tools]# makepkg -i
    ==> Making package: system-tools-backends 1.2.0-1 (Fri Sep 21 12:26:10 EDT 2007)
    ==> Checking Runtime Dependencies...
    ==> Checking Buildtime Dependencies...
    ==> Retrieving Sources...
       -> Found system-tools-backends-1.2.0.tar.bz2 in build dir
       -> Found archsupport.patch in build dir
    ==> Validating source files with md5sums
        system-tools-backends-1.2.0.tar.bz2 ... Passed
        archsupport.patch ... Passed
    ==> Extracting Sources...
       -> tar -xf system-tools-backends-1.2.0.tar.bz2
    ==> Removing existing pkg/ directory...
    ==> Starting build()...
    PKGBUILD: line 20: /etc/profile.d/gnome.sh: No such file or directory
    What am I missing?  Why no /etc/profile.d/gnome.sh?
    I am running Gnome 2.18.3 and starting it with gdm.  Totally lost at this point.
    Thanks

    The output in your post says you're trying to build system-tools-backends, not gnome-system-tools. According to the relevant AUR page, that package was submitted over two years ago, and hasn't been updated since. The upstream release date for system-tools-backends 1.2.0 was 08 March 2005.
    Find a more recent release, and see if that builds correctly for you.

  • Not executing /etc/profile

    Hi,
    I installed 10.4.2 from the CD that came with my PowerBook. Later, realising that X11 was not installed automatically, I reinstalled the entire OS using the custom mode. The old OS was shifted to PreviousSystem, which I deleted subsequently.
    I notice that on booting, the command /etc/profile is not executed. As a result, the system wide PATH that should be available for all users does not get set up. Is there a bug or am I looking at the wrong profile file?
    For individual users, .bash_profile is not automatically executed. Every time I have to issue the command "source .bash_profile" to execute them. I have the same question as above: is there a bug, or am I looking at the wrong file?
    Thanks.
    Kannan

    /etc/profile is not supposed to be executed on booting. It and .bash_profile are only executed when a login bash shell is started. A new Terminal window starts a login shell; xterm does not. A non-login shell runs .bashrc. If you are using xterm, and want to run the profiles, you can source them in your .bashrc.

  • [SOLVED] printenv output differs from settings in /etc/profile

    Hi, I just noticed that
    printenv PATH
    gives me something else (just '/usr/bin') than is defined in /etc/profiles, which is
    PATH="/usr/local/sbin:/usr/local/bin:/usr/bin"
    export PATH
    I'm using fish but there is no entry about variables in ./config/fish/config.fish.
    Thanks for your help!
    Last edited by ysetdng (2014-09-16 23:05:56)

    Let /etc/login.defs be, it isn't supposed to have the full PATH.
    Read https://wiki.archlinux.org/index.php/Fi … leshooting
    Arch wiki wrote:
    If you decide to set fish as your default shell, you may find that you no longer have very much in your path. You can add a section to your ~/.config/fish/config.fish file that will set your path correctly on login. This is much like .profile or .bash_profile as it is only executed for login shells.
    if status --is-login
    set PATH $PATH /usr/bin /sbin
    end
    Note that you will need to manually add various other environment variables, such as $MOZ_PLUGIN_PATH. It is a huge amount of work to get a seamless experience with fish as your default shell.

  • When is /etc/profile called?

    with my current boot/startup/login method (see below), /etc/profile is not being called. a little bit of googling tells me that /etc/profile is called at startup - but i'd like to know exactly when and by what. is it only called at bash login? what kind of magic does GDM do to call it?
    i added a script /etc/rc.d/startx:
    #!/bin/bash
    case $1 in
    start)
    su jakob startx&
    stop)
    killall X
    restart)
    echo "invalid argument"
    esac
    and put startx in the DAEMONS array in /etc/rc.conf

    Have your checked that startx is in /etc/rc.d/ folder? . If I remember correct the 'profile' is to be placed at the last position in you grub (menu.lst) of booting kernel.

  • [Solved] -bash: /etc/profile.d/bash_completion.sh: No such file or ...

    Hi all.
    Did a pacman -Syu yesterday, havn't done this for a while. After this, whenever starting a login shell, I'm getting the following:
    -bash: /etc/profile.d/bash_completion.sh: No such file or directory
    It seems to be caused by sourcing /etc/profile. Now, my /etc/profile hasn't been changed.
    [ndlarsen@slave ~]$ . /etc/profile
    -bash: /etc/profile.d/bash_completion.sh: No such file or directory
    [ndlarsen@slave ~]$ pacman -Qo /etc/profile
    /etc/profile is owned by filesystem 2009.07-1
    [ndlarsen@slave ~]$ pacman -Ss filesystem | grep core/filesystem
    core/filesystem 2009.07-1 (base)
    [ndlarsen@slave ~]$ pacman -Qk filesystem
    filesystem: 89 total files, 0 missing file(s)
    [ndlarsen@slave ~]$ pacman -Q bash-completion
    bash-completion 1.0-3
    [ndlarsen@slave ~]$ pacman -Ss bash-completion
    extra/bash-completion 1.0-3
    Programmable completion for the bash shell
    [ndlarsen@slave ~]$ pacman -Qk bash-completion
    bash-completion: 45 total files, 0 missing file(s)
    Now, I'm wondering if this is a bug or feature and what to do about it.
    Cheers.
    Last edited by ndlarsen (2009-10-30 12:32:54)

    Correct, seems to be caused by /etc/profile.bash, which I neither have messed with, though difers for some reason.
    [ndlarsen@slave ~]$ . /etc/profile.bash
    -bash: /etc/profile.d/bash_completion.sh: No such file or directory
    [ndlarsen@slave ~]$ wget -O profile.bash http://repos.archlinux.org/wsvn/packages/bash/repos/core-i686/profile.bash?op=dl&rev=0
    [ndlarsen@slave ~]$ diff profile.bash /etc/profile.bash; echo ..Done...
    25a26,29
    >
    > #. bash_completion
    > . /etc/profile.d/bash_completion.sh
    >
    ..Done...
    [ndlarsen@slave ~]$ pacman -Qo /etc/profile.bash
    /etc/profile.bash is owned by bash 4.0.033-1
    [ndlarsen@slave ~]$ pacman -Q bash
    bash 4.0.033-1
    Wonder if the devs have made changes to the svn entries.
    Last edited by ndlarsen (2009-10-30 10:57:11)

  • Lost /etc/profile

    Since one of the latest updates, it seems my system is a bit broken. Commands like startx fail, and I recieve masages that xauth, xinit and elf are commands that can't be found. I wanted to have a look at /etc/profile, to check patch declaration, and noticed the whole file is crappy. It now looks like
    ^?ELF^A^A^A^@^
    fffuffffuffff^@^@
    uffffd^G^F^H^ufff
    fE^L^uffffD$^D^uf
    Hm, mysterious. I would be glad if someone could post a standard profile set here to give me a template.

    The original /etc/profile from bash package:
    # /etc/profile
    export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/opt/bin"
    export MANPATH="/usr/man:/usr/X11R6/man"
    export LESSCHARSET="latin1"
    export INPUTRC="/etc/inputrc"
    export LESS="-R"
    # Locale settings (find your locale with 'locale -a')
    export LANG="en_US"
    export LC_COLLATE="C"
    export COLUMNS LINES
    export PS1='[u@h W]$ '
    export PS2='> '
    umask 022
    if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" -o "$TERM" = "rxvt" ]; then
    PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}07"'
    fi
    # load profiles from /etc/profile.d
    # (to disable a profile, just remove execute permission on it)
    for profile in /etc/profile.d/*.sh; do
    if [ -x $profile ]; then
    . $profile
    fi
    done
    unset profile
    # End of file
    If you still have the packages cache, you could also see this file in /var/cache/pacman/pkg/bash-3.0-3.pkg.tar.gz

  • [SOLVED] How do I set the default umask? Not in /etc/profile

    Hi guys
    This is probably not what you expect to hear about umasks... I have set it in /etc/profile:
    [2] ognyan@xxxlinux : ~ >grep umask /etc/profile
    #Set our umask
    umask 002
    If I log on via ssh, my umask is 0002. I can start a vnc server and a konsole inside, which has umask 0002. So far so good...
    I also have a vnc server running as a service. If I open a konsole from inside this vnc, bash says umask 0022. So there must be a more-default setting for umask, than /etc/profile. I found a setting in /etc/login.defs and changed it to "UMASK 007", then even rebooted, but bash inside the vnc service stays with umask 0022.
    It seems not to be a setting of KDE, since both vnc sessions have different umasks, inherited by their parents. What provides the environment for the service and how can I control it?
    Last edited by bigblondewolf (2013-12-11 08:37:26)

    on my server i have something like this in ~/.profile:
    # the default umask is set in /etc/profile; for setting the umask
    # for ssh logins, install and configure the libpam-umask package.
    umask 002
    and at home i have ~/.bash_profile, but no umask in it.
    or is this answer too obvious? not quite sure i get your problem.

  • /etc/profile: line 28: ulimit: max locked memory: cannot modify limit: Oper

    Hi;
    I writed one sh which is checking tablespace size and its working well ( i used this before for someother client) Now i try to run it on one server and i have this error:
    /etc/profile: line 28: ulimit: max locked memory: cannot modify limit: Operation not permitted in /var/spool/mail/root
    Anyone has idea what is problem?
    Thanks

    Well, check line 28 of /etc/profile, and see what command it is trying to execute. If it's a ulimit -l command, check if the value it is trying to set the limit to is higher than the current ulimit value of the current user. If it is, then that operation is not allowed. You can increase the limit for the current user (at login time) by modifying /etc/security/limits.conf . This is documented in the various guides, notes, whitepapers that talk about installing Oracle database on Linux.

  • Help with pico /etc/profile

    I have redhat 7.3 and i install the sdk. Its in usr/java/j2sdk1.4.1/bin
    Where exactly do I put the line path so every user can use the java/javac etc commands anywhere. I tried. but it dont work. Im I clicked on save settings, but im not sure that saves it. I was trying to follow the other thread instructions but everyone seems kinda different. Im very new to linux by the way. Think i installed it by accident :P
    # /etc/profile
    # System wide environment and startup programs, for login setup
    # Functions and aliases go in /etc/bashrc
    pathmunge () {
    if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
    if [ "$2" = "after" ] ; then
    PATH="$PATH:/usr/java/j2sdk1.4.0/bin"
    else
    PATH=$1:$PATH
    fi
    fi
    # Path manipulation
    if [ `id -u` = 0 ]; then
    pathmunge /sbin
    pathmunge /usr/sbin

    It seems to me that when ".plist" files contain references to other files or folders, most require full paths and they won't accept anything to represent a generic "home". Either that, or items are represented by "alias" data, referring to a specific file, which would be completely independent of paths. That of course means that any sort of "template" account must avoid containing references to items within the "home" folder because the template will contain references to the original items, not their counterparts in the new user's home. Note that things like the "sidebar" in a regular account or the "Dock" in a "Simple Finder" do contain shortcuts to items within the "home" folder, but these aren't generated from ".plist" files in the template but rather are generated on the fly by "Finder" during login.
    In the case of the default download location for "Safari", I think it defaults to the user's "Desktop" in the absence of a ".plist" file. However, if the user changes the location, then a ".plist" file is created at that point. It would also appear that the default download location is set to the user's "Desktop" if the default Safari "home page" is changed, which also causes the same file to be created. The file appears to be: "~/Library/Preferences/com.apple.internetconfigpriv.plist"
    I haven't tested this to see if it would work, but it might be possible to modify your existing template to remove the reference to the "download folder" while retaining the desired Safari "home page" using something along these lines:<pre style="overflow:auto; padding: 5px; width: 500px ; font-size: 10px; border:1">sudo defaults delete /System/Library/User\ Template/English.lproj/Library/Preferences/com.apple.internetconfigpriv DownloadFolder</pre>

Maybe you are looking for