1

It seems that all my log folders located in /var/log are turning into files.

For example, if I try to tail /var/log/apache2.log it will say "no such file or directory"

I can see it in the file structure but can't do a single thing with it. I am experiencing some major problems overall with my Ubuntu 12.04 LTS.

Any ideas what this could be?

UPDATE:

Here's an error when I try to restart apache:

root@ww2:~# sudo service apache2 restart
 * Restarting(20)Not a directory: apache2: could not open error log file /var/log/apache2/error.log.                                                  
Unable to open logs

Also output requested (ls -la /var/log):

-rw-r--r--  1 root root    0 Jan  7 17:05 mysql
-rw-r--r--  1 root root    0 Jan  7 17:05 mysql.err
-rw-r--r--  1 root root    0 Jan  7 17:05 mysql.log
-rw-r--r--  1 root root    0 Jan  7 17:05 mysql.log.5.gz
-rw-r--r--  1 root root    0 Jan  7 17:05 mysql.log.6.gz
-rw-r--r--  1 root root    0 Jan  7 17:05 mysql.log.7.gz
-rw-r--r--  1 root root    0 Jan  7 17:05 mysql.log.8.gz
-rw-r--r--  1 root root    0 Jan  7 17:05 news
-rw-r--r--  1 root root    0 Jan  7 17:05 nginx
-rw-r--r--  1 root root    0 Jan  7 17:05 php5-fpm.log
-rw-r--r--  1 root root    0 Jan  7 17:05 plesk-install
-rw-r--r--  1 root root    0 Jan  7 17:05 plesk-roundcube
-rw-r--r--  1 root root    0 Jan  7 17:05 psa-horde
-rw-r--r--  1 root root    0 Jan  7 17:05 railgun
-rw-r--r--  1 root root    0 Jan  7 17:05 rkhunter.log
-rw-r--r--  1 root root    0 Jan  7 17:05 rkhunter.log.old
-rw-r--r--  1 root root    0 Jan  7 17:05 sa-update.log
-rw-r--r--  1 root root    0 Jan  7 17:05 sw-cp-server
-rw-r--r--  1 root root    0 Jan  7 17:05 sw-cp-server_back
-rw-r--r--  1 root root    0 Jan  7 17:05 sw-cp-server_backup
-rw-r--r--  1 root root    0 Jan  7 17:05 syslog
-rw-r--r--  1 root root    0 Jan  7 17:05 syslog.1
-rw-r--r--  1 root root    0 Jan  7 17:05 syslog.2.gz
-rw-r--r--  1 root root    0 Jan  7 17:05 syslog.3.gz
-rw-r--r--  1 root root    0 Jan  7 17:05 syslog.4.gz
-rw-r--r--  1 root root    0 Jan  7 17:05 syslog.5.gz
-rw-r--r--  1 root root    0 Jan  7 17:05 syslog.6.gz
-rw-r--r--  1 root root    0 Jan  7 17:05 syslog.7.gz
-rw-r--r--  1 root root    0 Jan  7 17:05 udev
-rw-r--r--  1 root root    0 Jan  7 17:05 ufw.log
-rw-r--r--  1 root root    0 Jan  7 17:05 upstart
-rw-r--r--  1 root root    0 Jan  7 17:05 wdcollect.log
-rw-r--r--  1 root root  768 Jan  7 17:24 wtmp
-rw-r--r--  1 root root    0 Jan  7 17:05 wtmp.1

Output of (ls -la /var/log/apache2)

-rw-r--r-- 1 root root 0 Jan  7 17:05 /var/log/apache2

Output of mount:

/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)

Doing a /forcefsck I get these at startup:

https://www.dropbox.com/s/26uz62ocsilzz68/Screenshot%202014-01-07%2018.23.21.jpg https://www.dropbox.com/s/1qb26n6hp9ljh4u/Screenshot%202014-01-07%2018.23.04.png

  • @bodhi.zazen I know - it still says no such file or directory. – greycode Jan 7 '14 at 22:23
  • Nope - it shows apache2 in /var/log as a 0 byte "document" with no extension. All of my log files/folders have been turned into this ghost form – greycode Jan 7 '14 at 22:27
  • @bodhi.zazen I know - tail won't open the error log. It says it doesn't exist. If I touch it, it says "not a directory" – greycode Jan 7 '14 at 22:41
  • @bodhi.zazen done. – greycode Jan 7 '14 at 22:50
  • I did sudo -s to get to root. is that what you are asking? @bodhi.zazen – greycode Jan 7 '14 at 22:56
0
sudo apt-get install bleachbit

then do:

sudo bleachbit

clean up the system.

Then do the following:

sudo apt-get -f update
sudo apt-get -f upgrade

and if you still have problems:

sudo apt-get -f dist-upgrade   

You are not an enterprise so you shouldn't be worrying about having LTS versions but a stable version that satisfies your needs and solves your problems. You could also update to Ubuntu 13.10.

sudo apt-get install update-manager-core
sudo update-manager -d
sudo do-release-upgrade
| improve this answer | |
  • I would not use bleachbit indiscriminately, nothing wrong with apt, so apt-get -f will not do much, upgrade is unlike to solve anything either as the problem is with the log files, and last, "dist-upgrade" does not do what you think it does ;) – Panther Jan 7 '14 at 22:59
  • This didn't fix my ghost log issues :( – greycode Jan 7 '14 at 22:59
  • Hoped it helped because it normally does remove logs, try the update if you wish its the only alternative I know I can give you at the moment, an update is always good, you can also remove the log under sudo or open it with gedit. – Brask Jan 7 '14 at 23:14
  • @Brask updated with startup errors and screen shots – greycode Jan 7 '14 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.