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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scott
    Senior Member
    Forum ExplorerTechnical AssociateSolutions Developer
    • Mar 2021
    • 119

    #1

    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.
  • bogdan.sh
    Administrator
    • Nov 2016
    • 1219

    #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

    • jeff
      Junior Member
      • Jul 2017
      • 11

      #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

      • jeff
        Junior Member
        • Jul 2017
        • 11

        #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

        • bogdan.sh
          Administrator
          • Nov 2016
          • 1219

          #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

          • bogdan.sh
            Administrator
            • Nov 2016
            • 1219

            #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

            • jeff
              Junior Member
              • Jul 2017
              • 11

              #7
              Perfect. Thanks!

              Comment

              Working...