quassel: make a proper systemd unit (also properly works in containers now)

This commit is contained in:
Aristid Breitkreuz 2014-11-08 14:59:07 +01:00
parent 7885c2ed12
commit cf4a976ced

View File

@ -74,21 +74,23 @@ in
gid = config.ids.gids.quassel; gid = config.ids.gids.quassel;
}]; }];
jobs.quassel = systemd.services.quassel =
{ description = "Quassel IRC client daemon"; { description = "Quassel IRC client daemon";
startOn = "ip-up"; wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
preStart = '' preStart = ''
mkdir -p ${cfg.dataDir} mkdir -p ${cfg.dataDir}
chown ${user} ${cfg.dataDir} chown ${user} ${cfg.dataDir}
''; '';
exec = '' serviceConfig =
${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${user} \ {
-c '${quassel}/bin/quasselcore --listen=${cfg.interface}\ ExecStart = "${quassel}/bin/quasselcore --listen=${cfg.interface} --port=${toString cfg.portNumber} --configdir=${cfg.dataDir}";
--port=${toString cfg.portNumber} --configdir=${cfg.dataDir}' User = user;
''; PermissionsStartOnly = true;
};
}; };
}; };