mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-08 14:40:07 +03:00
nixos/foundationdb: replace deprecated usage of PermissionsStartOnly
see https://github.com/NixOS/nixpkgs/issues/53852
This commit is contained in:
parent
1540a85458
commit
de6e5ea815
@ -359,6 +359,13 @@ in
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d /etc/foundationdb 0755 ${cfg.user} ${cfg.group} - -"
|
||||||
|
"d '${cfg.dataDir}' 0770 ${cfg.user} ${cfg.group} - -"
|
||||||
|
"d '${cfg.logDir}' 0770 ${cfg.user} ${cfg.group} - -"
|
||||||
|
"F '${cfg.pidFile}' - ${cfg.user} ${cfg.group} - -"
|
||||||
|
];
|
||||||
|
|
||||||
systemd.services.foundationdb = {
|
systemd.services.foundationdb = {
|
||||||
description = "FoundationDB Service";
|
description = "FoundationDB Service";
|
||||||
|
|
||||||
@ -396,25 +403,12 @@ in
|
|||||||
path = [ pkg pkgs.coreutils ];
|
path = [ pkg pkgs.coreutils ];
|
||||||
|
|
||||||
preStart = ''
|
preStart = ''
|
||||||
rm -f ${cfg.pidfile} && \
|
|
||||||
touch ${cfg.pidfile} && \
|
|
||||||
chown -R ${cfg.user}:${cfg.group} ${cfg.pidfile}
|
|
||||||
|
|
||||||
for x in "${cfg.logDir}" "${cfg.dataDir}"; do
|
|
||||||
[ ! -d "$x" ] && mkdir -m 0770 -vp "$x";
|
|
||||||
chown -R ${cfg.user}:${cfg.group} "$x";
|
|
||||||
done
|
|
||||||
|
|
||||||
[ ! -d /etc/foundationdb ] && \
|
|
||||||
mkdir -m 0775 -vp /etc/foundationdb && \
|
|
||||||
chown -R ${cfg.user}:${cfg.group} "/etc/foundationdb"
|
|
||||||
|
|
||||||
if [ ! -f /etc/foundationdb/fdb.cluster ]; then
|
if [ ! -f /etc/foundationdb/fdb.cluster ]; then
|
||||||
cf=/etc/foundationdb/fdb.cluster
|
cf=/etc/foundationdb/fdb.cluster
|
||||||
desc=$(tr -dc A-Za-z0-9 </dev/urandom 2>/dev/null | head -c8)
|
desc=$(tr -dc A-Za-z0-9 </dev/urandom 2>/dev/null | head -c8)
|
||||||
rand=$(tr -dc A-Za-z0-9 </dev/urandom 2>/dev/null | head -c8)
|
rand=$(tr -dc A-Za-z0-9 </dev/urandom 2>/dev/null | head -c8)
|
||||||
echo ''${desc}:''${rand}@${initialIpAddr}:${builtins.toString cfg.listenPortStart} > $cf
|
echo ''${desc}:''${rand}@${initialIpAddr}:${builtins.toString cfg.listenPortStart} > $cf
|
||||||
chmod 0664 $cf && chown -R ${cfg.user}:${cfg.group} $cf
|
chmod 0664 $cf
|
||||||
touch "${cfg.dataDir}/.first_startup"
|
touch "${cfg.dataDir}/.first_startup"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user