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

Re: Trying to excute things on boot from /etc/rc.local



On Tuesday 01 October 2019 09:34:48 Greg Wooledge wrote:

> On Tue, Oct 01, 2019 at 09:28:05AM -0400, Gene Heskett wrote:
> > On Tuesday 01 October 2019 08:57:26 Greg Wooledge wrote:
> > > On Tue, Oct 01, 2019 at 12:58:22AM -0700, didier.gaumet@gmail.com
> >
> > wrote:
> > > > Is your system a Systemd one (by default in Debian), you have to
> > > > enable rc.local:
> > > > https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local
> > > >-wit h-systemd
> > >
> > > You don't have to enable the rc-local service in Debian.  It's
> > > already enabled.  You can verify this with systemctl status
> > > rc-local.
> > >
> > > All you have to do are two steps:
> > >
> > > 1) Make sure /etc/rc.local begins with a valid shebang.
> > > 2) Make sure /etc/rc.local has execute permissions.
> >
> > How long has this been true, Greg? I ask because thats the first
> > place I've tried to put things I needed running because it should be
> > last in the init sequence.  And I don't recall it ever working since
> > LCNC switched to wheezy from ubuntu 8 something. Perhaps this is
> > why?
>
> In wheezy-and-earlier, /etc/rc.local was supported by sysv-rc
> packages.
>
> In jessie-and-later, /etc/rc.local is supported by the
> rc-local.service in systemd.
>
> Systems *installed* at jessie or earlier also got a default
> /etc/rc.local file with a crapload of comments in it, a "#!/bin/sh -e"
> shebang which is definitely not what I would recommend, and an "exit
> 0" at the end, just to make sure newbies have multiple traps to fall
> in, like appending a command to the end of the file and then wondering
> why it doesn't run.

They can't read?  What a revoltin' development that is...  :)
>
> Systems installed at stretch or later do not have a default
> /etc/rc.local file, so one must be created by hand, following the two
> rules I gave.

This stretch machine does have an /etc/rc.local that follows those rules 
and the stuff I have in it now seems to be working which is perms and 
ownership changes to /dev/ttyUSB0 so that heyu can run.

It was installed by the iso based on stretch, that installs a realtime 
kernel, and LinuxCNC, dated the same date as the dvd respin I think. 
Maybe the guys doing the respin added it, IDK.  But the 4 active lines 
in it now, just work.  And thats something I don't have to remember to 
restart at reboot time.

Thanks for clarifying that, Greg.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: