Small fixes for build script and init script.
parent
8688046fbf
commit
3e16c6abc5
16
etc/build.py
16
etc/build.py
|
@ -125,12 +125,16 @@ def package_scripts(build_root, config_only=False, windows=False):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
logging.debug("Copying scripts to build directory.")
|
logging.debug("Copying scripts to build directory.")
|
||||||
shutil.copyfile(INIT_SCRIPT, os.path.join(build_root, SCRIPT_DIR[1:], INIT_SCRIPT.split('/')[1]))
|
files = [
|
||||||
os.chmod(os.path.join(build_root, SCRIPT_DIR[1:], INIT_SCRIPT.split('/')[1]), 0o644)
|
(INIT_SCRIPT, SCRIPT_DIR, "init.sh"),
|
||||||
shutil.copyfile(SYSTEMD_SCRIPT, os.path.join(build_root, SCRIPT_DIR[1:], SYSTEMD_SCRIPT.split('/')[1]))
|
(SYSTEMD_SCRIPT, SCRIPT_DIR, "chronograf.service"),
|
||||||
os.chmod(os.path.join(build_root, SCRIPT_DIR[1:], SYSTEMD_SCRIPT.split('/')[1]), 0o644)
|
(LOGROTATE_SCRIPT, LOGROTATE_DIR, "chronograf")
|
||||||
shutil.copyfile(LOGROTATE_SCRIPT, os.path.join(build_root, LOGROTATE_DIR[1:], "chronograf"))
|
]
|
||||||
os.chmod(os.path.join(build_root, LOGROTATE_DIR[1:], "chronograf"), 0o644)
|
for script, dir, name in files:
|
||||||
|
dest = os.path.join(build_root, dir[1:], name)
|
||||||
|
logging.debug("Moving {} to {}".format(script, dest))
|
||||||
|
shutil.copyfile(script, dest)
|
||||||
|
os.chmod(dest, 0o644)
|
||||||
|
|
||||||
def run_generate():
|
def run_generate():
|
||||||
"""Generate static assets.
|
"""Generate static assets.
|
||||||
|
|
|
@ -32,7 +32,7 @@ start() {
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
local CMD="$SCRIPT $SCRIPT_OPTS 2>&1 1>> \"$LOGFILE\" & echo \$!"
|
local CMD="$SCRIPT $SCRIPT_OPTS 1>>\"$LOGFILE\" 2>&1 & echo \$!"
|
||||||
su -s /bin/sh -c "$CMD" $RUNAS > "$PIDFILE"
|
su -s /bin/sh -c "$CMD" $RUNAS > "$PIDFILE"
|
||||||
if [[ -f $PIDFILE ]]; then
|
if [[ -f $PIDFILE ]]; then
|
||||||
# PIDFILE exists
|
# PIDFILE exists
|
||||||
|
|
Loading…
Reference in New Issue