Skip to content

Instantly share code, notes, and snippets.

@wilbowma
Created March 27, 2016 23:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilbowma/3e6145c2cd4a29e88cd0 to your computer and use it in GitHub Desktop.
Save wilbowma/3e6145c2cd4a29e88cd0 to your computer and use it in GitHub Desktop.
_post_install_or_upgrade() {
touch /run/crond.reboot
touch /run/crond.bootdir
chown root:crontab /usr/lib/systemd-cron/crontab_setgid
chown root:crontab /var/spool/cron
chmod 2755 /usr/lib/systemd-cron/crontab_setgid
}
pre_install() {
getent group crontab >/dev/null 2>&1 || groupadd --system crontab >/dev/null
}
post_install() {
_post_install_or_upgrade
}
post_upgrade() {
_post_install_or_upgrade
}
post_remove() {
getent group crontab >/dev/null 2>&1 || groupdel crontab >/dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment