NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
vesper76
Dec 07, 2009Aspirant
Somehow broke logger, thereby breaking everything
For background on how I somehow got to this point:
viewtopic.php?f=22&t=36105&start=0
I'm moving to this forum, because it's essentially a different question than I started with.
The short version: My ReadyNAS Pro was working fine. Then I tried to update Squeezebox Server. Now I can't start Squeezebox Server, can't start Mysql, and can't do anything via apt-get. Plus probably other stuff.
The problem seems to be that BusyBox's 'logger' command doesn't accept the -i option, which the normal 'logger' command does accept. And /etc/init.d/mysql expects to use logger -i. As do apt-get postinstall scripts. And probably a lot of other things. So they all fail.
Does anyone know how this might have happened to me? And how do I un-frak myself?
Thanks in advance.
Adam
viewtopic.php?f=22&t=36105&start=0
I'm moving to this forum, because it's essentially a different question than I started with.
The short version: My ReadyNAS Pro was working fine. Then I tried to update Squeezebox Server. Now I can't start Squeezebox Server, can't start Mysql, and can't do anything via apt-get. Plus probably other stuff.
The problem seems to be that BusyBox's 'logger' command doesn't accept the -i option, which the normal 'logger' command does accept. And /etc/init.d/mysql expects to use logger -i. As do apt-get postinstall scripts. And probably a lot of other things. So they all fail.
Does anyone know how this might have happened to me? And how do I un-frak myself?
Thanks in advance.
Adam
39 Replies
Replies have been turned off for this discussion
- bsilvaAspirantHi Peter
A symlink is not a real file, it's a reference for another file. I am sure google can find you some very nice and better explanations about them ,o)
In your PM you mentioned "weird code" when you did "vi logger".
It looks like the symlink was not properly removed. Did you get a prompt "rm: remove symbolic link `logger'?" and answered "y" to it?
that would mean you may have edited busybox, and that's bad news (busybox is the binary for some very important commands).
You should get a "logger" [New File] prompt on the bottom of the vi screen (instead of "logger" x lines, x characters and loads of stuff, starting with ^?ELF -> meaning you are editing a binary executable; <ESC> :q! will get you out of vi without saving)
can you try running to make sure you did not mess with it:
busybox --list
you should get a list of apps that your busybox supports, including logger and vi. - PeterH2AspirantThanks Dwarf & bsilva for the fast replies! Sorry for this late reply, I wasn't home for the last two days.
@Dwarf, I'm going to try out your logger in a few minutes.
@bsilva, I indeed saw a compiled file, but I first removed it, and when I then opened "logger" with Vi, it created a new empty file [so that was oke, I forgot to remove it in the e-mail - but did remove it in the post on this forum] - now your script is in the logger
I do get logger and vi in the list when I enter: busybox --list, so that's a good thing, in the symlink logger-file is now the script you posted on the previous page.
But when I type: /etc/init.d/mysql start // I still end up with "Starting MySQL database server: mysqld ..... failed!"
update:
I tried the logger that Dwarf sent me - and did apt-get update and apt-get upgrade. Now I see two errors:
First with the update:
dpkg: serious warning: files list file for package `noflushd' missing, assuming package has no files currently installed
I remember deleting some flushd files, because some people wrote that on a forum as a solution to correctly install php... not nice I guess..?
To reinstall it, I did: apt-get remove noflushd and then apt-get install noflushd
With installing noflushd, I see: "No default timeout set. Aborting"
I get the advise to correct this by running: dpkg-reconfigure noflushd
This gives in the end the message: noflushd is broken or not fully installed
Via Google I do find people with this same error, but they don't seem to be able to solve it...
Well, back to mysql.
It still gives the same error ["Starting MySQL database server: mysqld ..... failed!"], after using the logger of Dwarf, but now with another error in syslog!
"0 processes alive and 'usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in"
"Could not open required defaults file: /etc/mysql/debian.cnf"
"Fatal error in defauls handling. Program aborted"
Checking if the file debian.cnf exists, and found that this file does not exists on my box. So that is probably the problem now, and the noflushd thing, don't know if that is a big problem? (my disks will now spin more than necessary?)
Searching Google for the debian.cnf error, also did not give something useful, any ideas on how to solve this?
Thanks for all the help so far, and if you're still in the mood for helping, it would be great. - Dwarf1AspirantHi Peter,
Normally, when you run apt-get to install mysql, it should install a debian.cnf in the directory "/etc/mysql"
Maybe this file is present but installed with another name like "debian.cnf.dpkg" or "debian.cnf.dist" so you have to copy and rename it ?
Can you verify this directory ?
Otherwise, you could check the startup script of mysql to find out where mysql searches the file. Open the file "/etc/init.d/mysql" with vi editor and try to find lines that look like these ones
SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
CONF=/etc/mysql/my.cnf
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
If you want, I can send you my "debian.cnf" file ... to help you to start mysql database :)
@++
Dwarf - PeterH2AspirantHi Dwarf! Thanks you're still out there! I can confirm the presence of the /etc/mysql folder, it contains the file my.cnf - (looks like mysql config file)
Further, I see the lines you wrote in the /etc/init.d/mysql file. But I do lack the debian.cnf file, so it would be great if you can send it to me.
Regards,
Peter - PeterH2AspirantWell, I found a quite rigorous solution fyi. I have set the NAS back to factory default (frontview -> update -> factory default).
Then I did the following:
1. Install php 5.3.8 via the addon (http://readynasxtras.com/readynas-x86-add-ons/php-53-x86)
2. Install mysqlon addon from super-poussin (http://www.readynas.com/forum/viewtopic.php?f=48&t=22853)
The mysqlon addon needs to be installed, because mysql is not running by default
Finally, I have no problems anymore with noflushd (due to the factory reset) and also php 5.3.8 is working and mysql is working! nice right :-)
Now only problem is Apache. I created a share via Frontview called "www"
However, no matter what I write in the httpd.conf [config file of apache] I cannot open: http://192.168.1.101/site.com/
403 Forbidden: You don't have permission to access /site.com/ on this server.
If I go to: http://192.168.1.101/www/site.com/
I only get 404 not found
This is what I have added to my httpd.conf file:
Alias /site.com /www/site.com
<Directory /www/site.com> ## also tried <Directory /site.com>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
[then restarting apache]
When going to: http://192.168.1.101/site.com/
I get this error in Apache errorlog:
"Symbolic link not allowed or link target not accessible: /www"
Of course I have Googled this error as well, and tried it with /c/www/ and with putting +FollowSymLinks in my .htaccess file, and also tried virtual host, but none of this worked.
Any ideas on this?
- Peter - PeterH2Aspirantke - seems to work now.
Enabled /www folder as website in Frontview (see this link: https://www.readynas.com/?p=135)
Then, the Frontview script has added this to the /etc/frontview/apache/Shares.conf
Alias "/www" "/c/www"
<Location "/www">
Options Indexes
Order allow,deny
Allow from all
Require valid-user
Include /etc/frontview/apache/Auth.conf
AuthName "My Shares"
</Location>
Well, then its simple, just add as many locations as you want, in my case site.com
Alias "/site.com" "/c/www/site.com"
<Location "/site.com">
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Location>
Haha, and now it finally works! :-)
Well, no I see the PHP-errors in the apache log, not in the browser yet, but will figure that out later I guess :-)
Enjoy this solution, if you have this same problem! Host multiple websites on your NAS, enjoy :-)
10 minutes later:
I restarted my NAS, and then it did not seem to work anymore. What happened, f*cking apache or readynas, or whoever did it, recreates the /etc/frontview/apache/Shares.conf.
So you have to add your configuration everytime you reboot. If anybody has a fix for this, please let me know (via forum or PM)
update 2 - [2011-12-24]
I also solved the last two things.
For enabling the errors of php:
Open: /etc/php5/apache2/php.ini
Set: display_errors = On
For having the location always working also after reboot of your NAS:
Don't add the location to your Shares.conf, but to /etc/frontview/apache/httpd.conf
Alias "/site.com" "/c/www/site.com"
<Location "/site.com">
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Location>
Special thanks to Dwarf and bsilva for their great help! - gattungAspirantHello, somehow my logger got broken as well. I am trying to setup mysql database for XBMC but it won't start.
Is the fixed logger still available anywhere?
Thanks! - m4pp1Aspirantto add, should this help other noobs like me :D ...
i've just had the exact same problem (logger giving invalid option -i when trying to run mysql, also broke my xbmc)
this seemed to happen after upgrading squeezecenter (i've prolly apt-get udpated at some point or other too, if thats' relevant and have certainly had a crack at tinkering installing kernel headers)
i've similarly tracked it down to busybox not liking the options when run as 'logger', when i googled the error i also hit this thread:
http://readynasxtras.com/forum/viewtopic.php?f=10&t=193
which suggests installing the MYSQLON addon - this fixed it for me (possibly i ran this years ago to get mysql at all, i forget).
whatever this does (plugins seem a bit of a black box, i've had my rar and now sql broken by them), this fixes the problem and running logger now immediately starts taking logging from stdin :D
what surprised me most is that the version output and build date from busybox were the same running before and after this magical addon :S
</ramble> - doktornAspirantHi everybody! I'm new to this forum.
I've been trying to get a XBMC shared MySQL setup for a while on my Ultra but has ended up with the same issues as stated above.Evelina:~# /etc/init.d/mysql start
Starting MySQL database server: mysqld . . . . . . . . . . . . . .logger: invalid option -- i
BusyBox v1.18.4 (2011-03-28 19:08:01 PDT) multi-call binary.
Usage: logger [OPTIONS] [MESSAGE]
Write MESSAGE (or stdin) to syslog
Options:
-s Log to stderr as well as the system log
-t TAG Log using the specified tag (defaults to user name)
-p PRIO Priority (numeric or facility.level pair)
failed!
I have installed the RAIDiator 4.2.24 but has not been tinkering with the NAS since I tried the last time and broke everything, and reinstalled with new HDD:s (different story).
So today I had time over to try and fix this I thought. So far I have tried to:
start mysql - and failed.
created the "ignore logger -i command" tip from bsilva - and failed.
installed the PRO-MysqlOn_1.0 package from super-poussin - and failed. (http://www.readynas.com/forum/viewtopic.php?f=48&t=22853)
I don't belive that installing the PHPMyAdmin will magically solve the underlying issue with MySQL on my ReadyNas. Please help... What must I do?
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!