-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.7 Relocate Systemd Files #11147
2.7 Relocate Systemd Files #11147
Conversation
Instead of writing each service definition and it's exec-start script into a service folder in /lib/systemd/system and using dbus (systemd) to link them into /etc/systemd/system, we write them directly to /etc/systemd/system. This change was required to support Focal Fossa (20.04) which has these two directories on different partitions, causing systemd to fail. The linking step remains for now, though it effectively does nothing - the service definitions are in the default search path, so reloading the systemd daemon should be sufficient to have them loaded.
@@ -227,13 +227,7 @@ func (s *systemdServiceManager) WriteSystemdAgents( | |||
|
|||
// Otherwise we need to manually ensure the service unit links. | |||
svcFileName := svcName + ".service" | |||
if err = os.Symlink(path.Join(systemd.LibSystemdDir, svcName, svcFileName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method (WriteSystemdAgents) is all at sea. I will refactor it in a forthcoming patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice bit of clean up on the way. More to do obviously, but removing un-needed arguments in the constructor seems like a win win.
The Q&A steps went well, although I should note there is a small issue when using LXD as the provider:
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
We should ping the LXD team to see if there can be anything done with this?
|
1 similar comment
|
We've chatted with the lxd team and it doesn't seem to be on their end at
the moment. Our decision was to get enablement and then chat with the
kernel folks for guidance.
…On Thu, Jan 23, 2020, 5:22 PM Simon Richardson ***@***.***> wrote:
***@***.**** approved this pull request.
Nice bit of clean up on the way. More to do obviously, but removing
un-needed arguments in the constructor seems like a win win.
The Q&A steps went well, although I should note there is a small issue
when using LXD as the provider:
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
We should ping the LXD team to see if there can be anything done with this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11147?email_source=notifications&email_token=AAASRCZS2EVEHXV6PETTEHTQ7GY4LA5CNFSM4KKXLFSKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCS2KFBQ#pullrequestreview-347382406>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAASRCYL7RR6I4ABNXCUC5LQ7GY4LANCNFSM4KKXLFSA>
.
|
One thing that was mentioned here was to not bother with an external script at all, but instead have multiple ExecStart lines rather than an external script. The "install" command is a better way to create the log file with the right permissions and ownership. I think it would be worthwhile dropping the exec script if we can get all the behaviour into just the service file. |
We can look at how we might achieve multi-command |
|
#11149 ### Checklist - [x] Checked if it requires a [pylibjuju](https://github.com/juju/python-libjuju) change? - [x] Added [integration tests](https://github.com/juju/juju/tree/develop/tests) for the PR? - [x] Added or updated [doc.go](https://discourse.jujucharms.com/t/readme-in-packages/451) related to packages changed? - [x] Do comments answer the question of why design decisions were made? ---- ## Description of change This patch is a follow-up to #11147 and precedes forthcoming work on accompanying upgrade steps. It is refactoring only; removing an unused argument and adding various modularisations. Accompanying mocks are regenerated. ## QA steps No functional changes. Unit tests pass. ## Documentation changes None. ## Bug reference N/A
#11151 ### Checklist - [x] Checked if it requires a [pylibjuju](https://github.com/juju/python-libjuju) change? - [x] Added [integration tests](https://github.com/juju/juju/tree/develop/tests) for the PR? - [x] Added or updated [doc.go](https://discourse.jujucharms.com/t/readme-in-packages/451) related to packages changed? - [x] Do comments answer the question of why design decisions were made? ---- ## Description of change This pulls the latest changes in the 2.7 branch into develop. Brings in: - #11139 from jameinel/2.7-detach-volume-state-changing-1860542 - #11141 from howbazaar/2.7-fix-provisioner-leak - #11144 from babbageclunk/2.7-fix-destroy-test - #11137 from ycliuhw/feature/vSphere-disk-resizing - #11146 from manadart/2.7-provisioner-worker-test - #11147 from manadart/relocate-systemd-files - #11150 from manadart/2.7-controller-integration-test - #11149 from manadart/2.7-systemd-upgrades (No conflicts when merging.)
Checklist
Description of change
This patch changes the location of systemd unit files and start-up scripts.
Instead of writing each service definition and it's exec-start script into a service folder in
/lib/systemd/system
and using dbus (systemd) to link them into/etc/systemd/system
, we write them directly to/etc/systemd/system
. This means the exec-start script is co-located with its service definition and prefixed with the service name.This change was required to support Focal Fossa (20.04) which has these two directories on different partitions, causing systemd to fail.
The linking step remains for now, though it effectively does nothing - the service definitions are in the default search path, so reloading the systemd daemon should be sufficient to have them loaded.
Subsequent patches will take care of any required upgrade paths, including upgrading the OS series.
QA steps
juju bootstrap lxd systemd-test-focal --bootstrap-series focal --debug --no-gui --force --config image-stream=daily
.etc/systemd/system
.juju add-machine --series focal
juju deploy cs:ubuntu-13 -n 2 --to 0,0 --series focal --force
juju ssh 0
and observe the service units/scripts are present in/etc/systemd/system
.juju remove-unit ubuntu/1
and observe that the service and script for the unit disappear.Documentation changes
None.
Bug reference
https://bugs.launchpad.net/juju/+bug/1860432