Bug 47771 - /etc/rc.local isn't being run anymore after update to UCS 4.3
/etc/rc.local isn't being run anymore after update to UCS 4.3
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: Update - Release updates
UCS 4.3
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-07 17:21 CEST by Valentin Heidelberger
Modified: 2021-05-14 16:34 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.023
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2018090721000774
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Valentin Heidelberger univentionstaff 2018-09-07 17:21:29 CEST
A customer had configured a script in /etc/rc.local, which was always run after a reboot on UCS 4.2 and vital to the system's purpose. After the system was upgraded to UCS 4.3, the script wasn't run anymore. I can reproduce this with a new UCS 4.3 instance as well.

Starting the corresponding systemd service once fixed that. The script was run on every reboot again.

systemctl start rc-local.service

I think we should do something such as the following in the upgrade process to make sure customers who used /etc/rc.local on 4.1 and 4.2 can still use it frictionlessly after the upgrade.
If there's a more "systemd-ish" approach to rc.local's functionality now, feel free to tell me about it!

if [ -x /etc/rc.local ] 
then systemctl start rc-local.service
fi
Comment 1 Philipp Hahn univentionstaff 2018-11-21 18:50:42 CET
x(In reply to Valentin Heidelberger from comment #0)
> A customer had configured a script in /etc/rc.local, which was always run
> after a reboot on UCS 4.2 and vital to the system's purpose. After the
> system was upgraded to UCS 4.3, the script wasn't run anymore. I can
> reproduce this with a new UCS 4.3 instance as well.

I upgraded my UCS-4.2-5 test system to UCS-4.3-2 and /etc/rc.local was working fine afterwards.

# find /???/systemd -name rc-local\*
/lib/systemd/system/rc-local.service
/lib/systemd/system/rc-local.service.d
/run/systemd/generator/multi-user.target.wants/rc-local.service

The service files "/lib/systemd/system/rc-local.service{,.d/*.conf}" are automatically enabled by "/lib/systemd/system-generators/systemd-rc-local-generator" by creating "/run/systemd/generator/multi-user.target.wants/rc-local.service" during the boot process.

The file "/etc/rc.local" must be executable!

Please read `man 8 systemd-rc-local-generator` for some details.

> Starting the corresponding systemd service once fixed that. The script was
> run on every reboot again.

Starting the service manually once does not change the persistent state for the next boot, so this "fix" looks bogus.
You should check that the service is not masked (not linked to /dev/null) and is enabled (added as "wanted by multi-user.target").
Also check the state using "systemctl status rc-local.service" and the complete service using "systemctl cat rc-local.service".

> If there's a more "systemd-ish" approach to rc.local's functionality now,
> feel free to tell me about it!

You can add your own services as "/etc/systemd/system/my-foo.service"; `man 5 service.service` is your friend. Afterwards you have to 
- tell systemd to reload all files using "systemctl daemon-reload",
- enable the service for the next reboot using "systemctl enable my-foo.service"
- start the service for the current boot using "systemctl start my-foo.service"
Comment 2 Ingo Steuwer univentionstaff 2021-05-14 15:42:56 CEST
This issue has been filed against UCS 4.3.

UCS 4.3 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.