mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-24 11:45:18 +03:00
Add pre-install script to create step-ca user and group. Add init.d, conf.d, and logrotate files.
45 lines
1.1 KiB
Text
45 lines
1.1 KiB
Text
#!/sbin/openrc-run
|
|
|
|
description="Step CA"
|
|
description_check="Verify configuration"
|
|
|
|
pidfile="/run/$RC_SVCNAME.pid"
|
|
command="/usr/bin/step-ca"
|
|
command_args="/etc/step-ca/config/ca.json --password-file=/etc/step-ca/password.txt"
|
|
command_background="yes"
|
|
command_user="step-ca:step-ca"
|
|
start_stop_daemon_args="--stdout /var/log/$RC_SVCNAME/${RC_SVCNAME}.log --stderr /var/log/$RC_SVCNAME/${RC_SVCNAME}.err"
|
|
extra_commands="checkconfig"
|
|
|
|
required_files="/etc/step-ca/config/ca.json /etc/step-ca/password.txt"
|
|
|
|
depend() {
|
|
use logger dns
|
|
after entropy networking
|
|
}
|
|
|
|
start_pre() {
|
|
checkconfig
|
|
|
|
command_args="${command_args} ${EXTRA_ARGS}"
|
|
|
|
if [ "x${ENTROPY_COUNT}" != "x" ]; then
|
|
command_args="${command_args} -e ${ENTROPY_COUNT}"
|
|
fi
|
|
}
|
|
|
|
checkconfig() {
|
|
if [ ! -d /var/log/step-ca ]; then
|
|
mkdir -p /var/log/step-ca
|
|
chown step-ca:step-ca /var/log/step-ca
|
|
chmod 700 /var/log/step-ca
|
|
fi
|
|
|
|
if [ ! -f /etc/step-ca/config/ca.json ]; then
|
|
ewarn "CA configuration file is missing"
|
|
fi
|
|
|
|
if [ ! -f /etc/step-ca/password.txt ]; then
|
|
ewarn "CA password file is missing"
|
|
fi
|
|
}
|