cloudConfig: restart worker on submit
Restart osbuild-composer and the worker after updating the config, this is a necessary step for osbuild-composer to register the changes.
This commit is contained in:
parent
5afe1c1fc1
commit
1ed4380bfc
1 changed files with 33 additions and 0 deletions
|
|
@ -652,6 +652,39 @@ export const cockpitApi = contentSourcesApi.injectEndpoints({
|
|||
});
|
||||
});
|
||||
|
||||
const systemServices = [
|
||||
'osbuild-composer.socket',
|
||||
'osbuild-worker@*.service',
|
||||
'osbuild-composer.service',
|
||||
];
|
||||
|
||||
await cockpit.spawn(
|
||||
[
|
||||
'systemctl',
|
||||
'stop',
|
||||
// we need to be explicit here and stop all the services first,
|
||||
// otherwise this step is a little bit flaky
|
||||
...systemServices,
|
||||
],
|
||||
{
|
||||
superuser: 'require',
|
||||
}
|
||||
);
|
||||
|
||||
await cockpit.spawn(
|
||||
[
|
||||
'systemctl',
|
||||
'restart',
|
||||
// we need to restart all the services explicitly too
|
||||
// since the config doesn't always get reloaded if we
|
||||
// only reload the worker service
|
||||
...systemServices,
|
||||
],
|
||||
{
|
||||
superuser: 'require',
|
||||
}
|
||||
);
|
||||
|
||||
return { data: TOML.parse(contents) };
|
||||
} catch (error) {
|
||||
return { error };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue