Merge pull request #67858 from flokli/local-fs-target-services
nixos: remove dependencies on local-fs.target
This commit is contained in:
commit
4e60699fa7
|
@ -111,7 +111,7 @@ in
|
|||
|
||||
systemd.services.boinc = {
|
||||
description = "BOINC Client";
|
||||
after = ["network.target" "local-fs.target"];
|
||||
after = ["network.target"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
script = ''
|
||||
${fhsEnvExecutable} --dir ${cfg.dataDir} --redirectio ${allowRemoteGuiRpcFlag}
|
||||
|
|
|
@ -34,7 +34,7 @@ in {
|
|||
psd = {
|
||||
enable = true;
|
||||
description = "Profile Sync daemon";
|
||||
wants = [ "psd-resync.service" "local-fs.target" ];
|
||||
wants = [ "psd-resync.service" ];
|
||||
wantedBy = [ "default.target" ];
|
||||
path = with pkgs; [ rsync kmod gawk nettools utillinux profile-sync-daemon ];
|
||||
unitConfig = {
|
||||
|
|
|
@ -102,7 +102,6 @@ in
|
|||
|
||||
systemd.services.triggerhappy = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "local-fs.target" ];
|
||||
description = "Global hotkey daemon";
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.triggerhappy}/bin/thd ${optionalString (cfg.user != "root") "--user ${cfg.user}"} --socket ${socket} --triggers ${configFile} --deviceglob /dev/input/event*";
|
||||
|
|
|
@ -105,7 +105,7 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
systemd.services.airsonic = {
|
||||
description = "Airsonic Media Server";
|
||||
after = [ "local-fs.target" "network.target" ];
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
preStart = ''
|
||||
|
|
|
@ -259,7 +259,7 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
systemd.services.mediatomb = {
|
||||
description = "MediaTomb media Server";
|
||||
after = [ "local-fs.target" "network.target" ];
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = [ pkgs.mediatomb ];
|
||||
serviceConfig.ExecStart = "${pkgs.mediatomb}/bin/mediatomb -p ${toString cfg.port} ${if cfg.interface!="" then "-e ${cfg.interface}" else ""} ${if cfg.customCfg then "" else "-c ${mtConf}"} -m ${cfg.dataDir}";
|
||||
|
|
|
@ -165,7 +165,7 @@ in
|
|||
|
||||
}; # options.services
|
||||
|
||||
config = {
|
||||
config = {
|
||||
|
||||
systemd.services.mwlib-nserve = mkIf cfg.nserve.enable
|
||||
{
|
||||
|
@ -191,7 +191,6 @@ in
|
|||
description = "mwlib job queue server";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "local-fs.target" ];
|
||||
|
||||
preStart = ''
|
||||
mkdir -pv '${cfg.qserve.datadir}'
|
||||
|
@ -218,7 +217,7 @@ in
|
|||
description = "mwlib worker";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "local-fs.target" ];
|
||||
after = [ "network.target" ];
|
||||
|
||||
preStart = ''
|
||||
mkdir -pv '${cfg.nslave.cachedir}'
|
||||
|
|
|
@ -10,7 +10,7 @@ let
|
|||
#!${pkgs.bash}/bin/sh
|
||||
|
||||
SERVIIO_HOME=${pkgs.serviio}
|
||||
|
||||
|
||||
# Setup the classpath
|
||||
SERVIIO_CLASS_PATH="$SERVIIO_HOME/lib/*:$SERVIIO_HOME/config"
|
||||
|
||||
|
@ -21,13 +21,13 @@ let
|
|||
# Execute the JVM in the foreground
|
||||
exec ${pkgs.jre}/bin/java -Xmx512M -Xms20M -XX:+UseG1GC -XX:GCTimeRatio=1 -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath "$SERVIIO_CLASS_PATH" org.serviio.MediaServer "$@"
|
||||
'';
|
||||
|
||||
|
||||
in {
|
||||
|
||||
###### interface
|
||||
options = {
|
||||
services.serviio = {
|
||||
|
||||
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
|
@ -52,7 +52,7 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
systemd.services.serviio = {
|
||||
description = "Serviio Media Server";
|
||||
after = [ "local-fs.target" "network.target" ];
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = [ pkgs.serviio ];
|
||||
serviceConfig = {
|
||||
|
@ -64,7 +64,7 @@ in {
|
|||
};
|
||||
|
||||
users.users = [
|
||||
{
|
||||
{
|
||||
name = "serviio";
|
||||
group = "serviio";
|
||||
home = cfg.dataDir;
|
||||
|
@ -75,16 +75,16 @@ in {
|
|||
];
|
||||
|
||||
users.groups = [
|
||||
{ name = "serviio";}
|
||||
{ name = "serviio";}
|
||||
];
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
allowedTCPPorts = [
|
||||
8895 # serve UPnP responses
|
||||
23423 # console
|
||||
23424 # mediabrowser
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
allowedUDPPorts = [
|
||||
1900 # UPnP service discovey
|
||||
];
|
||||
};
|
||||
|
|
|
@ -105,7 +105,7 @@ let cfg = config.services.subsonic; in {
|
|||
config = mkIf cfg.enable {
|
||||
systemd.services.subsonic = {
|
||||
description = "Personal media streamer";
|
||||
after = [ "local-fs.target" "network.target" ];
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
script = ''
|
||||
${pkgs.jre}/bin/java -Xmx${toString cfg.maxMemory}m \
|
||||
|
|
|
@ -9,7 +9,7 @@ let
|
|||
translateOption = replaceStrings upperChars (map (s: " ${s}") lowerChars);
|
||||
generateDaemonList = (daemonType: daemons: extraServiceConfig:
|
||||
mkMerge (
|
||||
map (daemon:
|
||||
map (daemon:
|
||||
{ "ceph-${daemonType}-${daemon}" = generateServiceFile daemonType daemon cfg.global.clusterName ceph extraServiceConfig; }
|
||||
) daemons
|
||||
)
|
||||
|
@ -17,8 +17,8 @@ let
|
|||
generateServiceFile = (daemonType: daemonId: clusterName: ceph: extraServiceConfig: {
|
||||
enable = true;
|
||||
description = "Ceph ${builtins.replaceStrings lowerChars upperChars daemonType} daemon ${daemonId}";
|
||||
after = [ "network-online.target" "local-fs.target" "time-sync.target" ] ++ optional (daemonType == "osd") "ceph-mon.target";
|
||||
wants = [ "network-online.target" "local-fs.target" "time-sync.target" ];
|
||||
after = [ "network-online.target" "time-sync.target" ] ++ optional (daemonType == "osd") "ceph-mon.target";
|
||||
wants = [ "network-online.target" "time-sync.target" ];
|
||||
partOf = [ "ceph-${daemonType}.target" ];
|
||||
wantedBy = [ "ceph-${daemonType}.target" ];
|
||||
|
||||
|
@ -41,7 +41,7 @@ let
|
|||
daemonPath="/var/lib/ceph/${if daemonType == "rgw" then "radosgw" else daemonType}/${clusterName}-${daemonId}"
|
||||
if [ ! -d ''$daemonPath ]; then
|
||||
mkdir -m 755 -p ''$daemonPath
|
||||
chown -R ceph:ceph ''$daemonPath
|
||||
chown -R ceph:ceph ''$daemonPath
|
||||
fi
|
||||
'';
|
||||
} // optionalAttrs (daemonType == "osd") { path = [ pkgs.getopt ]; }
|
||||
|
@ -55,7 +55,7 @@ let
|
|||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
in
|
||||
{
|
||||
options.services.ceph = {
|
||||
# Ceph has a monolithic configuration file but different sections for
|
||||
|
@ -86,7 +86,7 @@ in
|
|||
type = with types; nullOr commas;
|
||||
default = null;
|
||||
example = ''
|
||||
node0, node1, node2
|
||||
node0, node1, node2
|
||||
'';
|
||||
description = ''
|
||||
List of hosts that will be used as monitors at startup.
|
||||
|
@ -313,9 +313,9 @@ in
|
|||
}
|
||||
];
|
||||
|
||||
warnings = optional (cfg.global.monInitialMembers == null)
|
||||
warnings = optional (cfg.global.monInitialMembers == null)
|
||||
''Not setting up a list of members in monInitialMembers requires that you set the host variable for each mon daemon or else the cluster won't function'';
|
||||
|
||||
|
||||
environment.etc."ceph/ceph.conf".text = let
|
||||
# Translate camelCaseOptions to the expected camel case option for ceph.conf
|
||||
translatedGlobalConfig = mapAttrs' (name: value: nameValuePair (translateOption name) value) cfg.global;
|
||||
|
@ -344,13 +344,13 @@ in
|
|||
};
|
||||
|
||||
systemd.services = let
|
||||
services = []
|
||||
++ optional cfg.mon.enable (generateDaemonList "mon" cfg.mon.daemons { RestartSec = "10"; })
|
||||
services = []
|
||||
++ optional cfg.mon.enable (generateDaemonList "mon" cfg.mon.daemons { RestartSec = "10"; })
|
||||
++ optional cfg.mds.enable (generateDaemonList "mds" cfg.mds.daemons { StartLimitBurst = "3"; })
|
||||
++ optional cfg.osd.enable (generateDaemonList "osd" cfg.osd.daemons { StartLimitBurst = "30"; RestartSec = "20s"; })
|
||||
++ optional cfg.rgw.enable (generateDaemonList "rgw" cfg.rgw.daemons { })
|
||||
++ optional cfg.mgr.enable (generateDaemonList "mgr" cfg.mgr.daemons { StartLimitBurst = "3"; });
|
||||
in
|
||||
in
|
||||
mkMerge services;
|
||||
|
||||
systemd.targets = let
|
||||
|
|
|
@ -156,7 +156,7 @@ in
|
|||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
requires = lib.optional cfg.useRpcbind "rpcbind.service";
|
||||
after = [ "network.target" "local-fs.target" ] ++ lib.optional cfg.useRpcbind "rpcbind.service";
|
||||
after = [ "network.target" ] ++ lib.optional cfg.useRpcbind "rpcbind.service";
|
||||
|
||||
preStart = ''
|
||||
install -m 0755 -d /var/log/glusterfs
|
||||
|
|
|
@ -236,7 +236,6 @@ in {
|
|||
systemd.services.ipfs-init = recursiveUpdate commonEnv {
|
||||
description = "IPFS Initializer";
|
||||
|
||||
after = [ "local-fs.target" ];
|
||||
before = [ "ipfs.service" "ipfs-offline.service" "ipfs-norouting.service" ];
|
||||
|
||||
script = ''
|
||||
|
@ -263,21 +262,21 @@ in {
|
|||
systemd.services.ipfs = recursiveUpdate baseService {
|
||||
description = "IPFS Daemon";
|
||||
wantedBy = mkIf (cfg.defaultMode == "online") [ "multi-user.target" ];
|
||||
after = [ "network.target" "local-fs.target" "ipfs-init.service" ];
|
||||
after = [ "network.target" "ipfs-init.service" ];
|
||||
conflicts = [ "ipfs-offline.service" "ipfs-norouting.service"];
|
||||
};
|
||||
|
||||
systemd.services.ipfs-offline = recursiveUpdate baseService {
|
||||
description = "IPFS Daemon (offline mode)";
|
||||
wantedBy = mkIf (cfg.defaultMode == "offline") [ "multi-user.target" ];
|
||||
after = [ "local-fs.target" "ipfs-init.service" ];
|
||||
after = [ "ipfs-init.service" ];
|
||||
conflicts = [ "ipfs.service" "ipfs-norouting.service"];
|
||||
};
|
||||
|
||||
systemd.services.ipfs-norouting = recursiveUpdate baseService {
|
||||
description = "IPFS Daemon (no routing mode)";
|
||||
wantedBy = mkIf (cfg.defaultMode == "norouting") [ "multi-user.target" ];
|
||||
after = [ "local-fs.target" "ipfs-init.service" ];
|
||||
after = [ "ipfs-init.service" ];
|
||||
conflicts = [ "ipfs.service" "ipfs-offline.service"];
|
||||
};
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ in
|
|||
|
||||
systemd.services.aria2 = {
|
||||
description = "aria2 Service";
|
||||
after = [ "local-fs.target" "network.target" ];
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
preStart = ''
|
||||
if [[ ! -e "${sessionFile}" ]]
|
||||
|
|
|
@ -35,7 +35,7 @@ in
|
|||
description = "LogMeIn Hamachi Daemon";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "local-fs.target" ];
|
||||
after = [ "network.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
|
|
|
@ -96,7 +96,7 @@ in
|
|||
{ description = "MiniDLNA Server";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "local-fs.target" ];
|
||||
after = [ "network.target" ];
|
||||
|
||||
serviceConfig =
|
||||
{ User = "minidlna";
|
||||
|
|
|
@ -249,7 +249,7 @@ in
|
|||
systemd.services.resilio = with pkgs; {
|
||||
description = "Resilio Sync Service";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" "local-fs.target" ];
|
||||
after = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
Restart = "on-abort";
|
||||
UMask = "0002";
|
||||
|
|
|
@ -143,7 +143,6 @@ in
|
|||
};
|
||||
systemd.services.fcron = {
|
||||
description = "fcron daemon";
|
||||
after = [ "local-fs.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
path = [ pkgs.fcron ];
|
||||
|
|
|
@ -722,7 +722,6 @@ in
|
|||
systemd.services.tor-init =
|
||||
{ description = "Tor Daemon Init";
|
||||
wantedBy = [ "tor.service" ];
|
||||
after = [ "local-fs.target" ];
|
||||
script = ''
|
||||
install -m 0700 -o tor -g tor -d ${torDirectory} ${torDirectory}/onion
|
||||
install -m 0750 -o tor -g tor -d ${torRunDirectory}
|
||||
|
|
|
@ -195,7 +195,7 @@ in {
|
|||
description = "USBGuard daemon";
|
||||
|
||||
wantedBy = [ "basic.target" ];
|
||||
wants = [ "systemd-udevd.service" "local-fs.target" ];
|
||||
wants = [ "systemd-udevd.service" ];
|
||||
|
||||
# make sure an empty rule file and required directories exist
|
||||
preStart = ''
|
||||
|
|
|
@ -14,7 +14,6 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
systemd.services.cgmanager = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "local-fs.target" ];
|
||||
description = "Cgroup management daemon";
|
||||
restartIfChanged = false;
|
||||
serviceConfig = {
|
||||
|
|
|
@ -112,8 +112,6 @@ in
|
|||
systemd.services.cloud-init-local =
|
||||
{ description = "Initial cloud-init job (pre-networking)";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "local-fs.target" ];
|
||||
after = [ "local-fs.target" ];
|
||||
path = path;
|
||||
serviceConfig =
|
||||
{ Type = "oneshot";
|
||||
|
@ -127,9 +125,9 @@ in
|
|||
systemd.services.cloud-init =
|
||||
{ description = "Initial cloud-init job (metadata service crawler)";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "local-fs.target" "network-online.target" "cloud-init-local.service"
|
||||
wants = [ "network-online.target" "cloud-init-local.service"
|
||||
"sshd.service" "sshd-keygen.service" ];
|
||||
after = [ "local-fs.target" "network-online.target" "cloud-init-local.service" ];
|
||||
after = [ "network-online.target" "cloud-init-local.service" ];
|
||||
before = [ "sshd.service" "sshd-keygen.service" ];
|
||||
requires = [ "network.target "];
|
||||
path = path;
|
||||
|
|
|
@ -102,7 +102,7 @@ in
|
|||
config = mkIf cfg.enable {
|
||||
systemd.services.transmission = {
|
||||
description = "Transmission BitTorrent Service";
|
||||
after = [ "local-fs.target" "network.target" ] ++ optional apparmor "apparmor.service";
|
||||
after = [ "network.target" ] ++ optional apparmor "apparmor.service";
|
||||
requires = mkIf apparmor [ "apparmor.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
|
|
|
@ -659,7 +659,7 @@ in
|
|||
systemd.services.display-manager =
|
||||
{ description = "X11 Server";
|
||||
|
||||
after = [ "systemd-udev-settle.service" "local-fs.target" "acpid.service" "systemd-logind.service" ];
|
||||
after = [ "systemd-udev-settle.service" "acpid.service" "systemd-logind.service" ];
|
||||
wants = [ "systemd-udev-settle.service" ];
|
||||
|
||||
restartIfChanged = false;
|
||||
|
|
|
@ -166,7 +166,6 @@ in
|
|||
|
||||
wantedBy = [ "sshd.service" "waagent.service" ];
|
||||
before = [ "sshd.service" "waagent.service" ];
|
||||
after = [ "local-fs.target" ];
|
||||
|
||||
path = [ pkgs.coreutils ];
|
||||
script =
|
||||
|
|
|
@ -26,7 +26,6 @@ in
|
|||
|
||||
wantedBy = [ "sshd.service" "waagent.service" ];
|
||||
before = [ "sshd.service" "waagent.service" ];
|
||||
after = [ "local-fs.target" ];
|
||||
|
||||
path = [ pkgs.coreutils ];
|
||||
script =
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
systemd.services.docker-load-fetchdocker-image = {
|
||||
description = "Docker load hello-world-container";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "docker.service" "local-fs.target" ];
|
||||
after = [ "docker.service" "local-fs.target" ];
|
||||
wants = [ "docker.service" ];
|
||||
after = [ "docker.service" ];
|
||||
|
||||
script = ''
|
||||
${pkgs.hello-world-container}/compositeImage.sh | ${pkgs.docker}/bin/docker load
|
||||
|
|
Loading…
Reference in New Issue