• Using rc.local

    From Doug Laidlaw@2:250/1 to All on Mon Nov 4 09:22:32 2019
    Running Mageia 7 with latest kernel and Xfce desktop.

    There was talk about overcoming the recent Cups problem by adding a
    command to rc.local. I decided to use the same method to keep my
    customized /etc/default/grub file. Commands in rc.local are run during bootup, after all the numbered "rc" files.

    rc.local used to be an empty entry in the rc.d series, but recently,
    some distros (including Mageia) have omitted it entirely, so I added
    one. It turned out not to be that easy.

    First off, I treated rc.local as a FILE, while all the other items are FOLDERS. That may be one reason why it didn't work, but there is always
    the statement "Be sure to make rc.local executable." Anyway, I simply
    deleted rc.local, assuming that it would put me back as before, but that
    made the bootup hang. Shorewall and the display manager couldn't start,
    and that was only the beginning. Apparently what I went back to, wasn't
    what I had before.

    Here is what I discovered.

    There is a systemd service, rc-local. On a default installation it can
    be queried, but initially, it has no .service files and can't run. There
    is a good tutorial on what the service does, and how to create those
    ..service files at

    https://www.linux-babe.com/linux-server/how-to-enable-etc-rc-local-with-systemd

    I haven't tried it. I don't need my new command every time, only for a
    new kernel. I will keep the command as an executable file I can run
    when required. I fixed my system with my usual first try, running the
    Mageia installer with the "update" option.

    Doug.

    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: Aioe.org NNTP Server (2:250/1@fidonet)
  • From Bit Twister@2:250/1 to All on Mon Nov 4 10:52:05 2019
    On Mon, 4 Nov 2019 20:22:32 +1100, Doug Laidlaw wrote:
    Running Mageia 7 with latest kernel and Xfce desktop.

    There was talk about overcoming the recent Cups problem by adding a
    command to rc.local. I decided to use the same method to keep my
    customized /etc/default/grub file.

    I do not understand that relation between /etc/default/grub and rc.local

    Commands in rc.local are run during
    bootup, after all the numbered "rc" files.

    rc.local used to be an empty entry in the rc.d series, but recently,
    some distros (including Mageia) have omitted it entirely, so I added
    one. It turned out not to be that easy.

    Hmmm, it is pretty easy.

    First off, I treated rc.local as a FILE,

    Which it should be.

    while all the other items are FOLDERS.

    Very true, those rc scripts are kept in folders, or have links in
    the folders to scripts.

    That may be one reason why it didn't work, but there is always
    the statement "Be sure to make rc.local executable."

    That is a good basic rule used to make it easy for the shell to run them
    as coded.


    Anyway, I simply
    deleted rc.local, assuming that it would put me back as before, but that
    made the bootup hang.

    Now that is odd. You do an install, there is no /etc/rc.d/rc.local and
    the system boots. You create one then delete it and now system does not
    boot. Not sure how that happens. At worst it should have been logged
    in the journal and the system would continue without it.

    Shorewall and the display manager couldn't start,
    and that was only the beginning.

    Intriguing that shorewall did not start since the rc.local has
    After=network.target
    which means rc.local will not start executing till after the network is up.


    Apparently what I went back to, wasn't
    what I had before.

    Still not following logically speaking. You install/boot, create rc.local
    don't like it, deleted it, and now system does not boot correctly.


    Here is what I discovered.

    There is a systemd service, rc-local. On a default installation it can
    be queried, but initially, it has no .service files and can't run.

    Not my experience. I see the service file, but as you have found out
    there is no /etc/rc.d/rc.local file which you would have to create,
    set executable, test, then run systemctl enable rc-local.service

    There
    is a good tutorial on what the service does, and how to create those
    .service files at


    https://www.linux-babe.com/linux-server/how-to-enable-etc-rc-local-with-systemd

    I can not resolve the site let alone the link.


    I haven't tried it. I don't need my new command every time, only for a
    new kernel.

    Hmmmm, guessing now the conversion is really about your script modify /etc/default/grub

    I suggest that you show us your modification(s). I would guess a new one
    line entry would make all this extra work go away.

    I will keep the command as an executable file I can run
    when required. I fixed my system with my usual first try, running the
    Mageia installer with the "update" option.

    Can only guess /etc/default/grub fixed, or update had a new kernel with
    caused a new grub.cfg to be generated.


    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Jim Beard@2:250/1 to All on Mon Nov 4 15:11:31 2019
    On Mon, 04 Nov 2019 04:52:05 -0600, Bit Twister wrote:

    On Mon, 4 Nov 2019 20:22:32 +1100, Doug Laidlaw wrote:

    There is a systemd service, rc-local. On a default installation it can
    be queried, but initially, it has no .service files and can't run.

    Not my experience. I see the service file, but as you have found out
    there is no /etc/rc.d/rc.local file which you would have to create,
    set executable, test, then run systemctl enable rc-local.service

    There is a good tutorial on what the service does, and how to create
    those .service files at

    https://www.linux-babe.com/linux-server/how-to-enable-etc-rc-local- with-systemd.

    I can not resolve the site let alone the link.

    There is a typo in the server name. Search for how-to-enable-etc-rc-local-with-systemd and you will find it.

    The tutorial mentions an alternative of using a @reboot line in crontab.
    I can find no documentation on my system man pages for such a line. Is
    it an Ubuntu/Kubuntu thing?

    Cheers!

    jim b.

    --
    UNIX is not user-unfriendly, it merely expects users to be computer-
    friendly.

    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Mon Nov 4 16:16:51 2019
    On 2019-11-04, Doug Laidlaw <laidlaws@hotkey.net.au> wrote:
    Running Mageia 7 with latest kernel and Xfce desktop.

    There was talk about overcoming the recent Cups problem by adding a
    command to rc.local. I decided to use the same method to keep my
    customized /etc/default/grub file. Commands in rc.local are run during bootup, after all the numbered "rc" files.

    rc.local used to be an empty entry in the rc.d series, but recently,
    some distros (including Mageia) have omitted it entirely, so I added
    one. It turned out not to be that easy.

    First off, I treated rc.local as a FILE, while all the other items are

    It is a file. And it needs to be executable. And if it does not exist,
    it is not run.

    FOLDERS. That may be one reason why it didn't work, but there is always
    the statement "Be sure to make rc.local executable." Anyway, I simply deleted rc.local, assuming that it would put me back as before, but that made the bootup hang. Shorewall and the display manager couldn't start,
    and that was only the beginning. Apparently what I went back to, wasn't what I had before.

    That is strange.


    Here is what I discovered.

    There is a systemd service, rc-local. On a default installation it can
    be queried, but initially, it has no .service files and can't run. There
    is a good tutorial on what the service does, and how to create those .service files at

    Yes, there is It starts running rc.local


    Here id the /lib/systemd/system/rc-local.service file (from Mga7)

    ----------------

    # SPDX-License-Identifier: LGPL-2.1+
    #
    # This file is part of systemd.
    #
    # systemd is free software; you can redistribute it and/or modify it
    # under the terms of the GNU Lesser General Public License as published by
    # the Free Software Foundation; either version 2.1 of the License, or
    # (at your option) any later version.

    # This unit gets pulled automatically into multi-user.target by
    # systemd-rc-local-generator if /etc/rc.d/rc.local is executable.
    [Unit]
    Description=/etc/rc.d/rc.local Compatibility Documentation=man:systemd-rc-local-generator(8) ConditionFileIsExecutable=/etc/rc.d/rc.local
    After=network.target

    [Service]
    Type=forking
    ExecStart=/etc/rc.d/rc.local start
    TimeoutSec=0
    RemainAfterExit=yes
    GuessMainPID=no
    ------------------------------------------------------------




    https://www.linux-babe.com/linux-server/how-to-enable-etc-rc-local-with-systemd

    I haven't tried it. I don't need my new command every time, only for a
    new kernel. I will keep the command as an executable file I can run
    when required. I fixed my system with my usual first try, running the Mageia installer with the "update" option.

    Doug.

    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Bit Twister@2:250/1 to All on Mon Nov 4 16:25:51 2019
    On Mon, 4 Nov 2019 15:11:31 -0000 (UTC), Jim Beard wrote:
    On Mon, 04 Nov 2019 04:52:05 -0600, Bit Twister wrote:

    On Mon, 4 Nov 2019 20:22:32 +1100, Doug Laidlaw wrote:

    https://www.linux-babe.com/linux-server/how-to-enable-etc-rc-local-
    with-systemd.

    I can not resolve the site let alone the link.

    There is a typo in the server name. Search for how-to-enable-etc-rc-local-with-systemd and you will find it.

    The tutorial mentions an alternative of using a @reboot line in crontab.
    I can find no documentation on my system man pages for such a line.

    Let alone the cron executable. :)
    $ type cron
    bash: type: cron: not found


    Is it an Ubuntu/Kubuntu thing?

    Yes.


    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Mon Nov 4 17:02:23 2019
    In alt.os.linux.mageia, you wrote:
    On Mon, 04 Nov 2019 04:52:05 -0600, Bit Twister wrote:

    On Mon, 4 Nov 2019 20:22:32 +1100, Doug Laidlaw wrote:

    There is a systemd service, rc-local. On a default installation it can
    be queried, but initially, it has no .service files and can't run.

    Not my experience. I see the service file, but as you have found out
    there is no /etc/rc.d/rc.local file which you would have to create,
    set executable, test, then run systemctl enable rc-local.service

    There is a good tutorial on what the service does, and how to create
    those .service files at

    https://www.linux-babe.com/linux-server/how-to-enable-etc-rc-local-
    with-systemd.

    I can not resolve the site let alone the link.

    There is a typo in the server name. Search for how-to-enable-etc-rc-local-with-systemd and you will find it.

    And would it have been harder to state that it should be linuxbabe
    rather than linux-babe?
    The original poster had already found that page. It is just the readers
    of his post who might have been confused, and who you are making more
    work for.

    Note that the advice in that post is pretty useless as far as I can see.
    You do not (certainly not on Mageia) need to alter /local/systemd/system/rc-local.service ( which does exist). All you have
    to do is to created an /etc/rc.d/rc.local file as a shell script )(ie
    first line is
    #!/bin/bash
    or
    #!/bin/sh
    )
    and make it executable.
    No need to mess with systemd.

    Note that on Mageia it is /etc/rc.d/rc.local that is needed, NOT
    /etc/rc.local



    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Doug Laidlaw@2:250/1 to All on Mon Nov 4 20:31:11 2019
    On 4/11/19 9:52 pm, Bit Twister wrote:
    On Mon, 4 Nov 2019 20:22:32 +1100, Doug Laidlaw wrote:
    Running Mageia 7 with latest kernel and Xfce desktop.

    There was talk about overcoming the recent Cups problem by adding a
    command to rc.local. I decided to use the same method to keep my
    customized /etc/default/grub file.

    I do not understand that relation between /etc/default/grub and rc.local

    Keep reading. I find the "corner" problem with Grub2 an ongoing
    nuisance. I have /etc/default/grub configured to make my box boot into
    Mageia by default, then the next kernel upgrade restores it to "saved." rc.local seemed like a good place to put a command to keep my config.
    Anyway, this thread is about using rc.local, whatever the reason.
    Commands in rc.local are run during
    bootup, after all the numbered "rc" files.

    rc.local used to be an empty entry in the rc.d series, but recently,
    some distros (including Mageia) have omitted it entirely, so I added
    one. It turned out not to be that easy.

    Hmmm, it is pretty easy.

    Adding it was easy. Removing it when it didn't work, was not.
    First off, I treated rc.local as a FILE,

    Which it should be.

    while all the other items are FOLDERS.

    Very true, those rc scripts are kept in folders, or have links in
    the folders to scripts.

    That may be one reason why it didn't work, but there is always
    the statement "Be sure to make rc.local executable."

    That is a good basic rule used to make it easy for the shell to run them
    as coded.


    Anyway, I simply
    deleted rc.local, assuming that it would put me back as before, but that
    made the bootup hang.

    Now that is odd. You do an install, there is no /etc/rc.d/rc.local and
    the system boots. You create one then delete it and now system does not
    boot. Not sure how that happens. At worst it should have been logged
    in the journal and the system would continue without it.

    No, the system hung when it couldn't start the rc-local service. The
    command in the journal had no timeout, i.e. it would stay at that point forever.

    Shorewall and the display manager couldn't start,
    and that was only the beginning.

    Intriguing that shorewall did not start since the rc.local has
    After=network.target
    which means rc.local will not start executing till after the network is up.

    I think that you mean that shorewall's .service file has that line.
    Maybe the network hadn't started, so shorewall wouldn't.

    Apparently what I went back to, wasn't
    what I had before.

    Still not following logically speaking. You install/boot, create rc.local don't like it, deleted it, and now system does not boot correctly.

    Which I found surprising. All I did was delete a file, a script.

    Here is what I discovered.

    There is a systemd service, rc-local. On a default installation it can
    be queried, but initially, it has no .service files and can't run.

    Not my experience. I see the service file, but as you have found out
    there is no /etc/rc.d/rc.local file which you would have to create,
    set executable, test, then run systemctl enable rc-local.service

    There
    is a good tutorial on what the service does, and how to create those
    .service files at

    https://www.linux-babe.com/linux-server/how-to-enable-etc-rc-local-with-systemd

    I can not resolve the site let alone the link.

    A typo. I copied it from my tablet. It should be: https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd
    #All on one line. Two differences.


    I haven't tried it. I don't need my new command every time, only for a
    new kernel.

    Hmmmm, guessing now the conversion is really about your script modify /etc/default/grub

    Don't guess what it is about. I tried to keep out all peripheral
    information.

    I suggest that you show us your modification(s). I would guess a new one
    line entry would make all this extra work go away.

    Maybe. This post isn't a request for help. It is meant to be rather
    like a HOWTO, for those who experience a similar problem..

    I will keep the command as an executable file I can run
    when required. I fixed my system with my usual first try, running the
    Mageia installer with the "update" option.

    Can only guess /etc/default/grub fixed, or update had a new kernel with caused a new grub.cfg to be generated.

    Isn't that what I said?

    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: Aioe.org NNTP Server (2:250/1@fidonet)
  • From Doug Laidlaw@2:250/1 to All on Mon Nov 4 20:35:17 2019
    On 5/11/19 2:11 am, Jim Beard wrote:
    On Mon, 04 Nov 2019 04:52:05 -0600, Bit Twister wrote:

    On Mon, 4 Nov 2019 20:22:32 +1100, Doug Laidlaw wrote:

    There is a systemd service, rc-local. On a default installation it can
    be queried, but initially, it has no .service files and can't run.

    Not my experience. I see the service file, but as you have found out
    there is no /etc/rc.d/rc.local file which you would have to create,
    set executable, test, then run systemctl enable rc-local.service

    There is a good tutorial on what the service does, and how to create
    those .service files at

    https://www.linux-babe.com/linux-server/how-to-enable-etc-rc-local-
    with-systemd.

    I can not resolve the site let alone the link.

    There is a typo in the server name. Search for how-to-enable-etc-rc-local-with-systemd and you will find it.

    The tutorial mentions an alternative of using a @reboot line in crontab.
    I can find no documentation on my system man pages for such a line. Is
    it an Ubuntu/Kubuntu thing?

    Cheers!

    jim b.

    The site is a new one to me. It is not meant to be distro specific. See

    https://unix.stackexchange.com/questions/109804/crontabs-reboot-only-works-for- root

    That user had CentOS.

    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: Aioe.org NNTP Server (2:250/1@fidonet)
  • From David W. Hodgins@2:250/1 to All on Mon Nov 4 20:07:22 2019
    On Mon, 04 Nov 2019 10:11:31 -0500, Jim Beard <jim.beard@verizon.net> wrote:

    The tutorial mentions an alternative of using a @reboot line in crontab.
    I can find no documentation on my system man pages for such a line. Is
    it an Ubuntu/Kubuntu thing?

    No. See "man 5 crontab".

    Regards, Dave Hodgins

    --
    Change dwhodgins@nomail.afraid.org to davidwhodgins@teksavvy.com for
    email replies.

    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Mon Nov 4 23:15:43 2019
    On 2019-11-04, Doug Laidlaw <laidlaws@hotkey.net.au> wrote:
    On 4/11/19 9:52 pm, Bit Twister wrote:
    ....

    Now that is odd. You do an install, there is no /etc/rc.d/rc.local and
    the system boots. You create one then delete it and now system does not
    boot. Not sure how that happens. At worst it should have been logged
    in the journal and the system would continue without it.

    No, the system hung when it couldn't start the rc-local service. The command in the journal had no timeout, i.e. it would stay at that point forever.

    Are you using the Mageia systemd file? (rc-local.service) because it
    explicitly checks where or not rc.local exists and is executable. If
    not, it quits as I understand it.
    So something is weird in your system. What is the content of /etc/systemd/system/rc-local.service. And do NOT use that Ubuntu version
    you gave the link to.

    .....

    There
    is a good tutorial on what the service does, and how to create those
    .service files at

    It is a bad tutorial for mageia.

    ....

    https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd

    .......


    Hmmmm, guessing now the conversion is really about your script modify
    /etc/default/grub

    Don't guess what it is about. I tried to keep out all peripheral information.

    You do not understand what is happening. Why should you trust your
    judgement as to what is peripheral?
    And if you do not give the information, what can anyone do but guess?



    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From William Unruh@2:250/1 to All on Mon Nov 4 23:21:24 2019
    On 2019-11-04, Doug Laidlaw <laidlaws@hotkey.net.au> wrote:
    On 5/11/19 2:11 am, Jim Beard wrote:
    On Mon, 04 Nov 2019 04:52:05 -0600, Bit Twister wrote:

    On Mon, 4 Nov 2019 20:22:32 +1100, Doug Laidlaw wrote:

    There is a systemd service, rc-local. On a default installation it can >>>> be queried, but initially, it has no .service files and can't run.

    Not my experience. I see the service file, but as you have found out
    there is no /etc/rc.d/rc.local file which you would have to create,
    set executable, test, then run systemctl enable rc-local.service

    There is a good tutorial on what the service does, and how to create
    those .service files at

    https://www.linux-babe.com/linux-server/how-to-enable-etc-rc-local-
    with-systemd.

    I can not resolve the site let alone the link.

    There is a typo in the server name. Search for
    how-to-enable-etc-rc-local-with-systemd and you will find it.

    The tutorial mentions an alternative of using a @reboot line in crontab.
    I can find no documentation on my system man pages for such a line. Is
    it an Ubuntu/Kubuntu thing?

    Cheers!

    jim b.

    The site is a new one to me. It is not meant to be distro specific. See

    But is IS distro specific. I posted the
    /lib/systemd/system/rc-local.service file from Mageia 7. Why not use
    that which is designed for Mageia 7, especially since you admit you do
    not know what you are doing.



    https://unix.stackexchange.com/questions/109804/crontabs-reboot-only-works-for- root

    That user had CentOS.

    Fine. And you have Mageia. Distributions differ. Some people believe
    that the only Linux distribution is Ubuntu, so that if they present
    something for that it is for everything. Some believe Redhat is the only
    good distrution and everyone else deseres to be punished.
    Use the Mageia solution. It certainly works for me, and yes I do use
    rc.local, and have about five different commands in it. And it works.


    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Aragorn@2:250/1 to All on Mon Nov 4 23:31:17 2019
    On 04.11.2019 at 23:21, William Unruh scribbled:

    Some believe Redhat is the only good distrution and everyone else
    deseres to be punished.

    No, the punishing thing only comes from Slackware users. RedHat's style
    is more along the lines of "Resistance is futile, you will be
    assimilated."

    :p


    --
    With respect,
    = Aragorn =


    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Strider (2:250/1@fidonet)
  • From Bit Twister@2:250/1 to All on Mon Nov 4 23:53:38 2019
    On Tue, 5 Nov 2019 07:31:11 +1100, Doug Laidlaw wrote:
    On 4/11/19 9:52 pm, Bit Twister wrote:
    On Mon, 4 Nov 2019 20:22:32 +1100, Doug Laidlaw wrote:
    Running Mageia 7 with latest kernel and Xfce desktop.

    There was talk about overcoming the recent Cups problem by adding a
    command to rc.local. I decided to use the same method to keep my
    customized /etc/default/grub file.

    I do not understand that relation between /etc/default/grub and rc.local

    Keep reading. I find the "corner" problem with Grub2 an ongoing
    nuisance. I have /etc/default/grub configured to make my box boot into Mageia by default, then the next kernel upgrade restores it to "saved."

    Then I suggest you update https://bugs.mageia.org/show_bug.cgi?id=18783 GRUB_SAVEDEFAULT is still being clobbered on mga7 kernel updates.

    Since my grub setup is heavily updated, my grub make file has hidden that problem from me since I execute it after my install_script updates a kernel.


    No, the system hung when it couldn't start the rc-local service. The
    command in the journal had no timeout, i.e. it would stay at that point forever.

    Hmmm, seems like I have seen a few threads where one or more people
    would complain about the default 5 minutes it takes for a service to
    do its think before systemd would move on to the rest of the sequence
    in the event of failure.



    Shorewall and the display manager couldn't start,
    and that was only the beginning.

    Intriguing that shorewall did not start since the rc.local has
    After=network.target
    which means rc.local will not start executing till after the network is up. >>
    I think that you mean that shorewall's .service file has that line.

    Or just maybe I did a "systemctl status rc-local.service"
    on the rc-local service file, that you said did not exist. and actually did
    a "cat /usr/lib/systemd/system/rc-local.service" indicated in service file prior to my reply.



    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)
  • From Jim Beard@2:250/1 to All on Tue Nov 5 15:45:37 2019
    On Mon, 04 Nov 2019 15:07:22 -0500, David W. Hodgins wrote:

    On Mon, 04 Nov 2019 10:11:31 -0500, Jim Beard <jim.beard@verizon.net>
    wrote:

    The tutorial mentions an alternative of using a @reboot line in
    crontab.
    I can find no documentation on my system man pages for such a line. Is
    it an Ubuntu/Kubuntu thing?

    No. See "man 5 crontab".

    Found it. It has been years since I looked in man 5 documentation, and
    it did not even cross my mind.

    Thank you.

    Cheers!

    jim b.

    --
    UNIX is not user-unfriendly, it merely expects users to be computer-
    friendly.

    --- MBSE BBS v1.0.7.12A (GNU/Linux-x86_64)
    * Origin: A noiseless patient Spider (2:250/1@fidonet)