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
sysupdate: Implement dbus service #28134
Conversation
f310ffd
to
d8d20e7
Compare
I think it would make sense to split out the first commit into a separate PR. makes sense on its own, we could merge this ahead of time |
src/sysupdate/sysupdated.c
Outdated
|
||
(void) sd_event_set_watchdog(m->event, true); | ||
|
||
r = sd_event_add_signal(m->event, NULL, SIGINT, NULL, NULL); |
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.
in new code please use SD_EVENT_SIGNAL_PROCMASK right from the start, and drop the manual sigprocmask() in the main() func
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.
Looks like I can't do anything about SIGCHILD, though, for sd_event_add_child
? So I cannot drop the manual sigprocmask
AFAICT
bfb0744
to
e377e43
Compare
I though about running systemd-sysupdate from the initrd to download systemd-sysext images on first boot instead of having them shipped through other means (pre-baked in image, or through credentials/Ignition) on first boot. However, that would require to enumerate the components with |
systemd-sysupdate is the wrong tool for the job if you want to just download something. The right tool for the job would be systemd-importd (modified to be able to download & install sysexts/confexts/portable services, instead of just machines). BUT, I see nothing preventing you from using a part of importd to download the sysext from the initrd. You can run it in a systemd unit, and configure it from the cmdline if you want. Something along the lines of: [Unit]
...
ConditionKernelCommandLine=!myproject.disable_extension_download
After=sysroot.mount
...
[Service]
Type=oneshot
ExecStart=/usr/lib/systemd/systemd-pull raw https://example.com/mysysext.raw.xz /sysroot/var/lib/extensions/mysysext.raw You can always make this a little more sophisticated with, for instance, a generator or a script which scans /sysroot for some config file(s) and downloads things based on that. Edit: systemd-sysupdate is a version management layer sitting on top of systemd-pull. So if you're just downloading a file, then you don't need the version management and thus you can just do systemd-pull directly. Now if for whatever reason you really do need the version management (maybe you want to autodetect the latest version of your sysext?) you can still fork of |
To your edit; yes, when |
(There is a TODO to make dbus work in the initrd btw, maybe it's just time to finally make that a thing) |
This lets a caller construct a BusLocator with a variable path, which can then be used like any other BusLocator. This permits the use of the convenient bus_call_method/etc. methods in situations where an object path for some set of objects varies. This will be used in updatectl.
We set up a NOTIFY_SOCKET to get download progress notifications from each individual import helper. Along with the number of import jobs we have to run, this gives an overall progress value which we report using sd_notify
This prevents sysupdate from going out to the network to enumerate available instances. When combined with the list command, this lets us query installed instances
Previously, the JSON output happened mostly as an accident (i.e. just dumped tables intended for viewing). Now we have more complete JSON output.
Makes it possible to specify URLs to a changelog and an appstream catalog XML in the sysupdate.d/*.conf files. This will be passed along to the clients of systemd-sysupdated, which can then present this data.
e377e43
to
9ff9b9c
Compare
This will let us reuse UpdateSetFlags in updatectl
This will let us reuse reboot_now in updatectl
This is the command-line tool to manage systemd-sysudpated
9ff9b9c
to
c40d4bc
Compare
@poettering I know we discussed varlink @ ASG, but do you want this in this PR? I'd think its something we can add later? |
Oops, this was forgotten. Please rebase. I think at least the man pages need version info added to pass tests. |
Can this be closed in favor of #32363? |
Replaces #27737