switch to hybrid

This commit is contained in:
aptalca 2022-08-26 12:30:09 -04:00
parent 05c92c2b1e
commit 60d4ea1368
17 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,8 @@
#!/usr/bin/with-contenv bash
if [ ! -f /usr/sbin/cron ] && [ -f /usr/bin/apt ]; then
echo "**** Adding cron to package install list ****"
echo "cron" >> /mod-repo-packages-to-install.list
else
echo "**** cron package already installed, skipping ****"
fi

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-universal-cron-add-package/run

View File

@ -0,0 +1,33 @@
#!/usr/bin/with-contenv bash
# make folders
mkdir -p \
/config/crontabs
# if root crontabs do not exist in config
# copy root crontab from system
if [[ ! -f /config/crontabs/root ]] && \
crontab -l -u root; then
crontab -l -u root > /config/crontabs/root
fi
# if root crontabs still do not exist in config (were not copied from system)
# copy root crontab from included defaults
[[ ! -f /config/crontabs/root ]] && \
cp /defaults/crontabs-mod/root /config/crontabs/
# if abc crontabs do not exist in config
# copy abc crontab from system
if [[ ! -f /config/crontabs/abc ]] && \
crontab -l -u abc; then
crontab -l -u abc > /config/crontabs/abc
fi
# if abc crontabs still do not exist in config (were not copied from system)
# copy abc crontab from included defaults
[[ ! -f /config/crontabs/abc ]] && \
cp /defaults/crontabs-mod/abc /config/crontabs/
# import user crontabs
crontab -u root /config/crontabs/root
crontab -u abc /config/crontabs/abc

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-universal-cron-setup/run

View File

@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bash
if [ -f /usr/bin/apt ]; then
# ubuntu
exec /usr/sbin/cron -f -L 1
elif [ -f /sbin/apk ]; then
# alpine
exec /usr/sbin/crond -f -S -l 5
fi

View File

@ -0,0 +1 @@
longrun

0
root/etc/services.d/cron/run Normal file → Executable file
View File