/usr/share/ltsp/scripts/popularity-contest-ltsp is in ltsp-server 5.5.7-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 35 36 37 | #!/bin/sh
# install this in the server's cron.daily to have the terminal chroot
# filesystems submit popularity-contest data
# it requires installing popularity-contest in each chroot, preferrably
# configured to use HTTP POST, introduced in popularity-contest 1.30, as this
# avoids the need for working mail in the chroot environment.
# change this if you have chroots in other locations
BASE="/opt/ltsp"
for base in $BASE ; do
if [ -d "$BASE" ]; then
# find all the top-level directories in $BASE
for dir in $(find -L "$BASE/" -mindepth 1 -maxdepth 1 -type d ! -name images); do
# only do the following if popularity-contest is installed,
# /bin/true exists and returns true (in case of architecture mis-match),
# and chroot is available
if [ -x $dir/bin/true ] && [ $dir/bin/true ] && [ -n "$(which chroot)" ] ; then
# check for presence of cron.daily or cron.weekly script, and
# run the first one found (popcon 1.45+ runs from cron.daily)
for frequency in daily weekly ; do
script="/etc/cron.$frequency/popularity-contest"
if [ -x "$dir/$script" ]; then
if [ "$frequency" = "weekly" ] && [ "$(date +%w)" != "0" ]; then
# only run cron.weekly script once a week
break
fi
chroot $dir $script
break
fi
done
fi
done
fi
done
|