Root-shell doesn't source /root/.bashrc

Moin
When I change to the root user the bashrc is not sourced. No matter if I "su -" or login as root, the /root/.bashrc is not source. I need to manually type "source ~./.bashrc".
On all other Linux-distros I ever used this was done automatically.
How can I change this behavious?
Thanks in advance.

both .bashrc and .bash_profile are available from /etc/skel. Usually, the contents of this directory are copied to a new user's home directory when using the useradd command. I'm not sure why they're not added to the /root directory on a fresh install. The answer is probably on the arch-dev-public mailing list.

Similar Messages

  • Does my bashrc need to source /etc/bashrc

    In Fedora/Centos, my local .bashrc file seems to need to have a line to source global definitions:
    if [ -f /etc/bashrc ]; then
            . /etc/bashrc
    fi
    On Mountain Lion and Mavericks, it appears that /etc/bashrc is always sourced whether I have a local .bashrc or not. Verified with echo statements inside various files to show me what is being executed.
    I am trying to get confirm if this is true (for both interactive shells and child processes spawned by parent process) and, if so, does it do any harm to keep the sourcing of /etc/bashrc. I'd prefer to not have to have different .bashrc files for Linux and OSX.
    Thanks in advance for any advice

    I've got my answer for an interactive earlier in this thread (or at least enough to begin figuring out what I need to do regarding interactive shells and my local .bashrc). I pretty well understand the order that things are sourced in interactive, but was unprepared for the difference of OSX /etc/profile sourcing /etc/bashrc (which doesn't seem to happen on Linux).
    As for non-interactive, I tried to do as much research before querying on this forum. I know that they just do .bashrc. Hence why I see advice (and I have long followed such) to have .bash_profile source .bashrc to have all "my stuff" in one file that both interactive and non-interactive source. However, I can not figure out whether a non-interactive / subshell inherits and/or sources /etc/bashrc (which on OSX I now know comes through /etc/profile). My sense is that it does on OSX based on the other reply I got. Which would mean that whether I need to source /etc/bashrc is the same for interactive and non-interactive since, on OSX, I get the sense that any shell, interactive or non-interactive, is going to first call /etc/profile. As you can tell, I am having to make this final statement based on "best understanding".
    If I am misunderstanding non-interactive, can you please point me to a good link(s) that pertain to what OSX does (now that I know there is a very real difference between Linux and OSX and info for one might/will not work for the other).
    Thanks for your reply

  • Gnome-shell doesn't remember favorite application

    Hi all,
    since some time gnome-shell doesn't remember the favourite application. When I'm pressing the super-key and start typing for example "F", it should select Firefox immediately, but it's always searching in the standard list instead. I already googled it, but i couldn't find anything to help me. Any ideas?
    kernel: 2.6.38-ARCH
    gnome-shell: 3.0.2-1
    thanks!
    Last edited by hooch (2011-06-05 11:14:04)

    Hmm, since yesterday I'm fumbling around with those settings too. It seems this is not settings related at all (at least not to old package settings), but rather to nautilus' behavior. Just a few minutes ago I've set "view all hidden files" to true in it's settings. It instantly crashed. After a reboot gnome-shell is gone. This is really annoying.
    Also there is no taskbar, no menu bar, no nothing in fallback mode!... Is this even fallback mode?
    Trying to launch gnome-shell from terminal then gives:
    Window manager warning: Screen 0 on display ":0" already has a window manager; try using the --replace option to replace the current window manager.
    with replace option:
    Window manager warning: Log level 16: Another compositing manager is running on screen 0
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: meta_compositor_sync_window_geometry: assertion `info' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: meta_compositor_sync_window_geometry: assertion `info' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: meta_compositor_sync_window_geometry: assertion `info' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: meta_compositor_sync_window_geometry: assertion `info' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Segmentation fault
    Compiz is gone already. What could be causing this issue?

  • [Solved] Nautilus bookmarks - Gnome Shell Doesn't Start

    Hi there.
    I've tried to search and have been scratching my head by what probably has a really simple solution but I have not found it so far.
    I've made a fresh install of Arch, system is up to date, with Gnome 3 (shell and whatnot).
    I've set my locale in /etc/rc.conf to pt_BR and have properly generated locales.
    $ locale -a
    C
    en_US
    en_US.iso88591
    en_US.utf8
    POSIX
    pt_BR
    pt_BR.iso88591
    pt_BR.utf8
    Gnome is localized to pt_BR
    Everything is fine and dandy except for a really annoying thing.
    xdg-user-dirs-update
    Creates folders with incorrect characters when viewed on Nautilus (but appear correct on Nautilus sidebar).
    I tried editing the .config/user-dirs.dirs file with gedit, it showed the wrong characters but allowed me to write the correct ones. Saved it and ran xdg-user-dis-update, the output is borked characters. Tried editing it in nano, same results.
    I've managed to manually delete and create the correct folders using
    xdg-user-dirs-update --set MUSIC /home/$USER/Foldername
    but, while it displays properly on nautilus when navigating, it doesn't display properly on the sidebar.
    I'm linking to a screenshot so it is easier to understand. The music folder should read "Músicas". You can see I'm inside the Videos folder but the sidebar name doesn't match the folder name.
    http://i453.photobucket.com/albums/qq25 … _issue.jpg
    Any ideas?
    EDIT: After this post, I rebooted and gnome shell would no longer start - at all. I would get it to log in and display the wallpaper but that was it. I could get into xfce4 from gdm so I knew the issue was with gnome.
    Nonetheless, I went ahead and did yet another reinstall (I always assume I borked a package or hard-to-find-configuration).
    Feeling frustated but being a tad wiser I noticed a weird behavior on ~/.xsessionerror
    [Error initializing libicu support]
    This went on forever until I aborted the command.
    Changing my locale on my rc.conf from pt_BR to en_US fixed gnome-shell. I was once again able to boot into it without a problem. I then, from within gnome, choose portuguese as the default locale (gnome-control-panel, not rc.conf). This fixed the Nautilus issue above and has not stopped gnome-shell from working. I don't know *how* they implement their localization but heck, it works.
    Solved and maybe it might help anyone with the same issue.
    Last edited by OttoRobba (2012-06-22 06:43:37)

    Hmm, since yesterday I'm fumbling around with those settings too. It seems this is not settings related at all (at least not to old package settings), but rather to nautilus' behavior. Just a few minutes ago I've set "view all hidden files" to true in it's settings. It instantly crashed. After a reboot gnome-shell is gone. This is really annoying.
    Also there is no taskbar, no menu bar, no nothing in fallback mode!... Is this even fallback mode?
    Trying to launch gnome-shell from terminal then gives:
    Window manager warning: Screen 0 on display ":0" already has a window manager; try using the --replace option to replace the current window manager.
    with replace option:
    Window manager warning: Log level 16: Another compositing manager is running on screen 0
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: meta_compositor_sync_window_geometry: assertion `info' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: meta_compositor_sync_window_geometry: assertion `info' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: meta_compositor_sync_window_geometry: assertion `info' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Window manager warning: Log level 8: meta_compositor_sync_window_geometry: assertion `info' failed
    Window manager warning: Log level 8: add_win: assertion `info != NULL' failed
    Segmentation fault
    Compiz is gone already. What could be causing this issue?

  • Shell doesn't always come up

    This has been happening for quite a while, though it doesn't really bother me. Sometimes when I open an xterm, the bash prompt never comes up.
    That's the problem. I don't really know how to expound on it. Anybody else get this?
    Dusty

    OK, I had a little time to poke around for this issue that I'm having.
    I reviewed all the logs and noticed in the syslog that it started on the 26th:
    syslog.log:Jul 26 06:56:07 bigdog syslog-ng[2813]: Changing permissions on special file /dev/null
    syslog.log:Jul 26 09:12:43 bigdog syslog-ng[2813]: Changing permissions on special file /dev/null
    syslog.log:Jul 26 12:05:48 bigdog syslog-ng[2813]: Changing permissions on special file /dev/null
    syslog.log:Jul 26 13:49:45 bigdog syslog-ng[2813]: Changing permissions on special file /dev/null
    syslog.log:Jul 27 10:35:47 bigdog syslog-ng[2807]: Changing permissions on special file /dev/null
    syslog.log:Jul 27 19:25:17 bigdog syslog-ng[2811]: Changing permissions on special file /dev/null
    syslog.log:Jul 28 05:21:25 bigdog syslog-ng[2795]: Changing permissions on special file /dev/null
    syslog.log:Jul 28 14:06:12 bigdog syslog-ng[2803]: Changing permissions on special file /dev/null
    syslog.log:Jul 28 16:42:27 bigdog syslog-ng[2860]: Changing permissions on special file /dev/null
    syslog.log:Jul 28 19:16:26 bigdog syslog-ng[3493]: Changing permissions on special file /dev/null
    Any ideas what could be initiating this?

  • Screencast in Gnome Shell doesn't work

    Hi folks
    I tried to record a screencast in the Gnome Shell using the built-in feature, but it's not working; there's no red dot and no file in my home directory. Is there a package I need to install? Or is it possible that the Keyboard-Shortcut is in conflict with another program, if so does somebody know how to change it?
    Thanks

    I've installed all gst plugins -- and that worked.
    [r@prime ~]$ pacman -Qs gst
    local/gnome-media 3.4.0-2
        Sound recorder and GStreamer 0.10 configuration tool for GNOME
    local/gst-plugins-bad 1.0.6-1
        GStreamer Multimedia Framework Bad Plugins
    local/gst-plugins-base 1.0.6-1
        GStreamer Multimedia Framework Base Plugins
    local/gst-plugins-base-libs 1.0.6-1
        GStreamer Multimedia Framework Base Plugin libraries
    local/gst-plugins-good 1.0.6-1
        GStreamer Multimedia Framework Good Plugins
    local/gst-plugins-ugly 1.0.6-1
        GStreamer Multimedia Framework Ugly Plugins
    local/gst-vaapi 0.5.3-1
        GStreamer Multimedia Framework VA Plugins
    local/gstreamer 1.0.6-1
        GStreamer Multimedia Framework
    local/gstreamer0.10 0.10.36-1
        GStreamer Multimedia Framework
    local/gstreamer0.10-bad 0.10.23-3
        GStreamer Multimedia Framework Bad Plugin libraries (gst-plugins-bad)
    local/gstreamer0.10-bad-plugins 0.10.23-3 (gstreamer0.10-plugins)
        GStreamer Multimedia Framework Bad Plugins (gst-plugins-bad)
    local/gstreamer0.10-base 0.10.36-1
        GStreamer Multimedia Framework Base plugin libraries
    local/gstreamer0.10-base-plugins 0.10.36-1 (gstreamer0.10-plugins)
        GStreamer Multimedia Framework Base Plugins (gst-plugins-base)
    local/gstreamer0.10-ffmpeg 0.10.13-1 (gstreamer0.10-plugins)
        Gstreamer FFMpeg Plugin
    local/gstreamer0.10-good 0.10.31-1
        GStreamer Multimedia Framework Good plugin libraries
    local/gstreamer0.10-good-plugins 0.10.31-1 (gstreamer0.10-plugins)
        GStreamer Multimedia Framework Good Plugins (gst-plugins-good)
    [r@prime ~]$
    Just wonder which ones plugins package is responsible for screencast recording? Does gst and gstreamer packages may conflict with each other when they installed together?

  • [SOLVED] Gnome Shell doesn't search through recently used items

    A while back I ran chattir +i on ~/.local/share/recently-used.xbel because of a bug that gnome shell had where it would crash while searching for recently used items. Since I've now updated to 3.4.1, I figured the bug might have been fixed, so I ran chattr -i to allow writing to the file again. The file has since filled up with my recently used items, but they don't seem to appear in the gnome shell search.
    Sorry if this is a bit brief, but I'm not sure what other information to give on this problem.
    Last edited by themusicalduck (2012-04-25 22:32:38)

    I believe this was removed with 3.4.
    Here is the bug report: https://bugzilla.gnome.org/show_bug.cgi?id=670150
    And here is the gnome-shell commit: http://git.gnome.org/browse/gnome-shell … 8c68782d54
    Last edited by bzt (2012-04-25 17:04:57)

  • How to modify $PATH variable

    Hello,
    I'm having problems editing my $PATH variable.
    I've created a ".profile" with this line
    export /my_path:$PATH
    But when I launch Terminal again, I get this error:
    -bash: export: `/my_path:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin': not a valid identifier
    Is there something that I am missing? Or is there another easier way to edit my $PATH variable?
    Cheers!
    Max

    I'm having problems editing my $PATH variable.
    I've created a ".profile" with this line
    export /my_path:$PATH
    But when I launch Terminal again, I get this error:
    -bash: export: `/my_path:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin': not a valid identifier
    Is there something that I am missing? Or is there another easier way to edit my $PATH variable?
    export PATH="/my_path:$PATH"
    Also note, that bash will look for 1 of 3 initialization files
    .bash_profile
    .bash_login
    .profile
    In that order, and will use the first one it finds and then stop looking. If you also have a .bashrc file, you would source that in your shell initialization file
    source $HOME/.bashrc
    By the way, Terminal, Unix, and command line command questions are best asked in the Mac OS X Technologies > Unix Forum
    <http://discussions.apple.com/forum.jspa?forumID=735>

  • Bash shell for root not sourcing .bashrc

    Hi all
    Finally got around to getting my home LAPP server up and running - on Arch of course!
    Small problem that's really annoying. I can't get root's shell to source the .bashrc file.
    I (kind of) followed the colorized prompt tip from the Wiki:
    http://wiki.archlinux.org/index.php/Pos … nd_Console
    Except I put EVERYTHING in to /etc/bashrc then sym linked my user and root ~/.bashrc to /etc/bashrc:
    fukawi2 ~  $ ls -lha .bashrc
    lrwxrwxrwx 1 fukawi2 fukawi2 11 2008-04-01 21:53 .bashrc -> /etc/bashrc
    And that works fine. Root doesn't though. I tried removing the symlink and replacing it with a 'normal' .bashrc file that only sources /etc/bashrc if it exists:
    [root@lapp ~]# cat .bashrc
    if [ -f /etc/bashrc ]; then
            . /etc/bashrc
    fi
    But if I source it manually after I su or sudo, it works fine:
    fukawi2 ~  $ sudo -i
    [root@lapp ~]#
    [root@lapp ~]# (There's no pretty colorized prompt here)
    [root@lapp ~]#
    [root@lapp ~]# logout
    fukawi2 ~  $ su -
    Password:
    [root@lapp ~]#
    [root@lapp ~]# (Still no pretty prompt!)
    [root@lapp ~]#
    [root@lapp ~]# logout
    fukawi2 ~  $ sudo -i
    [root@lapp ~]# . .bashrc
    root ~ #
    root ~ #  (That's better; now I have the pretty prompt!)
    root ~ #
    Not having the colors doesn't bother me so much - it's not having all my aliases and not being able to change root's $PATH variable to include /usr/local/bin/ that's really annoying.
    Anyone got any advice or suggestions please?

    Besides having a .bashrc file, you also need a .bash_profile file in root's home directory.  .bash_profile should contain the following:
    . $HOME/.bashrc
    the .bash_profile file tells bash what file to use for configuration, which by convention has always been .bashrc.
    HTH
    Pudge
    Edit:  Opps, too slow on the trigger.  Brebs beat me to it.  I spent too much time looking in man bash for an explanation of the .bash_profile and .bashrc files.
    Last edited by Pudge (2008-04-03 02:04:54)

  • Getting root to recognize .bashrc [SOLVED]

    How do I get root to recognize my home directory's .bashrc? I want it to read that so I can color the root BASH prompt and have access to aliases.
    Any help would be most appreciated.

    phrakture wrote:I know!
    Don't run as root, just use sudo.  Problem solved.
    Then how do you make sudo use your aliases, i've got
    alias emacs='emacs -nw'
    both in /home/user/.bashrc and /root/.bashrc... it works well when i just type emacs in a console, but sudo emacs starts emacs with its ugly gui (although starting emacs after typing sudo -s works the way i want it to)
    It's the same with with ls too, try and compare ls to sudo ls

  • "command not found" when using bash as root [SOLVED]

    Some examples:
    bash: gparted: command not found
    bash: cryptsetup: command not found
    bash: lsusb: command not found
    All of these are defintely installed, and work without any problems if I type in their full path. Any idea why this is happening?
    Last edited by SkyValley (2008-12-15 02:57:30)

    That means you're not starting it as a login shell, so you may want to look in to that.
    /etc/profile is what you need,
    echo "source /etc/profile" > /root/.bashrc
    That's safe to do regardless and you can look in to the login shell problem later.

  • .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?

  • [SOLVED]Where is the place to set program path for root in arch?

    The situation is that I use qingy (set up according to wiki) as login manager and kde as desktop. When I use tty6 (agetty) to login (how comes that I cannot login as root, have to login as user and then su) /usr/sbin is in the path for root, but in kde when I su in konsole it is not. That caused me some headache with the latest kernel upgrade, since in kde the kernel will not upgrade properly, I have to do it on tty6. what is the proper way to set paths in arch? I looked at /root/.bashrc and that is almost empty. What obvious things am I missing? Has qingy to do with that problems? Any docs on that for arch? Besides firefox doesn't see any installed plugins, opera does. Plain Centrino laptop here.
    Thanks, signor_rossi
    Last edited by signor_rossi (2007-08-24 15:12:31)

    Thanks for the answers. Investigated a little more and it seems it is really qingy what messes things up. Deactivated it and used "startxfce4" to start xfce and "startx" with "exec startkde" in my  .xinitrc to start kde (once I figured out that in Arch "startkde" on command prompt alone does not work ) and voila, the path weirdness is gone in both DEs. Will look again into qingy when I have more time, since it is really nice when using different X setups (laptop on the go or laptop on docking with second display), like the eye candy. I guess I will stick to console now and simply use bash aliases for that purpose.
    Thanks, signor_rossi.

  • [SOLVED]Home directory confusion when running Emacs as root

    Hi, just set up my first Arch system.  I've installed emacs-nox, and it insists on using the .emacs file of the one normal user I have set up, even when I'm not logged in as that user.  Bits in that .emacs file which use a tilde to signify $HOME do point to /root when I'm logged in as root, causing various weirdnesses.
    Here's what --debug-init says when I run emacs as root; if there's anything apart from the complaint about the "missing" (not in /root) haskell-mode files, I'm afraid it means nothing to me
    edit: nope, all of that junk really was about the haskell-mode stuff, so I'm deleting it since that's "fixed" by copying that stuff to /root/.emacs.d.  Now --debug-init tells me nothing and I still have no idea why emacs insists on using the dotfile in /home/j
    Last edited by cuns (2011-12-25 23:21:06)

    I have this issue, too if starting emacs after doing a "su" - when logging in as root it works as expecte. Googling brought the emacs changelog:
    1987-05-12  Richard M. Stallman  (rms at prep)
        * startup.el (command-line): If running under `su',
        use user's original login name to get init file.
        Otherwise use $HOME.
    A workaround would be to define an alias like
    alias emacs='emacs -u root'
    in your root's ".bashrc" (/root/.bashrc).
    Hope that helps,
    greetings
    matse

  • Gnome run command source .bashrc

    Hi, after using just xmonad for a long time I'm now trying to get gnome and xmonad to play nicely together.  I am starting my gnome-xmonad session from GDM which was started with runlevel 5 in inittab--I followed the wiki.  Now in gnome, the run command dialogue (alt-f2) does not seem to source my ~/.bashrc.  I use an xmonad run util and under gnome-xmonad that run util does not source my ~/.bashrc either.  I have my PATH specified in my .bashrc but I cannot run the commands that rely on the path set in .bashrc.  I do have a ~/.bash_profile which sources ~/.bashrc, so that is not the issue.  In a terminal, my path is fine, but not from those run dialogues.  The xmonad run util worked fine when I would start xmonad with startx.  Any advice on how to get gnome to source my ~/.bashrc?

    I don't know about sourcing your .bashrc in gnome, but you are probably better off moving your PATH definition to your .bash_profile, before you source the .bashrc.

Maybe you are looking for

  • Creating BA using DB link

    Hi I am on Discoverer 10g on Oracle DB 10g. I have a EUL created in a schema 'EUL1'. I have the data in a different schema in a different database instance 'WB1' . I am trying to create a Business Area connected as EUL1 in disco admin. I have a publi

  • The drag and drop feature is not working on the touchpad

    My drag and drop stopped working on my macbook pro, the model number is the MB 13.3/2.4/2X1GB/250/SD/BL-KB-USA MB467LL/A The systems is runnng Snow Leapard, I have in the preferences, drag lock disabled, dragging enabled, the operating system is 10.6

  • Overriding Defaults for "Reply To" and [Reply] "From

    When I reply to a message, Mail selects values for the Reply To field and the From field. I can override these manually, but is there a way to set a different default? I could not see any way to do this with Rules. I suspect there is a way to write a

  • Reporting: using operators with relative selection

    Dear all, i am facing an problem when trying to create a certain report. The requirement is to gather all opportunities for which the sales phase has started more than 1 month ago. Phase start date is a characteristic you can use using data sources f

  • Watch Folder not working in PSE 8

    My understanding is that My Pictures folder is automatically under Watch Folder list. However, whenever I create a subfolder within My Pictures in the Explorer and put picures in it, my media browser in PSE 8 does not show me those pictures in that f