Re: L-o-n-g delay for rc.local in systemd on Ubuntu.

2017-08-08 Thread Tom Buskey
If you put it in systemd, it won't hold up login.  I can often ssh into
systems before the whole boot finishes.  I don't remember if the login: on
the console was affected.

I did Solaris 10 until about 5 years ago.  They replaced SysV init with SMF
which did dependency checking, etc.  Crucially, they kept support SysV init
scripts and slowly converted from them to the SMF XML formats.  Your 3rd
party init scripts kept working.  Since my S99 scripts never broke, I never
had to convert them.  It also took Sun until ~ 10.3 to get them working
well.

Systemd doesn't care about backward compatibility so stuff will break.
Worse, some stuff, like rc.local has partial support (that they don't care
about) and it will usually work like the docs say.

I've hit issues with service vs systemctl.  Ex: service mysql start vs
systemctl start mysql.  Service might *always* exit with status 3
regardless of success/failure.  My shell scripts that depended on 0/not 0
had to be changed.

That said, I've found systemd easier than SMF, especially if you abandon
the old ways.


On Tue, Aug 8, 2017 at 12:11 PM, Jerry Feldman  wrote:

> +1 for me also. When things like this change, we must also change with it.
>
> On 08/08/2017 12:08 PM, Dan Garthwaite wrote:
>
> +1 Tom.   Not to detract in any way from his answer - he is spot on and
> everyone should learn systemd if they are using systemd.
>
> If it isn't a daemon and just something that's gotta be done once after a
> power outage I've used CRON's @REBOOT.  Especially for non-root users.
>
>
> ___
> gnhlug-discuss mailing 
> listgnhlug-discuss@mail.gnhlug.orghttp://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>
>
> --
> Jerry Feldman  
> Boston Linux and Unix http://www.blu.org
> PGP key id:B7F14F2F
> PGP Key fingerprint: D937 A424 4836 E052 2E1B  8DC6 24D7 000F B7F1 4F2F
>
>
> ___
> gnhlug-discuss mailing list
> gnhlug-discuss@mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>
>
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: L-o-n-g delay for rc.local in systemd on Ubuntu.

2017-08-08 Thread Jerry Feldman

+1 for me also. When things like this change, we must also change with it.

On 08/08/2017 12:08 PM, Dan Garthwaite wrote:
+1 Tom.   Not to detract in any way from his answer - he is spot on 
and everyone should learn systemd if they are using systemd.


If it isn't a daemon and just something that's gotta be done once 
after a power outage I've used CRON's @REBOOT. Especially for non-root 
users.



___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/



--
Jerry Feldman 
Boston Linux and Unix http://www.blu.org
PGP key id:B7F14F2F
PGP Key fingerprint: D937 A424 4836 E052 2E1B  8DC6 24D7 000F B7F1 4F2F

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: L-o-n-g delay for rc.local in systemd on Ubuntu.

2017-08-08 Thread Dan Garthwaite
+1 Tom.   Not to detract in any way from his answer - he is spot on and
everyone should learn systemd if they are using systemd.

If it isn't a daemon and just something that's gotta be done once after a
power outage I've used CRON's @REBOOT.  Especially for non-root users.
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: L-o-n-g delay for rc.local in systemd on Ubuntu.

2017-08-08 Thread Tom Buskey
If your system is using systemd, don't use rc.local.  rc.local is not
deterministic in systemd.  I've had to move everything out of rc.local and
learn systemd to get reliable starting.

I created something like this (run_on_boot.service)

[Unit]
Description=Run at startup
After=network.target network-online.target sshd.service

[Service]
Type=simple
WorkingDirectory=/tmp
ExecStart=/usr/local/bin/run_on_boot

[Install]
WantedBy=multi-user.target


Copy run_on_boot.service to /etc/systemd/system
systemctl enable run_on_boot

The above will run the file in ExecStart after the targets, etc on next
boot.  Systemd will do a topological sort on the dependencies to start
things in the right order and run in parallel if it can.

We used to throw things into rc.local or create a script, tack S99 on the
name and put it in /etc/rc3.d. The systemd group would eliminate rc.local
if they could, so it's barely supported.  It gets started at some random
time, not after everything else.

On Tue, Aug 8, 2017 at 10:28 AM, Ken D'Ambrosio  wrote:

> Hey, all.  I've got some stuff in my rc.local, and it takes *forever* to
> execute -- three+ minutes.  (Note that the machine -- a virtual one --
> is up in something like 20 seconds.)  I *need* this stuff, which is
> lightweight in the extreme, to execute much more quickly than that.
> Anyone have any ideas on how to make that happen?
>
> Thanks,
>
> -Ken
> ___
> gnhlug-discuss mailing list
> gnhlug-discuss@mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/