View previous topic :: View next topic |
Author |
Message |
nelsonwcf Tux's lil' helper
Joined: 31 Oct 2012 Posts: 112
|
Posted: Tue Jan 02, 2018 10:33 pm Post subject: MariaDB not starting at boot time [Solved]: |
|
|
Hi,
I recently installed Owncloud with MariaDB in my bananapi but I noticed that after rebooting it, mysql service doesn't start, even after adding it to the rc script (rc-update add mysql default). After rebooted, I just go there and manually launch it and it starts normally, showing no errors. Shouldn't it autostart automatically? Am I doing something wrong here?
Also, /var/log/mysql has very basic information only. Is there any way to log the rc bootstrap?
Thank you,
Nelson
Last edited by nelsonwcf on Fri Jan 05, 2018 6:51 pm; edited 1 time in total |
|
Back to top |
|
|
nelsonwcf Tux's lil' helper
Joined: 31 Oct 2012 Posts: 112
|
Posted: Thu Jan 04, 2018 8:25 pm Post subject: |
|
|
Hi,
Let me improve the question so that I can get some help:
- Could the problem be that mysql is trying to start before autofs is started, since the database is located in a different partition? If so, any way for me to start autofs before mysql?
- A second problem is that I can't find a way to get logs on rc scripts. How can I make the rc script logs capture by the syslog?
- Can I make the rc services at boot iterative? I remember get something like this in a different distro so is something gentoo can easily do?
Thanks,
Nelson |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3131
|
Posted: Fri Jan 05, 2018 12:46 am Post subject: |
|
|
Openrc is iterative by default, you have to explicitly enable parallel boot if you want it.
3 tricks you can try:
put autofs in a lower runlevel than mariadb (e.g. mariadb in default, autofs in boot), so it will be started before.
edit madiadb's init config file (in /etc/conf.d/), add rc_need="autofs" or whatever that service is called, so openrc knows mariadb depends on another service and will start them in the correct order
Refresh dependency cache with rc-update --update |
|
Back to top |
|
|
nelsonwcf Tux's lil' helper
Joined: 31 Oct 2012 Posts: 112
|
Posted: Fri Jan 05, 2018 2:22 pm Post subject: |
|
|
Yay! Worked. The problem was indeed autofs being loaded after MariaDB.
In my case, the optimal solution was to go to the init script of mariaDB (mysql) and add the rc_need="autofs". This solved the issue. |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3131
|
Posted: Fri Jan 05, 2018 8:22 pm Post subject: |
|
|
Don't modify the init script itself, it will be overwriten on the first update without any warning.
Edit /etc/conf.d/mysql instead and put that variable there. These are considered configuration files, and - unlike executables under /etc/init.d - config files are protected.
Emerge will offer you a new version, but you have to explicitly opt-in for those changes to take effect, so you won't be caught off-guard.
Happy to help you |
|
Back to top |
|
|
|