[systemd-devel] nfs dependency in mysqld.service (best option)?

Gary Artim gartim at gmail.com
Wed Mar 20 10:07:00 PDT 2013


added:
# cat  /etc/systemd/system/mysqld.service
### "/etc/systemd/system/mysqld.service" containing:
.include /lib/systemd/system/mysqld.service
[Unit]
	Description=MySQL database server
	After=syslog.target
	After=network.target
	RequiresMountsFor=/my
ran:
systemctl daemon-reload
systemctl stop mysqld
systemctl start mysqld
systemctl show mysqld
got:
..
RequiresMountsFor=/my
..
yeah! now i need to reboot this weekend and see it work on a boot. thanks!

On Wed, Mar 20, 2013 at 8:02 AM, Gary Artim <gartim at gmail.com> wrote:
> very nice! will try. systemd is something!
>
> On Wed, Mar 20, 2013 at 8:00 AM, Thomas Bächler <thomas at archlinux.org> wrote:
>> Am 19.03.2013 23:13, schrieb Gary Artim:
>>> Thinking I should modify to add a "After=" for nfs.target, any one
>>> think this is the wrong approach or alternate options, I'd do
>>> something like:
>>
>> Sufficiently recent systemd versions have the 'RequiresMountsFor='
>> option to deal with this, see 'man systemd.unit' for details.
>>
>> In short, RequiresMountsFor=/path/to/your/databases adds the correct
>> mount units as dependencies, so mysqld.service not not started before
>> the /path/to/your/databases is accessible.
>>
>>


More information about the systemd-devel mailing list