nixos/redis: move 'redis_init.service' into the preStart hook of 'redis.service'
This commit is contained in:
parent
5a81797119
commit
28dee92fff
@ -224,26 +224,17 @@ in
|
||||
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
systemd.services.redis_init =
|
||||
{ description = "Redis Server Initialisation";
|
||||
|
||||
wantedBy = [ "redis.service" ];
|
||||
before = [ "redis.service" ];
|
||||
|
||||
serviceConfig.Type = "oneshot";
|
||||
|
||||
script = ''
|
||||
install -d -m0700 -o ${cfg.user} ${cfg.dbpath}
|
||||
chown -R ${cfg.user} ${cfg.dbpath}
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.services.redis =
|
||||
{ description = "Redis Server";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
|
||||
preStart = ''
|
||||
install -d -m0700 -o ${cfg.user} ${cfg.dbpath}
|
||||
chown -R ${cfg.user} ${cfg.dbpath}
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${cfg.package}/bin/redis-server ${redisConfig}";
|
||||
User = cfg.user;
|
||||
|
Loading…
Reference in New Issue
Block a user