2020-01-31 21:25:33 +01:00
|
|
|
execute_process(COMMAND bash -euc "\
|
2020-01-31 18:00:51 +01:00
|
|
|
if ! getent group _cado >/dev/null 2>&1; then
|
|
|
|
groupadd \
|
|
|
|
--system \
|
|
|
|
_cado;
|
2020-01-31 20:13:00 +01:00
|
|
|
fi"
|
|
|
|
ERROR_QUIET OUTPUT_QUIET)
|
2020-01-31 21:25:33 +01:00
|
|
|
execute_process(COMMAND bash -euc "\
|
|
|
|
# get nologin path
|
|
|
|
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
|
|
NOLOGIN=\"\$(which nologin)\"
|
2020-01-31 18:00:51 +01:00
|
|
|
if ! getent passwd _cado >/dev/null 2>&1; then
|
|
|
|
useradd \
|
|
|
|
--no-create-home \
|
|
|
|
--home-dir /nonexistent \
|
|
|
|
--system \
|
2020-01-31 21:25:33 +01:00
|
|
|
--shell \"\$NOLOGIN\" \
|
2020-01-31 18:00:51 +01:00
|
|
|
-g _cado \
|
|
|
|
_cado;
|
2020-01-31 20:13:00 +01:00
|
|
|
fi"
|
|
|
|
ERROR_QUIET OUTPUT_QUIET)
|
|
|
|
execute_process(COMMAND mkdir -p ${CADO_SPOOL_DIR} ERROR_QUIET OUTPUT_QUIET)
|
|
|
|
execute_process(COMMAND chown root:_cado ${CADO_SPOOL_DIR} ERROR_QUIET OUTPUT_QUIET)
|
|
|
|
execute_process(COMMAND chmod 4770 ${CADO_SPOOL_DIR} ERROR_QUIET OUTPUT_QUIET)
|
|
|
|
execute_process(COMMAND chown :_cado ${BINDIR}/scado ERROR_QUIET OUTPUT_QUIET)
|
|
|
|
execute_process(COMMAND chmod g+s ${BINDIR}/scado ERROR_QUIET OUTPUT_QUIET)
|
|
|
|
execute_process(COMMAND chown _cado: ${BINDIR}/cado ERROR_QUIET OUTPUT_QUIET)
|
|
|
|
execute_process(COMMAND chmod u+s ${BINDIR}/cado ERROR_QUIET OUTPUT_QUIET)
|
|
|
|
execute_process(COMMAND ldconfig ${LIBDIR} ERROR_QUIET OUTPUT_QUIET)
|
|
|
|
execute_process(COMMAND ${BINDIR}/cado --setcap ERROR_QUIET OUTPUT_QUIET)
|