/bin/sh: line 1: /var/log/ispconfig/cron.log: Permission denied

Discussion in 'Installation/Configuration' started by kidalabama, Jul 20, 2023.

  1. kidalabama

    kidalabama New Member

    Code:
    ##### SERVER #####
    IP-address (as per hostname): ***.***.***.***
    [WARN] could not determine server's ip address by ifconfig
    [INFO] OS version is Debian GNU/Linux 11 (bullseye)
     
    [INFO] uptime:  09:10:41 up 10:21,  1 user,  load average: 2.88, 4.18, 3.97
     
    [INFO] memory:
                   total        used        free      shared  buff/cache   available
    Mem:            11Gi       6.9Gi       879Mi       592Mi       3.9Gi       3.8Gi
    Swap:          767Mi       125Mi       642Mi
     
    [INFO] ISPConfig is installed.
    
    ##### ISPCONFIG #####
    ISPConfig version is 3.2.10p1
    
    
    ##### VERSION CHECK #####
    
    [INFO] php (cli) version is 7.4.33
    [INFO] php-cgi (used for cgi php in default vhost!) is version 7.4.33
    
    ##### PORT CHECK #####
    
    
    ##### MAIL SERVER CHECK #####
    
    
    ##### RUNNING SERVER PROCESSES #####
    
    [INFO] I found the following web server(s):
        Apache 2 (PID 1133)
    [INFO] I found the following mail server(s):
        Postfix (PID 1349)
    [INFO] I found the following pop3 server(s):
        Dovecot (PID 806)
    [INFO] I found the following imap server(s):
        Dovecot (PID 806)
    [INFO] I found the following ftp server(s):
        PureFTP (PID 1402)
    
    ##### LISTENING PORTS #####
    (only        ()
    Local        (Address)
    [anywhere]:110        (806/dovecot)
    [anywhere]:143        (806/dovecot)
    [anywhere]:111        (1/init)
    [anywhere]:465        (1349/master)
    [anywhere]:21        (1402/pure-ftpd)
    ***.***.***.***:53        (647/named)
    ***.***.***.***:53        (647/named)
    ***.***.***.***:53        (647/named)
    ***.***.***.***:53        (647/named)
    ***.***.***.***:53        (647/named)
    ***.***.***.***:53        (647/named)
    ***.***.***.***:53        (647/named)
    ***.***.***.***:53        (647/named)
    [localhost]:53        (647/named)
    [localhost]:53        (647/named)
    [localhost]:53        (647/named)
    [localhost]:53        (647/named)
    [localhost]:53        (647/named)
    [localhost]:53        (647/named)
    [localhost]:53        (647/named)
    [localhost]:53        (647/named)
    [anywhere]:22        (702/sshd:)
    [localhost]:631        (46702/cupsd)
    [localhost]:5432        (899/postgres)
    [anywhere]:25        (1349/master)
    [localhost]:5433        (897/postgres)
    [localhost]:953        (647/named)
    [anywhere]:993        (806/dovecot)
    [anywhere]:995        (806/dovecot)
    [localhost]:10024        (1097/amavisd-new)
    [localhost]:10025        (1349/master)
    [localhost]:10026        (1097/amavisd-new)
    [localhost]:3306        (763/mariadbd)
    [localhost]:10027        (1349/master)
    [anywhere]:587        (1349/master)
    [localhost]:6379        (654/redis-server)
    [localhost]:11211        (646/memcached)
    [localhost]10        (806/dovecot)
    [localhost]43        (806/dovecot)
    [localhost]11        (1/init)
    *:*:*:*::*:8080        (1133/apache2)
    *:*:*:*::*:80        (1133/apache2)
    *:*:*:*::*:465        (1349/master)
    *:*:*:*::*:8081        (1133/apache2)
    *:*:*:*::*:21        (1402/pure-ftpd)
    *:*:*:*::*:53        (647/named)
    *:*:*:*::*:53        (647/named)
    *:*:*:*::*:53        (647/named)
    *:*:*:*::*:53        (647/named)
    *:*:*:*::*:53        (647/named)
    *:*:*:*::*:53        (647/named)
    *:*:*:*::*:53        (647/named)
    *:*:*:*::*:53        (647/named)
    *:*:*:*::**:*:*:*::*53        (647/named)
    *:*:*:*::**:*:*:*::*53        (647/named)
    *:*:*:*::**:*:*:*::*53        (647/named)
    *:*:*:*::**:*:*:*::*53        (647/named)
    *:*:*:*::**:*:*:*::*53        (647/named)
    *:*:*:*::**:*:*:*::*53        (647/named)
    *:*:*:*::**:*:*:*::*53        (647/named)
    *:*:*:*::**:*:*:*::*53        (647/named)
    *:*:*:*::*:3350        (1069/xrdp-sesman)
    *:*:*:*::*:22        (702/sshd:)
    *:*:*:*::*:631        (46702/cupsd)
    *:*:*:*::*:5432        (899/postgres)
    *:*:*:*::*:25        (1349/master)
    *:*:*:*::*:5433        (897/postgres)
    *:*:*:*::*:953        (647/named)
    *:*:*:*::*:443        (1133/apache2)
    *:*:*:*::*:3389        (1153/xrdp)
    *:*:*:*::*:993        (806/dovecot)
    *:*:*:*::*:995        (806/dovecot)
    *:*:*:*::*:10024        (1097/amavisd-new)
    *:*:*:*::*:10026        (1097/amavisd-new)
    *:*:*:*::*:587        (1349/master)
    *:*:*:*::*:6379        (654/redis-server)
    
    
    
    
    ##### IPTABLES #####
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination         
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination         
    
    
    
    
    ##### LET'S ENCRYPT #####
    Certbot is installed in /usr/bin/letsencrypt
    
    i am getting e mail to linux user
    Subject: Cron <username@servername> /usr/local/ispconfig/server/server.sh > /dev/null >> /var/log/ispconfig/cron.log


    /bin/sh: line 1: /var/log/ispconfig/cron.log: Permission denied
     
    Last edited: Jul 20, 2023
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Have you examined what are permissions for that file?
    Code:
    ls -lh /var/log/ispconfig/cron.log
     
  3. kidalabama

    kidalabama New Member

    -rw-rw---- 1 root root 33K Jul 20 10:04 /var/log/ispconfig/cron.log
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig runs server.sh as root user, so permissions should be fine. Maybe your harddisk is full?
     
  5. kidalabama

    kidalabama New Member

    df -h
    Filesystem Size Used Avail Use% Mounted on
    udev 5.9G 0 5.9G 0% /dev
    tmpfs 1.2G 1.5M 1.2G 1% /run
    /dev/mapper/hosting1-root 39G 34G 2.6G 93% /
    tmpfs 5.9G 32K 5.9G 1% /dev/shm
    tmpfs 5.0M 0 5.0M 0% /run/lock
    /dev/sda1 228M 116M 101M 54% /boot
    /dev/sdb1 1.8T 133G 1.5T 9% /media/username/data
    tmpfs 1.2G 1.7M 1.2G 1% /run/user/1000
     
    Last edited: Jul 20, 2023
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You replaced the username in the line you posted. Which real username is this?
     
  7. kidalabama

    kidalabama New Member

    for security reasons i didn't write.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, but as it's the key information to track down the issue because you seem to manually run server.sh as a wrong user which results in your error. So we can close the thread then as it can't be solved without that info.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    You just send me the user as PM and the username is not root. This shows that you manually run server.sh as a non root user or created a cronjob to run server.sh as non root user and this must cause issues of course as server.sh must be run as root.
     
  10. kidalabama

    kidalabama New Member

    what will i must do ?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Undo what you did to run server.sh as wrong user. This issue is basically not related to ISPConfig, you manually run script from ISPConfig , in this case the server.sh script) as wrong non root user and you must stop doing this to get rid of this message.
     
  12. kidalabama

    kidalabama New Member

    root user crontab -l
    * * * * * /usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done
    * * * * * /usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done
    my user crontab -l
    * * * * * /usr/local/ispconfig/server/server.sh > /dev/null >> /var/log/ispconfig/cron.log

    now i will remove my user crontab command but what is difference /dev/null and 2>&1

    and thank you so much.
    and i will ask another question will i must open new discussion ?
     
    Last edited: Jul 20, 2023
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to remember what you did before the problem started and undo the changes you made there. maybe you manually altered the root crontab and changed it or you did other manual changes in the crontab system that causes the system#s root crontab to be executed as a non-root user or similar.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, there you have the problem, you manually added a call for server.sh to your user's crontab, this must fail. Remove it from your users crontab. The root crontab is fine.
     
  15. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Use Internet Search Engines with
    Code:
    what is difference /dev/null and 2>&1
    It is good practice to not hijack old or unrelated threads and only discuss one subject in a thread. So for unrelated further question, start a new thread in the proper forum.
    Modest proposal: Please write proper sentences with punctuation, and post code and listings in CODE tags.
     
    ahrasis likes this.
  16. kidalabama

    kidalabama New Member

    Thank you so much Till and Taleman.
     

Share This Page