Announcement

Collapse
No announcement yet.

centos -> cloudlinux cpanel accounts: /bin/bash: /usr/local/bin/detailedlog: No such file or directory

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • centos -> cloudlinux cpanel accounts: /bin/bash: /usr/local/bin/detailedlog: No such file or directory

    I setup a new cloudlinux6 server running cagefs.

    When I transferred a couple test cpanel accounts from a different cpanel centos server via cpbackup and restore on the new cloudlinux server, logging in via ssh to those transferred accounts any command results in:

    /bin/bash: /usr/local/bin/detailedlog: No such file or directory

    Is there a way to fix this before I transfer more accounts.

    Thanks.

  • #2
    I have never saw something like that, suppose some profile/bashrc files contains that line to be run when user is logged in. Please check:

    Code:
    grep detailedlog /etc/* -s
    
    grep detailedlog ~username/.* -s
    Do you have /usr/local/bin/detailedlog on old and new servers? What package it belongs to?

    Comment


    • #3
      I didnt find any reference to /usr/local/bin/detailedlog in the imported cpanel accounts bashrc file nor does either grep command above return anything for the cpanel usernames.

      cat /usr/local/bin/detailedlog
      #!/bin/bash
      SET_IP=`echo -n $SSH_CLIENT|cut -d -f1`
      if [[ `tail -n1 ~/.bash_history|rev|cut -c -4|rev|cut -c -3` != 201 ]]
      then
      sed -i "$s/$/ #entered by `echo -n $SET_IP` on `date`/g" ~/.bash_history
      fi

      stat /usr/local/bin/detailedlog, the change date of the file is the day the new cloudlinux6 server was setup. The change date of /usr/local/bin/detailedlog on the old centos6 server is the date that server was setup.

      Comment


      • #4
        With a grep -r detailedlog . from / found there is a file matching the name of my datacenter at
        /etc/profile.d/datacenter-name.sh

        #Export variable for extended bash logging with IP and datestamp
        export PROMPT_COMMAND="history -a; /bin/bash /usr/local/bin/detailedlog"

        Comment


        • #5
          Yeah, thats it. PROMPT_COMMAND means to run the command on every RETURN button hit in console. Usually it is done to save whole history to some location.

          Please consider removing /etc/profile.d/datacenter-name.sh from new server.

          Comment


          • #6
            Actually, if you need that functionality we can try making it working from cagefs inside. Just create some /etc/cagefs/conf.d/custom.cfg and add /usr/local/bin/detailedlog into it. Then execute cagefsctl --force-update and it will be available from cagefs.

            Comment


            • #7
              Perfect. Thanks!

              Comment

              Working...
              X