mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-26 08:48:38 +03:00
Merge pull request #302195 from anthonyroussel/fix-oddjobd
nixos/oddjobd: enable dbus service to fix service startup
This commit is contained in:
commit
d217732cef
@ -4,26 +4,28 @@ let
|
|||||||
cfg = config.programs.oddjobd;
|
cfg = config.programs.oddjobd;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.programs.oddjobd = {
|
options = {
|
||||||
|
programs.oddjobd = {
|
||||||
enable = lib.mkEnableOption "oddjob";
|
enable = lib.mkEnableOption "oddjob";
|
||||||
package = lib.mkPackageOption pkgs "oddjob" {};
|
package = lib.mkPackageOption pkgs "oddjob" {};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
systemd.packages = [ cfg.package ];
|
|
||||||
|
|
||||||
systemd.services.oddjobd = {
|
systemd.services.oddjobd = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "network.target"];
|
after = [ "network.target" "dbus.service" ];
|
||||||
description = "DBUS Odd-job Daemon";
|
description = "DBUS Odd-job Daemon";
|
||||||
enable = true;
|
enable = true;
|
||||||
documentation = [ "man:oddjobd(8)" "man:oddjobd.conf(5)" ];
|
documentation = [ "man:oddjobd(8)" "man:oddjobd.conf(5)" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "dbus";
|
Type = "simple";
|
||||||
BusName = "org.freedesktop.oddjob";
|
PIDFile = "/run/oddjobd.pid";
|
||||||
ExecStart = "${lib.getBin cfg.package}/bin/oddjobd";
|
ExecStart = "${lib.getBin cfg.package}/bin/oddjobd -n -p /run/oddjobd.pid -t 300";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.dbus.packages = [ cfg.package ];
|
||||||
};
|
};
|
||||||
|
|
||||||
meta.maintainers = with lib.maintainers; [ SohamG ];
|
meta.maintainers = with lib.maintainers; [ SohamG ];
|
||||||
|
@ -652,6 +652,7 @@ in {
|
|||||||
nzbget = handleTest ./nzbget.nix {};
|
nzbget = handleTest ./nzbget.nix {};
|
||||||
nzbhydra2 = handleTest ./nzbhydra2.nix {};
|
nzbhydra2 = handleTest ./nzbhydra2.nix {};
|
||||||
ocis = handleTest ./ocis.nix {};
|
ocis = handleTest ./ocis.nix {};
|
||||||
|
oddjobd = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./oddjobd.nix {};
|
||||||
oh-my-zsh = handleTest ./oh-my-zsh.nix {};
|
oh-my-zsh = handleTest ./oh-my-zsh.nix {};
|
||||||
ollama = handleTest ./ollama.nix {};
|
ollama = handleTest ./ollama.nix {};
|
||||||
ombi = handleTest ./ombi.nix {};
|
ombi = handleTest ./ombi.nix {};
|
||||||
|
23
nixos/tests/oddjobd.nix
Normal file
23
nixos/tests/oddjobd.nix
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
||||||
|
name = "oddjobd";
|
||||||
|
meta.maintainers = [ lib.maintainers.anthonyroussel ];
|
||||||
|
|
||||||
|
nodes.machine = { ... } : {
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.oddjob
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.oddjobd.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
start_all()
|
||||||
|
|
||||||
|
machine.wait_for_unit("oddjobd.service")
|
||||||
|
machine.wait_for_file("/run/oddjobd.pid")
|
||||||
|
|
||||||
|
with subtest("send oddjob listall request"):
|
||||||
|
result = machine.succeed("oddjob_request -s com.redhat.oddjob -o /com/redhat/oddjob -i com.redhat.oddjob listall")
|
||||||
|
assert ('(service="com.redhat.oddjob",object="/com/redhat/oddjob",interface="com.redhat.oddjob",method="listall")' in result)
|
||||||
|
'';
|
||||||
|
})
|
@ -1,12 +1,15 @@
|
|||||||
{ lib
|
{
|
||||||
, fetchurl
|
autoreconfHook,
|
||||||
, stdenv
|
dbus,
|
||||||
, autoreconfHook
|
fetchpatch,
|
||||||
, dbus
|
fetchurl,
|
||||||
, libxml2
|
lib,
|
||||||
, pam
|
libxml2,
|
||||||
, pkg-config
|
nixosTests,
|
||||||
, systemd
|
pam,
|
||||||
|
pkg-config,
|
||||||
|
stdenv,
|
||||||
|
systemd,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -18,30 +21,32 @@ stdenv.mkDerivation rec {
|
|||||||
hash = "sha256-SUOsMH55HtEsk5rX0CXK0apDObTj738FGOaL5xZRnIM=";
|
hash = "sha256-SUOsMH55HtEsk5rX0CXK0apDObTj738FGOaL5xZRnIM=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
# Define SystemD service location using `with-systemdsystemunitdir` configure flag
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://pagure.io/oddjob/c/f63287a35107385dcb6e04a4c742077c9d1eab86.patch";
|
||||||
|
hash = "sha256-2mmw4pJhrIk4/47FM8zKH0dTQJWnntHPNmq8VAUWqJI=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
autoreconfHook
|
autoreconfHook
|
||||||
pkg-config
|
pkg-config
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
libxml2
|
|
||||||
dbus
|
dbus
|
||||||
|
libxml2
|
||||||
pam
|
pam
|
||||||
systemd
|
systemd
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace configure.ac \
|
|
||||||
--replace 'SYSTEMDSYSTEMUNITDIR=`pkg-config --variable=systemdsystemunitdir systemd 2> /dev/null`' "SYSTEMDSYSTEMUNITDIR=${placeholder "out"}" \
|
|
||||||
--replace 'SYSTEMDSYSTEMUNITDIR=`pkg-config --variable=systemdsystemunitdir systemd`' "SYSTEMDSYSTEMUNITDIR=${placeholder "out"}"
|
|
||||||
'';
|
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--prefix=${placeholder "out"}"
|
"--prefix=${placeholder "out"}"
|
||||||
"--sysconfdir=${placeholder "out"}/etc"
|
"--sysconfdir=${placeholder "out"}/etc"
|
||||||
"--with-selinux-acls=no"
|
"--with-selinux-acls=no"
|
||||||
"--with-selinux-labels=no"
|
"--with-selinux-labels=no"
|
||||||
"--disable-systemd"
|
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
|
||||||
];
|
];
|
||||||
|
|
||||||
postConfigure = ''
|
postConfigure = ''
|
||||||
@ -49,12 +54,19 @@ stdenv.mkDerivation rec {
|
|||||||
--replace "globals.selinux_enabled" "FALSE"
|
--replace "globals.selinux_enabled" "FALSE"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
# Requires a dbus-daemon environment
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
passthru.tests = {
|
||||||
|
inherit (nixosTests) oddjobd;
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
changelog = "https://pagure.io/oddjob/blob/oddjob-${version}/f/ChangeLog";
|
||||||
description = "Odd Job Daemon";
|
description = "Odd Job Daemon";
|
||||||
homepage = "https://pagure.io/oddjob";
|
homepage = "https://pagure.io/oddjob";
|
||||||
changelog = "https://pagure.io/oddjob/blob/oddjob-${version}/f/ChangeLog";
|
license = lib.licenses.bsd3;
|
||||||
license = licenses.bsd0;
|
maintainers = with lib.maintainers; [ SohamG ];
|
||||||
platforms = platforms.linux;
|
platforms = lib.platforms.linux;
|
||||||
maintainers = with maintainers; [ SohamG ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user