From 427f8f1c28c58f7761508d51cb83ebbedade58c4 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Thu, 20 Oct 2022 11:45:00 -0700 Subject: [PATCH] move systemd configs to /usr/local/... --- install.sh | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index 50a052c..458de8e 100755 --- a/install.sh +++ b/install.sh @@ -134,14 +134,19 @@ else install --owner=vhost --group=vhost --mode=755 --directory /srv/www/html fi +# create local systemd dir, used by webalizer & jailkit +if [[ ! -d /usr/local/lib/systemd/system ]]; then + mkdir -p /usr/local/lib/systemd/system +fi + # Webalizer DEBIAN_FRONTEND=noninteractive apt-get -y install webalizer cp etc/logrotate.d/apache2 /etc/logrotate.d/apache2 chmod 644 /etc/logrotate.d/apache2 rm /etc/cron.daily/webalizer rmdir /srv/www/webalizer -cp systemd/webalizer.* /usr/lib/systemd/system/ -chmod 644 /usr/lib/systemd/system/webalizer.* +cp systemd/webalizer.* /usr/local/lib/systemd/system/ +chmod 644 /usr/local/lib/systemd/system/webalizer.* systemctl enable webalizer.timer systemctl start webalizer.timer @@ -189,15 +194,6 @@ echo "" >> /etc/jailkit/jk_init.ini echo "[ruby]" >> /etc/jailkit/jk_init.ini echo "comment = the ruby interpreter and libraries" >> /etc/jailkit/jk_init.ini echo "paths = /usr/bin/erb. /usr/bin/gem, /usr/bin/irb, /usr/bin/rdoc, /usr/bin/ri, /usr/bin/ruby, /usr/share/doc/ruby, /usr/share/man/man1/ruby.1.gz, /usr/lib/ruby/, /usr/lib/x86_64-linux-gnu/ruby/" >> /etc/jailkit/jk_init.ini - -# varnish -DEBIAN_FRONTEND=noninteractive apt-get -y install varnish -cp -a etc/varnish/* /etc/varnish/ -find /etc/varnish/ -type d -exec chmod 755 {} + -find /etc/varnish/ -type f -exec chmod 644 {} + -chown -R root:root /etc/varnish/ -## /usr/bin/varnishncsa - mkdir /usr/jails if ! [ -d "/usr/local/libexec" ]; then install --owner=root --group=root --mode=755 --directory /usr/local/libexec @@ -210,6 +206,17 @@ if ! [ -f "/etc/fstab.jails" ]; then chmod 644 /etc/fstab.jails echo "# /etc/fstab.jails: jail bind mounts information." > /etc/fstab.jails fi +cp systemd/jail-mounts.service /usr/local/lib/systemd/system/ +chmod 644 /usr/local/lib/systemd/system/jail-mounts.service +systemctl enable jail-mounts.service + +# varnish +DEBIAN_FRONTEND=noninteractive apt-get -y install varnish +cp -a etc/varnish/* /etc/varnish/ +find /etc/varnish/ -type d -exec chmod 755 {} + +find /etc/varnish/ -type f -exec chmod 644 {} + +chown -R root:root /etc/varnish/ +## /usr/bin/varnishncsa # mini_sendmail so users can send out of jails cd /usr/local/src