Tag: restart
MySQLd timeout error when starting
by z3n on Dec.25, 2009, under Linux Happyness
Problem:
When starting mysqld i got the following error:
Timeout error occurred trying to start MySQL Daemon.
Solution:
After checking mysqld.log i found out that the tunning i did on my.cnf had some options that aren’t compatible with the mysqld version.
Restarting dead services using cron/bash
by z3n on Jun.11, 2009, under Coding, Linux Happyness
Problem:
Some services keep dieing and there’s nothing much you can do about it, since they don’t restart automatically.
Those services could be httpd/apache, mysqld, sshd, etc
Solution:
This little script will do the job:
pstree | grep httpd | wc -l | awk ‘{if ($1 == 0) system(“service httpd restart”) }’
in this example i’m checking if httpd (apache) is running.
broken down, pstree will list all your running processes,
grep httpd will search for “httpd” string on pstree,
wc -l will count the words from grep httpd, basically will return 0 or 1 if something was found,
and finally awk will check if wc -l is = 0 , meaning that the service / process in question is not running, then will perform the required action, on my example, service httpd restart which will restart apache.
You may also check it by port level as suggested by HTNet :
netstat -ln | grep “:80″ | wc -l | awk ‘{if ($1 == 0) system(“service httpd restart”) }’
You could build up a little .sh file and put it on crontab to check it every minute or whatever you like.
Restarting gnome-panel
by z3n on May.08, 2009, under Linux Happyness
Problem:
You followed the previous post and sucessfully installed Hardware monitor applet on your gnome, however it’s not showing. This is happening because gnome-panel didn’t updated it’s applets list, so you need to restart gnome-panel.
Solution:
There’s no cool way to do this, you need to kill the process, it will restart after that.
pkill -9 gnome-panel