Through YaST’s System Services I configured an application to start on boot. However, the application (mediatomb) is using mysql, so it should not be started before mysql. It is however, which means mediatomb fails to start.
How can I make sure mysql is started before mediatomb?
You should have a file /etc/rc.d/mediatomb with a section (at the top) starting with ### BEGIN INIT INFO and ending with ### END INIT INFO. In this file, add ‘mysql’ at the end of the ‘Should-Start’ and ‘Should-Stop’ lines. Look at the files /etc/rc.d/apache2 and /etc/rc.d/postfix if you have them. They start mysql as well.
>
> Through YaST’s System Services I configured an application to start on
> boot. However, the application (mediatomb) is using mysql, so it should
> not be started before mysql. It is however, which means mediatomb fails
> to start.
>
> How can I make sure mysql is started before mediatomb?
>
>
do you need mediatomb in runlevel 3? if not, have it start in RL 5 only;
mysql by default starts at RL 3.
You might want to setup you machine to not boot in parallel.
This will slow down your boot time but may save you some headaches if you really need service X to start before service Y.
To do this change the “RUN_PARALLEL” option to “no” in /etc/sysconfig/boot
On 2011-03-06 14:36, jthiatt08 wrote:
>
> You might want to setup you machine to not boot in parallel.
> This will slow down your boot time but may save you some headaches if
> you really need service X to start before service Y.
You do not need to set parallel to no to ensure a particular script runs
before or after another one. Sure, things get complicated, but they must work.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
Try running the FAM daemon and the CUPS daemon together.
The FAM daemon can bind to any port between 600-1024 (yes, I know that’s ridiculous) and the CUPS daemon binds to port 631.
I had CUPS set to start before FAM but every once in a while FAM would still bind to port 631 causing CUPS to fail.
Stopping the init scripts from starting in parallel resolved this issue. I know it’s an obscure issue but I hope explains my previous suggestion.
That’s the wrong fix. You should get FAM to avoid port 631 and in fact any ports that are reserved for other services. I had a similar issue with portmapper (I think) once. And it was random. Fortunately portmapper has an option to specify the port.
No, sorry, I did not create a Bugzilla about it. It was on SLES 10 and it didn’t happen all the time.
It was considered more of an annoyance than a bug and my coworkers and I worked around it.
We are now starting to use openSuse 11.3 and are able get rid of the need for FAM altogether.
I can send you the logs from the servers on which the FAM problem occurred if you are interested.
There was no line called Should-Start, but I took a look at the postfix script, and now I have this in /etc/rc.d/mediatomb:
### BEGIN INIT INFO
# Provides: mediatomb
# Required-Start: $local_fs $remote_fs $network
# Should-Start: mysql
# Required-Stop: $local_fs $remote_fs $network
# Should-Stop: mysql
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: MediaTomb daemon
# Description: This script starts and stops the mediatomb daemon
### END INIT INFO
I made mediatomb only start in RL 5 in System Services (mysql has 2,3,5 checked).
After trying both of these separately I still have this in /var/log/mediatomb:
ERROR: The connection to the MySQL database has failed: mysql_error (2002): "Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)"
Running /etc/init.d/mediatomb start manually after booting works fine.
>
> Code:
> --------------------
> ERROR: The connection to the MySQL database has failed: mysql_error (2002): “Can’t connect to local MySQL server through socket ‘/var/run/mysql/mysql.sock’ (2)”
> --------------------
IMO, mysql should be in Required-Start. Install with chkconfig. Verify by
checking the numbers.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)