File: postinst

package info (click to toggle)
systemd-cron 1.5.14-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 300 kB
  • sloc: python: 928; sh: 320; makefile: 209; ansic: 116
file content (34 lines) | stat: -rw-r--r-- 936 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

set -e

if [ "$1" != configure ]; then
    exit 0
fi

# Add group for crontabs
getent group crontab > /dev/null 2>&1 || addgroup --system crontab

# Fixup crontab binary for new group 'crontab'.
if ! dpkg-statoverride --list /lib/systemd-cron/crontab_setgid > /dev/null ; then
    dpkg-statoverride --update --add root crontab 2755 /lib/systemd-cron/crontab_setgid
fi

# Remove leftover setgid bit from Vixie-cron
if dpkg-statoverride --list /usr/bin/crontab > /dev/null ; then
    dpkg-statoverride --remove /usr/bin/crontab
    chown root:root /usr/bin/crontab
    chmod 0755 /usr/bin/crontab
fi

# Fixup crontab , directory and files for new group 'crontab'
mkdir -p /var/spool/cron/crontabs
chown root:crontab /var/spool/cron/crontabs
chmod 1730 /var/spool/cron/crontabs
cd /var/spool/cron/crontabs
set +e
ls -1 | xargs -r -n 1 --replace=xxx  chown 'xxx:crontab' 'xxx'
ls -1 | xargs -r -n 1 chmod 600
set -e

#DEBHELPER#