quassel: make a proper systemd unit (also properly works in containers now)
This commit is contained in:
parent
7885c2ed12
commit
cf4a976ced
@ -74,21 +74,23 @@ in
|
||||
gid = config.ids.gids.quassel;
|
||||
}];
|
||||
|
||||
jobs.quassel =
|
||||
systemd.services.quassel =
|
||||
{ description = "Quassel IRC client daemon";
|
||||
|
||||
startOn = "ip-up";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
|
||||
preStart = ''
|
||||
mkdir -p ${cfg.dataDir}
|
||||
chown ${user} ${cfg.dataDir}
|
||||
mkdir -p ${cfg.dataDir}
|
||||
chown ${user} ${cfg.dataDir}
|
||||
'';
|
||||
|
||||
exec = ''
|
||||
${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${user} \
|
||||
-c '${quassel}/bin/quasselcore --listen=${cfg.interface}\
|
||||
--port=${toString cfg.portNumber} --configdir=${cfg.dataDir}'
|
||||
'';
|
||||
serviceConfig =
|
||||
{
|
||||
ExecStart = "${quassel}/bin/quasselcore --listen=${cfg.interface} --port=${toString cfg.portNumber} --configdir=${cfg.dataDir}";
|
||||
User = user;
|
||||
PermissionsStartOnly = true;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user