[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/rc.local and systemd



On Sun 24 Aug 2014 at 11:45:40 -0400, Stephen Powell wrote:

> I just thought I'd pass along something that I recently discovered.
> When using sysvinit as the init system, if the file /etc/rc.local
> exists and is executable, it will be invoked at the tail end of the
> boot process.  But under systemd, this file is not executed during
> boot.  Not by default anyway.  Here is how I enabled it.  (The
> following commands are executed as root.)

>From /lib/systemd/system/rc.local.service (a symlink to
rc-local.service):

  # This unit gets pulled automatically into multi-user.target by
  # systemd-rc-local-generator if /etc/rc.local is executable.

Works for me.

> cd /lib/systemd/system/multi-user.target.wants
> ln -s ../rc-local.service rc-local.service
> 
> Now shutdown and reboot.  /etc/rc.local will get executed this time.
> If this is the "wrong" way to do it, or someone knows a better way,
> please let me know.

  systemctl restart rc-local.service


Reply to: