mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #10546 from aszlig/nixops-issue-350
Fixes for NixOps issue #350
This commit is contained in:
commit
b73c5ae291
2 changed files with 9 additions and 7 deletions
|
@ -367,6 +367,8 @@ in
|
||||||
// { CURL_CA_BUNDLE = "/etc/ssl/certs/ca-certificates.crt"; }
|
// { CURL_CA_BUNDLE = "/etc/ssl/certs/ca-certificates.crt"; }
|
||||||
// config.networking.proxy.envVars;
|
// config.networking.proxy.envVars;
|
||||||
|
|
||||||
|
unitConfig.RequiresMountsFor = "/nix/store";
|
||||||
|
|
||||||
serviceConfig =
|
serviceConfig =
|
||||||
{ Nice = cfg.daemonNiceLevel;
|
{ Nice = cfg.daemonNiceLevel;
|
||||||
IOSchedulingPriority = cfg.daemonIONiceLevel;
|
IOSchedulingPriority = cfg.daemonIONiceLevel;
|
||||||
|
|
|
@ -261,12 +261,12 @@ while (my ($unit, $state) = each %{$activePrev}) {
|
||||||
|
|
||||||
sub pathToUnitName {
|
sub pathToUnitName {
|
||||||
my ($path) = @_;
|
my ($path) = @_;
|
||||||
die unless substr($path, 0, 1) eq "/";
|
open my $cmd, "-|", "systemd-escape", "--suffix=mount", "-p", $path
|
||||||
return "-" if $path eq "/";
|
or die "Unable to escape $path!\n";
|
||||||
$path = substr($path, 1);
|
my $escaped = join "", <$cmd>;
|
||||||
$path =~ s/\//-/g;
|
chomp $escaped;
|
||||||
# FIXME: handle - and unprintable characters.
|
close $cmd or die;
|
||||||
return $path;
|
return $escaped;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub unique {
|
sub unique {
|
||||||
|
@ -290,7 +290,7 @@ my ($newFss, $newSwaps) = parseFstab "$out/etc/fstab";
|
||||||
foreach my $mountPoint (keys %$prevFss) {
|
foreach my $mountPoint (keys %$prevFss) {
|
||||||
my $prev = $prevFss->{$mountPoint};
|
my $prev = $prevFss->{$mountPoint};
|
||||||
my $new = $newFss->{$mountPoint};
|
my $new = $newFss->{$mountPoint};
|
||||||
my $unit = pathToUnitName($mountPoint) . ".mount";
|
my $unit = pathToUnitName($mountPoint);
|
||||||
if (!defined $new) {
|
if (!defined $new) {
|
||||||
# Filesystem entry disappeared, so unmount it.
|
# Filesystem entry disappeared, so unmount it.
|
||||||
$unitsToStop{$unit} = 1;
|
$unitsToStop{$unit} = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue