0

Mysql service just stop working. once I typed: service mysql startThe linux system displayed the following:

tail: invalid option -- n
Try `tail --help' for more information.
tail: invalid option -- n
Try `tail --help' for more information.
/etc/init.d/mysql: ERROR: The partition with is too full! failed!

Knowing that I didnt edit the mysql file, it is always like that and my server ist not full because I checked this with df command. What can I do about it?

The -type f -name tail gives:

/bin/tail
/home/vhosts/Site1/bin/tail
/home/vhosts/Site2/bin/tail
/home/vhosts/Site3/bin/tail
/home/vhosts/Site4/bin/tail
/home/vhosts/Site5/bin/tail
/home/vhosts/chroot/bin/tail
/var/www/vhosts/chroot/bin/tail
/var/www/shops/Site6/bin/tail
/usr/bin/tail
amani
  • 9
  • 5
  • The weirdness begins with the `invalid option` error from `tail` since `-n` is very much a correct option. What happens if you call e.g. `tail -n 2 /etc/fstab` in the terminal? – Sven Mar 28 '14 at 11:27
  • No it works fine in fact – amani Mar 28 '14 at 11:28
  • should I upgrade mysql version? I have no idea what to do – amani Mar 28 '14 at 11:30
  • 1
    What OS are you on? What happens it you edit `/etc/init.d/mysql` to contain the line `which tail` and then call `service mysql status`? Is it the same output as when you issue this command on the shell (e.g. both `/usr/bin/tail`)? – Sven Mar 28 '14 at 11:45
  • I edited in fact but it didt help since once I commeted this line mysql (status,stop,start,restart)is not responding any more – amani Mar 28 '14 at 11:50
  • Distributor ID: Debian Description: Debian GNU/Linux 5.0.10 (lenny) Release: 5.0.10 Codename: lenny – amani Mar 28 '14 at 11:58
  • What likely happens there is that the call to `tail` fails for some reason and therefore, the script doesn't get the path for the mysql data dir and fails to start the daemon, with a misleading error message. What happens if you run `find / -type f -name tail` (will take a long time!) Do you get more than one line of output? If yes, it might be that your system is compromised, which isn't so unlikely considering that Debian Lenny is EOL for two years now. – Sven Mar 28 '14 at 12:03
  • find / -type f -name tail didnt took too much in fact to be excetude. What can I do to fix this – amani Mar 28 '14 at 12:21
  • and yes I get many lines as an output – amani Mar 28 '14 at 12:21
  • Can you add this output to your question, or a part of it? – Sven Mar 28 '14 at 12:27
  • @SvW I have already edit the question could you please take a look – amani Mar 28 '14 at 12:50
  • try running `mysqld` or `mysqld_safe` directly to bypass init scripts – LinuxDevOps Mar 28 '14 at 12:53
  • @LinuxDevOps thx it works you could post your comment as an answer so I kan mark it as resolved :) – amani Mar 28 '14 at 13:13
  • Even if the disk is not full, it might be having too many files or folders. can you show your `df -h` and `df -i` – Sverre Mar 28 '14 at 11:29
  • one directory is 10% the other is 17% Im sure this not the problem. – amani Mar 28 '14 at 11:33
  • sure, glad I could help. Ideally you want to look at what the problem in the init script was/is. – LinuxDevOps Mar 28 '14 at 13:19
  • @SvW your right my system was attacked in last two weeks and it was compromised but I have already (thought) saved the problem.What do you recommend in oder to fix this I mean to protect the system. Have I to install the debian new version ? – amani Mar 28 '14 at 13:20
  • there is good advice at http://serverfault.com/questions/218005/how-do-i-deal-with-a-compromised-server but in a nutshell yes, if your system was compromised at that level you want a clean install and then move your data. – LinuxDevOps Mar 28 '14 at 13:22
  • Thx I have already took a look at this post since 2 weeks. I just want to add a comment according to the question, `service mysql status` shows that the service is running BUT always the same annoying mysterious error tail: `tail: invalid option -- n Try tail --help for more information. /usr/bin/mysqladmin Ver 8.41 Distrib 5.0.51a, for debian-linux-gnu on x86_64 Copyright (C) 2000-2006 MySQL AB This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license` – amani Mar 28 '14 at 13:33
  • in a compromised server you can't trust anything, binaries (like tail) or init scripts are cahnged and don't work properly and hence the weird messages – LinuxDevOps Mar 28 '14 at 14:50
  • have I to upgrade the system to Wheezy 7? If yes, have I to update the php version `php -v` `PHP 5.2.6`... I know that the version have to be updated too but right now I have to not update it so the question is **would this php version work with the Debian Wheezy?** – amani Mar 28 '14 at 15:00
  • you don't have to upgrade to the latest distro version although if possible it would be a good idea. check the php version in Wheezy/whatever and the changes in php to see if they are compatible with your code, situation too broad to have a short answer, better to just try in a new server – LinuxDevOps Mar 28 '14 at 19:37

1 Answers1

1

Looks like a problem in the initialization scripts, temporarily you can try running mysqld or mysqld_safe to bypass them.

LinuxDevOps
  • 1,754
  • 9
  • 14
  • Check your my.cnf to see what start options you have defined. Sounds like you've got a hosed init script. – TheFiddlerWins Mar 28 '14 at 14:41
  • By the way despite that the solution worked but the service sttoped once again by it self and it refuses to be started :( – amani Mar 28 '14 at 20:46
  • @TheFiddlerWins it mysql start displays ERROR 2002 C'ant connect to local Mysql server through soket /var/run/mysqld/mysqld.sock (2).. and in deed this file is not existing under this path – amani Mar 28 '14 at 20:49
  • with find command I figure out there is no such a file mysqld.sock or mysql.sock in all the server directories..How can I fix that? – amani Mar 28 '14 at 21:57