#!/bin/sh # postinst script for bcron. # # See: dh_installdeb(1). set -e CRONTABDIR=/var/spool/cron/crontabs case "$1" in configure) # create user cron now when it doe not exist # this may bypass bcron.sysuser getent passwd cron || adduser --system --group --home /var/spool/cron cron # add acls for user and group cron setfacl -m u:cron:rwx $CRONTABDIR setfacl -m g:cron:rwx $CRONTABDIR for f in $(find $CRONTABDIR -mindepth 1 -maxdepth 1); do setfacl -m u:cron:rw $f setfacl -m g:cron:rw $f done ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument '$1'" >&2 exit 1 ;; esac # Automatically added by dh_sysuser/UNDECLARED # -*- sh -*- CONF_HOME=/var/spool/cron CONF_PACKAGE=bcron CONF_USERNAME=cron /lib/sysuser-helper/sysuser-helper postinst "$@" # End automatically added section # Automatically added by dh_runit/2.15.0 # Unlike postrm, I can be sure, that runit-helper is present on # postinst. if [ -z "${DPKG_ROOT:-}" ] ; then NAME='bcron-sched' ENABLE='yes' ONUPGRADE='restart' /lib/runit-helper/runit-helper postinst "$@" fi # End automatically added section # Automatically added by dh_runit/2.15.0 # Unlike postrm, I can be sure, that runit-helper is present on # postinst. if [ -z "${DPKG_ROOT:-}" ] ; then NAME='bcron-spool' ENABLE='yes' ONUPGRADE='restart' /lib/runit-helper/runit-helper postinst "$@" fi # End automatically added section # Automatically added by dh_runit/2.15.0 # Unlike postrm, I can be sure, that runit-helper is present on # postinst. if [ -z "${DPKG_ROOT:-}" ] ; then NAME='bcron-update' ENABLE='yes' ONUPGRADE='restart' /lib/runit-helper/runit-helper postinst "$@" fi # End automatically added section # Automatically added by dh_installinit/13.11.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/bcron-update" ]; then update-rc.d bcron-update defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi invoke-rc.d --skip-systemd-native bcron-update $_dh_action || exit 1 fi fi # End automatically added section # Automatically added by dh_installinit/13.11.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/bcron-sched" ]; then update-rc.d bcron-sched defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi invoke-rc.d --skip-systemd-native bcron-sched $_dh_action || exit 1 fi fi # End automatically added section # Automatically added by dh_installinit/13.11.1 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/bcron-spool" ]; then update-rc.d bcron-spool defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi invoke-rc.d --skip-systemd-native bcron-spool $_dh_action || exit 1 fi fi # End automatically added section exit 0