Hide Forgot
Description of problem: when I do su - and work as root , configuring servers, services etc autojump don't keep many paths Version-Release number of selected component (if applicable): autojump-14-2.fc14.noarch How reproducible: su - cd /etc/httpd/ jumpstat 2.0: /root/rpmbuild 11.0: /root/rpmbuild/SPECS doesn't appear /etc/httpd/ Actual results: doesn't appear /etc/httpd/ Expected results: should appear Additional info: great tool autojump tks!
Hi, Thanks for your report. Have you actually run autojump ? Without that, it will not store your paths. Its history is user-dependant, and using "su -" will identify you as root. Try: su - autojump cd /etc/httpd/ jumpstat It will appear in the list.
no, su - root@segulix:~#autojump /root/rpmbuild/SPECS root@segulix:~#cd /etc/httpd/ root@segulix:/etc/httpd13#jumpstat 2.0: /root/rpmbuild 11.0: /root/rpmbuild/SPECS Total key weight: 13. Number of stored paths: 2
continue ... If I do cd on a screen, the paths are saved and showed by jumpstat (autojump works) for example: screen cd /etc/httpd jumpstat 1.0: /etc/httpd (...) exit (exit the screen) jumpstat 1.0: /etc/httpd (still there !) but cd to elsewhere is not saved in jumpstat (as root) cd /var/lib/mysql/ jumpstat no mysql appears
(autojump author here) Hi Sergio, First, a little background: Autojump works on a per-user basis, and the root user is not the same user as you. Therefore, the root user and your user have different databases. Also, if you want autojump to work properly as root, you need to source the autojump files in the root's bashrc as well. With the symptoms you're describing, my guess would be that the autojump files are not properly sourced when you do "su -", but get sourced when you run screen. Does your /root/.bashrc source /etc/profile? It would also be useful if you could post the output of the `env` command after you issue the "su -" command. I hope we can fix this together!
Hi, thanks for support , I found the problem but not the solution , After "su - " env | grep PROM PROMPT_COMMAND=printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}" while all others cases : env | grep PROM PROMPT_COMMAND=echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007" ; { [[ "$AUTOJUMP_HOME" == "$HOME" ]] && (autojump -a "$(pwd -P)"&)>/dev/null 2>>${AUTOJUMP_DATA_DIR}/autojump_errors;} 2>/dev/null if I do as root: export PROMPT_COMMAND="${PROMPT_COMMAND:-:} ; $AUTOJUMP" I fix the autojump, seems something change PROMPT_COMMAND after run /etc/profile.d/autojump.bash I will investigate .. , yes I have I own PROMPT_COMMAND ! Thanks, at least now, I know how workaround the problem.
There you go! Autojump is careful not to overwrite your PROMPT_COMMAND, you have to be careful not to overwrite autojump's :)
(In reply to comment #6) > There you go! Autojump is careful not to overwrite your PROMPT_COMMAND, you > have to be careful not to overwrite autojump's :) but if I clean my custom PROMPT_COMMAND , the issue still exist ! are you sure after su - echo $PROMPT_COMMAND autojump stuff doesn't disappears ? in kde , with a konsole ? anyway, as work around I add after my custom prompt : export PROMPT_COMMAND="${PROMPT_COMMAND:-:} ; $AUTOJUMP"
I think you need to source /etc/profile.d/autojump.bash in /root/.bashrc. Root and your users are two separate users, and as such, you have to install autojump for both. Does that make sense to you?
Hi, this bug is fixed with commit on setup package ( now is setup-2.8.28-1.fc14.noarch ) http://git.fedorahosted.org/git/?p=setup.git;a=commit;h=3f59843e8a1ccf06859e3948ae78026032ed0464 http://git.fedorahosted.org/git/?p=setup.git;a=blobdiff;f=bashrc;h=4a4ab1932fd4123211f87713f7673070312e9f01;hp=1d0dc1b44223d28662627e333baa47a663c70603;hb=3f59843e8a1ccf06859e3948ae78026032ed0464;hpb=742af4c8a96467bf37c58357f0aa70e93faaafb6 so this is a dup of https://bugzilla.redhat.com/show_bug.cgi?id=691425 if you do a su - , with any user with the code before April 12, $PROMPT_COMMAND will be override , and autojump will not work correctly . *** This bug has been marked as a duplicate of bug 691425 ***