bosun: Create ledisDir in pre-start script
This commit is contained in:
parent
45bf78373e
commit
d6f9f13512
@ -129,15 +129,17 @@ in {
|
|||||||
description = "bosun metrics collector (part of Bosun)";
|
description = "bosun metrics collector (part of Bosun)";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
preStart =
|
preStart = ''
|
||||||
''
|
mkdir -p "$(dirname "${cfg.stateFile}")";
|
||||||
mkdir -p `dirname ${cfg.stateFile}`;
|
touch "${cfg.stateFile}"
|
||||||
touch ${cfg.stateFile}
|
touch "${cfg.stateFile}.tmp"
|
||||||
touch ${cfg.stateFile}.tmp
|
|
||||||
|
mkdir -p "${cfg.ledisDir}";
|
||||||
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" = 0 ]; then
|
||||||
chown ${cfg.user}:${cfg.group} ${cfg.stateFile}
|
chown ${cfg.user}:${cfg.group} "${cfg.stateFile}"
|
||||||
chown ${cfg.user}:${cfg.group} ${cfg.stateFile}.tmp
|
chown ${cfg.user}:${cfg.group} "${cfg.stateFile}.tmp"
|
||||||
|
chown ${cfg.user}:${cfg.group} "${cfg.ledisDir}"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user