Skip to main content

public_html/ being recreated automatically via non-interactive shell?

Comments

5 comments

  • Zbx3x4UyxPy7Ty2
    It looks like /etc/bashrc has the following, which is most definitely the source of my problem
    if [ ! -e ~/public_html/cgi-bin ]; then mkdir -p ~/public_html/cgi-bin fi
    0
  • vanessa
    First, can you clarity what 'non-interactive' shell you are using? There are a couple scripts that will recreate docroots, but it's possible perhaps the public_htm isn't actually getting removed in the first place. I'm curious though - why do an rm -rf instead of an unlink? Unlink is safer for symlinks:
    unlink /home/acctname/public_html ln -fs /home/acctname/app/revisions/201402221245 /home/acctname/public_html
    0
  • Zbx3x4UyxPy7Ty2
    public_html/ is definitely getting removed. I say "non-interactive" because I have mostly default ssh settings for Capistrano, and it's docs say it assigns a non-login, /http://capistranorb.com/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/ I am not an expert in which startup files are included for login/non-login & interactive/non-interactive shells, but so far /etc/bashrc is the only one I've come across which is definitely trying to recreate the public_html/ directory. Thank you for your tip about using unlink. A follow-up question I have is: will /etc/bashrc be reset by cPanel when cPanel updates are performed?
    0
  • cPanelMichael
    Manually modifications to /etc/bashrc should not be overwritten by cPanel updates. It's often done to prevent the automatic creation of the cgi-bin directory. Thank you.
    0
  • oldchili
    Have you tried executing in succession?
    rm -rf /home/acctname/public_html && ln -fs /home/acctname/app/revisions/201402221245 /home/acctname/public_html
    I had the same issue when developing my Capistrano deployment scripts. The above solved my problem.
    0

Please sign in to leave a comment.