Ubuntu :: Adding Program To Run Before MySQL Shuts Down?
Mar 2, 2011
I'm interested in finding out, specifically, what causes daemon's to be shutdown when I shutdown Ubuntu? I'm use Ubuntu which is why I'm posting here, but I suppose this knowledge could apply to other Disto's too. Perhaps I'm better off to explain with an example:
I wrote a C++ that queries a Mysql database. I want it to run every time the computer is shutdown. I've verified the program works fine, and I've verified that I can run a program on shutdown of the computer by putting it in /etc/rc0.d. The problem is that by the time rc0.d runs my program, mysql has already been shutoff, and it can't connect.
So what I'm wondering is, is there a script or something at a higher level that goes around turning things like daemons as the System shutdowns, but before any of the scripts in rc0.d are run? (It doesn't look like anything in here is shutting down mysql). Something that actually calls mysql shutdown? How I can add my program to be run before mysql shuts down.
Otherwise, I might end up having to get the source code compile by own /sbin/shutdown and tweak it from there. Granted I might end up doing this anyway because there's more stuff I want to customize during shutdown (e.g. abort it under certain conditions), but I'm hoping not to go that far just yet.
View 2 Replies
ADVERTISEMENT
Aug 27, 2010
I want to setup my MySQL database and have MySQL up and running. I sill look for a good editor to add and configure my tables, it appears that MySQL Administrator is the only GUI client available.
But when I try to add a foreign key to one of my tables, there appears to be a problem. Both of my tables are InnoDB and both have a primary key.
-First I choose the tab "Foreign Keys" on my CLIENT table.
-Then I press the green + sign to add a foreign key, it is default named new_fk_constraint.
-I choose my table USER in the Refer.Table dropdownbox
-And then I should be able to match the FK field and the PK field in the box on the right... but this box is empty. Double clicking shows nothing. I only can drag the user_id of the USER table to it, but have no option to select the foreign column.
What the hell is wrong here??? This client is years old and should be really REALLY working IMHO! I was told by a friend that there is no good client available and therefore he is using some Windows program for this...
View 3 Replies
View Related
Sep 21, 2010
I have the following mysql query which works great.
Code:
SELECT msg FROM `logs` WHERE ((`host` = 'aaa.bbb.ccc.ddd') OR (`host` = 'aaa.bbb.ccc.ddd')) AND `msg` REGEXP CONVERT( _utf8 'physical addresses' USING latin1 ) COLLATE latin1_swedish_ci
I need to refine this query so that I can query the last # hours using the `datetime` field in the database. I have researched the DATE_SUB function and can query for example the last 1 hour like this:
[Code]....
View 10 Replies
View Related
Apr 19, 2011
I have cpanel running and working with mysql. I need to add ODBC so I can get server side action script to connect to mysql also. Will adding ODBC affect anything else? I don't want to affect the way anything else connects?
View 1 Replies
View Related
Feb 1, 2011
I am trying to install Koha on centos5.5. Afte installing myqsl it starts normally. But when i add following lines into my.cnf and trying to restart mysql again it says that restart is failed.
here is the lines that i add into [mysqld] section
default-character-set = utf8
character-set-server = utf8
skip-character-set-client-handshake
View 2 Replies
View Related
Oct 15, 2010
I have just completed a clean install of Ubuntu 10.10 on my Acer Aspire Netbook. The first program I installed was WINE and then I installed "Spotify for Windows". All works well, but I need to start it by opening a terminal and typing - Wine "C:Program FilesSpotifySpotify.exe" which is a little cumbersome.
I want to add a shortcut to the launcher but I cannot find a way to do this. I have found a "Main Menu" option in Applications, but the options and items in there don't seem to correspond to the launcher in any way.
Is there a way of adding something to the launcher or to get the main menu to display so I can customize it from the Main Menu utility.
View 9 Replies
View Related
Jul 14, 2009
I am trying to modify the source code of a C application (quagga) in order to insert data into a mysql table. I have added 2 new source files to the source (neto_mysql, neto_trend) which in turn use mysql.h. I have also modified the Makefile.am file to include the /usr/include/mysql directory.
When trying to compile, i get the following error. What am I missing? I have minimal experience with formal C applications like this. I feel like I may also have to include the mysql.h file in the libbgp? I dont understand why it cant find the mysql functions...
Code:
if gcc -DHAVE_CONFIG_H -DSYSCONFDIR="/usr/local/etc/" -I. -I. -I.. -I.. -I.. -I../lib -I/usr/include/mysql/ -fPIE -Os -fno-omit-frame-pointer -g -std=gnu99 -Wall -Wsign-compare -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes
[code]....
View 12 Replies
View Related
May 13, 2010
I would like to install a program called VariCAD. I downloaded the install file (full file name: varicad2010-en_2.06_amd64.deb) but was wondering if one couldn't somehow do this via the repository, kind of like I did for my nvidia drivers? Is it possible?
View 6 Replies
View Related
Mar 27, 2010
is it possible to do so? I mean, I want every user to be able to run '/bin/x' for example, as root without entering a password. I know the security risks, but I'm trying this in a risk-free environment which security does not matter very much.
View 2 Replies
View Related
Nov 16, 2010
I just have a quick question. I was following a Snort setup guide and it told me to do apt-get install snort-mysql. I just wanted to understand the functionality of such a command where you specify a program and then do a -mysql (snort-mysql). Does this configure an SQL database for that specific application or what?
View 2 Replies
View Related
Mar 28, 2011
Im trying to write a program that interacts with MySql in C . Im using slackware 13.1 64 bit and Ive installed MySql , getting help from this page : [URL] .
This is the program I have ( I know they arent any vars here , i just thought it wasnt necessary )
Code:
#include <stdio.h>
#include <mysql/my_global.h>
#include <mysql/my_sys.h>
#include <mysql/mysql.h>
[Code]....
This program is from the MySql website ( a tutorial they have up there ). When I run this program I get hundreds of lines of errors , nothing related to my program , but the headers, indicating that there are syntax errors and all kinds of other problems in them.
View 8 Replies
View Related
Sep 5, 2010
I'm trying to write a simple program c++ to connect to Mysql database based in my 127.0.0.1 server:
int main (void) {
cout << "33[2J" << "33[0;0f";
MYSQL mysql;
MYSQL *conn;
[code]....
View 2 Replies
View Related
Jun 7, 2011
I think this goes here, but I'm not sure. I decided that XAMPP had been troublesome enough. MySQL never worked. So I decided to instal the LAMP stack offered by YaST. I went about installing it thinking that it would all work. But it seems that I was wrong. So I try to start mysql, and here's what I get:
Code:
the-matrix:~ # mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) or
Code:
the-matrix:~ # rcmysql start
Starting service MySQL warning: /var/mysql/mysql.sock didn't appear within 30 seconds
chmod: cannot access `/var/run/mysql/mysqld.pid': No such file or directory
[Code]...
View 6 Replies
View Related
Jun 2, 2010
i am using liferay5.2(mysql included in the download pack) on fedora. while liferay is working fine but i cannot connect to mysql.i am getting the error
[
[root@localhost ~]# ln -s /var/lib/mysql/mysql.sock /tmp
[root@localhost ~]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
[code]....
i didnt find the mysql.sock file in the location /var/lib/mysql/mysql.sock. i cannot find the portal-ext.properties file also to make intial settings.
View 9 Replies
View Related
Jan 20, 2010
I've installed VMware server 2.x on my windows XP SP2 and installed Ubuntu 9.10 on the VMWare. I have noticed several times that the ubuntu machines shuts it down (not sure the time pattern but it could be that it shuts down after a certain minutes idle). As a result of that, I always have to restart it.
I checked the event log viewer, it looks like there's always a segfault just before it shuts down. I've pasted the last few lines of event log below.
Jan 19 10:28:16 jfernandez-ubuntu kernel: [ 32.648005] mtrr: base(0xf0000000) is not aligned on a size(0x15a0000) boundary
Jan 19 10:28:21 jfernandez-ubuntu kernel: [ 37.748105] type=1503 audit(1263914901.917:2: operation="open" pid=1229 parent=1228 profile="/usr
[Code]....
View 1 Replies
View Related
May 24, 2010
I've been using Ubuntu on my desktop for a while and it worked like a charm. Three months ago, I decided to put a new cpu fan because the old one was gathering dust and I wanted to have lower cpu temps. I decided to buy an Scythe Kabuto, nd installed it with no problems. Windows XP works perfect, but the problems come when I try to start Ubuntu, both from a Live CD or from the HD. Ubuntu starts normally, but in a short period of time (2~15 minutes) the PC randomly shuts down. I've seen some errors when I restart and try to start Ubuntu again mentioning high CPU tempetatures. The fact is that the CPU temperature never reaches more than 65, so my guess is that there is some problems with the ACPI and temp reading.
View 5 Replies
View Related
Aug 4, 2010
Ubuntu shuts itself down and displays message that it is running low on graphics, giving me options to run in low graphics mode or to troubleshoot. I have been given the following advice but have no idea what to do:
You are using the open driver i915 as you are using an intel based video
chip.
Sounds like you need an xorg.conf file to define the display a little better as udev is not detecting. Here is a sample file you can start with: (Refers to a URL that led me to this forum)
You can ignore any sections and entrys regarding keyboards as udev is
pretty awesome at picking those up
View 9 Replies
View Related
Jan 28, 2010
I just had my laptop in the shop for a month or so now (through Staples warrenty) I sent it in because my LCD monitor wasn't lighting up after a bit of use.
Got it back and they said my issue could not be replicated, so they just cleaned it and such and gave it back. Well so far it's been going pretty good, monitor stays on except when i turn on Heroes of Newerth.
What kind of problem is this and is it easily fixable?
View 2 Replies
View Related
May 13, 2010
When running ubuntu 9.1 on a toshiba a105 s4384 it randomly shuts down without warning. At the time of each i am running one or more of the following: Firefox(newest), Monodevelop(2.2), and pidgn for linux.
View 7 Replies
View Related
May 20, 2010
How to control at what temperature the fan comes on and shuts off. I am running Jaunty on a Compaq 610 laptop.
View 4 Replies
View Related
May 28, 2010
I installed ubuntu 10 yesterday and I have a real frustrating problem. It shuts down for no reason at all, at first I thought it was because I was not using it (power management or maybe because of the screensaver) so configured it to never put it to sleep or shut down, and disabled the screensaver but it keeps happening. This is actually the second time I'm writing this post, because it suddenly shut down again while I was writing this before submitting it. I used to never have this problem before when I was using windows, so the problem must be something with Ubuntu.
Could it be something with my gfx driver? I tried configuring Fluxbox to use my second screen as an extended desktop but couldn't get it to work except with Gnome. If I do "fglrxinfo" I get a segmentation fault, so I messed that up but I'm okay with that because everything is working like I want it with Gnome. One weird thing I've noticed is that ubuntu once said (when booting) that it couldn't find /dev/null...? Should I just try a reinstall? I'm on a quad core with 2GB ram and an ATI HD 4870 2gb graphics card.
View 3 Replies
View Related
May 30, 2010
Ubuntu keeps shutting down my comp randomly for no reason at all. It doesn't even display any message, it just goes down without warning.
I'm sure it's not a heat issue. My computer never gets very hot and even when it does it still is very reliable.
Can someone please help me fix this? I'm very new to Ubuntu so i'm sorry if this question has already been answered somewhere else.
View 2 Replies
View Related
Jun 5, 2010
I've been using Ubuntu for about one year. Recently upgraded to 10.04. The PC tries to boot, comes to the "Booting from device hd..." screen and then shuts down. It shuts down or halts but doesn't power off. The CPU is still powered. This happens for about 2 in 4 boots. The recovery mode runs just fine. It says no damaged partitions. Only the 'booting from device' is the problem point.
View 1 Replies
View Related
Jun 9, 2010
So, recently I tried getting Ubuntu on my desktop. First, I got the CD, inserted it, and it seemed to boot fine to this orange screen, with a texture, and at the bottom what seemed to be a video roll and a man with his arms open. Right after that my system's monitor seemed to shut down, completely, and I was unable to turn it back on. I restarted my computer and went through the same process until I took out the CD. So then I tried installing it into Windows, but that didn't work either. It had the Ubuntu boot option, and I selected it where I was shown The installation is completing
5-4-3-2-1-0
With a counter, and when it went to 0 my screen shut down and my computer went into a weird half-off state.
View 9 Replies
View Related
Oct 3, 2010
After using Ubuntu 10.4 for months, my computer has started turning itself on without my pressing the on button. Sometimes it gets halfway through the boot process and shuts itself down. Sometimes it gets all the way to the desktop and a window pops up saying shutdown in 60 seconds however it never waits but shuts down immediately. Probably the second time this happened, I had time enough to get to the Power Manager and made sure it was set to 'never' power down. Currently the on/off cycling is happening so quickly I can't check the BIOS or grup. My only control is the master power switch on the back
View 2 Replies
View Related
Oct 13, 2010
I upgraded to 10.04 and it is sooooo annoying. The computer will just randomly shut off. Sometimes it will be 10 minutes after turning the computer on, sometimes 10 hours!
View 6 Replies
View Related
Oct 14, 2010
I have a strange problem; I did an upgrade to ubuntu 10.10 succesfully. But now sometimes when I activate something (anything from O-O to synaptic or whatever) the OS just shuts down .I don't get any fault messages or other stuff.
View 4 Replies
View Related
Feb 2, 2011
Sometimes, when I leave my Ubuntu's X Server on, I'll come back after several minutes and see that my machine is powered off. Sometimes this happens, sometimes it doesn't, but I don't think it's because of hardware failure rather than my lack of measurement.
It used to power off in terminal mode (CTRL+ALT+F1) but then I added this to ~/.bashrc and it went away:
Code:
if [ "${USER}" == "root" ]
then
export TMOUT = 3600
fi
Also, I checked my logs and I see this:
Code:
Feb 2 00:00:09 l1nux AptDaemon: INFO: Quiting due to inactivity
Feb 2 00:00:09 l1nux AptDaemon: INFO: Shutdown was requested
Since it's not a CRITICAL message, but an INFO, it seems like its a planned shutdown.
Does anyone know how I can turn this feature off?
View 3 Replies
View Related
May 29, 2011
For the past 3 days skype has been giving me problems for some reason. I start it, the sign in screen shows up and like 5 seconds later it closes, I check if the process is still running but it's not so it just shuts down. I've tried uninstalling it from synaptic package manager, then installing it again and it's still doing me this.
View 6 Replies
View Related
Jun 17, 2010
I have installed Mysql in Ubuntu 9, for the use of roundcube database.After installing iam getting the error like this
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
So because of this in the roundcube configuration its giving the error message that MYSQL is not installed. So Kindly give me a idea how to solve this.
View 1 Replies
View Related