-
Notifications
You must be signed in to change notification settings - Fork 52
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
Cure existing systemd units #313
Cure existing systemd units #313
Conversation
.await | ||
.map_err(|e| ActionError::Remove(PathBuf::from(SERVICE_DEST), e))?; | ||
} | ||
tokio::fs::symlink(SERVICE_SRC, SERVICE_DEST) |
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.
Switched to symlink
directly because we know where it is and where it should be.
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.
I am fairly sure we couldn't do this with the steam deck? Might be worth checking.
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.
I validated and this works just fine, it seems.
Installed, ran nix run nixpkgs#hello | nix run nixpkgs#ponysay
, rebooted, ran nix run nixpkgs#hello | nix run nixpkgs#ponysay
again, worked fine.
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.
Interesting, for some reason I thought this would give issues with cross mount symlinks...
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.
AFAIK, this is just a simplification of what systemctl link
does anyways:
https://github.com/systemd/systemd-stable/blob/8d1db692194f7db407754e85961d82d99117ddab/src/systemctl/systemctl-enable.c#L119 -> https://github.com/systemd/systemd-stable/blob/8d1db692194f7db407754e85961d82d99117ddab/src/shared/install.c#L2407 -> https://github.com/systemd/systemd-stable/blob/8d1db692194f7db407754e85961d82d99117ddab/src/shared/install.c#L2488 -> https://github.com/systemd/systemd-stable/blob/8d1db692194f7db407754e85961d82d99117ddab/src/shared/install.c#L559
) | ||
.await?; | ||
if Path::new(SERVICE_DEST).exists() { | ||
// TODO: ask user if we can remove it...? do we have a way |
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.
I don't think we are currently structured to be able to have some interactivity within the plans... We do have a prompt
function but that's part of the CLI and it would feel weird putting that in here...
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.
We have discussed adding some UX for curing to prompt users, but as of right now -- no support.
I also explicitly do not consider unit overrides, since that would be a huge nightmare to handle (AFAIK, the only way to know about overrides is to do something like If there was an easy way to detect, we could at least warn or error about it, but I don't see an easy way to do that...
|
re: overrides -- apparently there's a dbus API we could use, but for now I'm going with "best effort" and checking the place where the overrides are likely to appear. |
To more accurately reflect its associated error message.
…ice-manager-configurations
if the link_dest and unit_src were the same, we'd still error that the file exists
Description
Checklist
cargo fmt
nix build
nix flake check
Validating with
install.determinate.systems
If a maintainer has added the
upload to s3
label to this PR, it will become available for installation viainstall.determinate.systems
: