Search code examples
linuxdebian-jessie

unlinking a file in linux


I am new to Linux and trying to understand some things. In my docker image I see that the error.log is linked to stdout.

ln -sfT /dev/stderr "/var/log/apache2/error.log"

What is the command to unlink this so the error.log is written again?


Solution

  • unlink and then touch the file.

    $ unlink /var/log/apache2/error.log && touch /var/log/apache2/error.log
    

    Then test the procedure by writing to the log:

    $ echo "Test Line" >> /var/log/apache2/error.log
    

    If apache for some reason is still not writing to the file, try reloading the service,