From 8c64644a93da56b8839414aeef8682ce16e88759 Mon Sep 17 00:00:00 2001 From: Gardais Jeremy Date: Tue, 5 Sep 2017 14:54:46 +0200 Subject: [PATCH] Add a copy of post.sh to ensure Debian before Stretch keep launch a working post-install script (see #12). --- preseed/debian/jessie/preseed.cfg | 2 +- preseed/debian/jessie/preseed_cinnamon.cfg | 2 +- preseed/debian/jessie/preseed_gnome.cfg | 2 +- preseed/debian/jessie/preseed_mate.cfg | 2 +- preseed/debian/wheezy/preseed.cfg | 2 +- preseed/debian/wheezy/preseed_cluster.cfg | 2 +- preseed/debian/wheezy/preseed_gnome.cfg | 2 +- scripts/latecommand.tar.gz | Bin 2582 -> 3520 bytes scripts/latecommand/logrotate.jessie/aptitude | 8 ++ scripts/latecommand/logrotate.jessie/dpkg | 22 +++++ .../logrotate.jessie/logrotate.conf | 43 +++++++++ scripts/latecommand/logrotate.jessie/rsyslog | 76 ++++++++++++++++ scripts/latecommand/post.jessie.sh | 84 ++++++++++++++++++ .../latecommand/rsyslog.jessie/99syslog.conf | 28 ++++++ .../latecommand/rsyslog.jessie/rsyslog.conf | 61 +++++++++++++ 15 files changed, 329 insertions(+), 7 deletions(-) create mode 100644 scripts/latecommand/logrotate.jessie/aptitude create mode 100644 scripts/latecommand/logrotate.jessie/dpkg create mode 100644 scripts/latecommand/logrotate.jessie/logrotate.conf create mode 100644 scripts/latecommand/logrotate.jessie/rsyslog create mode 100755 scripts/latecommand/post.jessie.sh create mode 100644 scripts/latecommand/rsyslog.jessie/99syslog.conf create mode 100644 scripts/latecommand/rsyslog.jessie/rsyslog.conf diff --git a/preseed/debian/jessie/preseed.cfg b/preseed/debian/jessie/preseed.cfg index 95f7980..0222826 100644 --- a/preseed/debian/jessie/preseed.cfg +++ b/preseed/debian/jessie/preseed.cfg @@ -358,5 +358,5 @@ in-target /bin/rmdir /mnt/free ; in-target /bin/sed -i '/lv_free/d' /etc/fstab ; in-target /bin/sed -i 's/without-password/yes/g' /etc/ssh/sshd_config ; \ in-target /usr/bin/tftp 129.20.203.27 -c get scripts/latecommand.tar.gz /tmp/latecommand.tar.gz ; \ in-target tar xzf /tmp/latecommand.tar.gz -C /tmp/ ; \ -in-target /bin/sh /tmp/latecommand/post.sh +in-target /bin/sh /tmp/latecommand/post.jessie.sh diff --git a/preseed/debian/jessie/preseed_cinnamon.cfg b/preseed/debian/jessie/preseed_cinnamon.cfg index e9d9a92..2b31ce2 100644 --- a/preseed/debian/jessie/preseed_cinnamon.cfg +++ b/preseed/debian/jessie/preseed_cinnamon.cfg @@ -349,5 +349,5 @@ in-target /bin/rmdir /mnt/free ; in-target /bin/sed -i '/lv_free/d' /etc/fstab ; in-target /bin/sed -i 's/without-password/yes/g' /etc/ssh/sshd_config ; \ in-target /usr/bin/tftp 129.20.203.27 -c get scripts/latecommand.tar.gz /tmp/latecommand.tar.gz ; \ in-target tar xzf /tmp/latecommand.tar.gz -C /tmp/ ; \ -in-target /bin/sh /tmp/latecommand/post.sh +in-target /bin/sh /tmp/latecommand/post.jessie.sh diff --git a/preseed/debian/jessie/preseed_gnome.cfg b/preseed/debian/jessie/preseed_gnome.cfg index cf552bf..9a0cc99 100644 --- a/preseed/debian/jessie/preseed_gnome.cfg +++ b/preseed/debian/jessie/preseed_gnome.cfg @@ -349,5 +349,5 @@ in-target /bin/rmdir /mnt/free ; in-target /bin/sed -i '/lv_free/d' /etc/fstab ; in-target /bin/sed -i 's/without-password/yes/g' /etc/ssh/sshd_config ; \ in-target /usr/bin/tftp 129.20.203.27 -c get scripts/latecommand.tar.gz /tmp/latecommand.tar.gz ; \ in-target tar xzf /tmp/latecommand.tar.gz -C /tmp/ ; \ -in-target /bin/sh /tmp/latecommand/post.sh +in-target /bin/sh /tmp/latecommand/post.jessie.sh diff --git a/preseed/debian/jessie/preseed_mate.cfg b/preseed/debian/jessie/preseed_mate.cfg index cc2de01..ff5ca47 100644 --- a/preseed/debian/jessie/preseed_mate.cfg +++ b/preseed/debian/jessie/preseed_mate.cfg @@ -349,5 +349,5 @@ in-target /bin/rmdir /mnt/free ; in-target /bin/sed -i '/lv_free/d' /etc/fstab ; in-target /bin/sed -i 's/without-password/yes/g' /etc/ssh/sshd_config ; \ in-target /usr/bin/tftp 129.20.203.27 -c get scripts/latecommand.tar.gz /tmp/latecommand.tar.gz ; \ in-target tar xzf /tmp/latecommand.tar.gz -C /tmp/ ; \ -in-target /bin/sh /tmp/latecommand/post.sh +in-target /bin/sh /tmp/latecommand/post.jessie.sh diff --git a/preseed/debian/wheezy/preseed.cfg b/preseed/debian/wheezy/preseed.cfg index b2e8d17..c82a9ee 100644 --- a/preseed/debian/wheezy/preseed.cfg +++ b/preseed/debian/wheezy/preseed.cfg @@ -355,5 +355,5 @@ in-target /bin/rmdir /mnt/free ; in-target /bin/sed -i '/lv_free/d' /etc/fstab ; in-target /bin/sed -i 's/without-password/yes/g' /etc/ssh/sshd_config ; \ in-target /usr/bin/tftp 129.20.203.27 -c get scripts/latecommand.tar.gz /tmp/latecommand.tar.gz ; \ in-target tar xzf /tmp/latecommand.tar.gz -C /tmp/ ; \ -in-target /bin/sh /tmp/latecommand/post.sh +in-target /bin/sh /tmp/latecommand/post.jessie.sh diff --git a/preseed/debian/wheezy/preseed_cluster.cfg b/preseed/debian/wheezy/preseed_cluster.cfg index 6114d17..5683ee5 100644 --- a/preseed/debian/wheezy/preseed_cluster.cfg +++ b/preseed/debian/wheezy/preseed_cluster.cfg @@ -336,5 +336,5 @@ in-target /bin/rmdir /mnt/workl ; in-target /bin/sed -i '/lv_workl/d' /etc/fstab in-target /bin/sed -i 's/without-password/yes/g' /etc/ssh/sshd_config ; \ in-target /usr/bin/tftp 129.20.203.27 -c get scripts/latecommand.tar.gz /tmp/latecommand.tar.gz ; \ in-target tar xzf /tmp/latecommand.tar.gz -C /tmp/ ; \ -in-target /bin/sh /tmp/latecommand/post.sh +in-target /bin/sh /tmp/latecommand/post.jessie.sh diff --git a/preseed/debian/wheezy/preseed_gnome.cfg b/preseed/debian/wheezy/preseed_gnome.cfg index 51e6453..3749a1e 100644 --- a/preseed/debian/wheezy/preseed_gnome.cfg +++ b/preseed/debian/wheezy/preseed_gnome.cfg @@ -346,5 +346,5 @@ in-target /bin/rmdir /mnt/free ; in-target /bin/sed -i '/lv_free/d' /etc/fstab ; in-target /bin/sed -i 's/without-password/yes/g' /etc/ssh/sshd_config ; \ in-target /usr/bin/tftp 129.20.203.27 -c get scripts/latecommand.tar.gz /tmp/latecommand.tar.gz ; \ in-target tar xzf /tmp/latecommand.tar.gz -C /tmp/ ; \ -in-target /bin/sh /tmp/latecommand/post.sh +in-target /bin/sh /tmp/latecommand/post.jessie.sh diff --git a/scripts/latecommand.tar.gz b/scripts/latecommand.tar.gz index 56b76301d00226be990b1bd891a265c5b9b6e109..91ad9dd3ffadb3db617fc5ccc5e86a0e699275aa 100644 GIT binary patch literal 3520 zcmV;x4L|Z9iwFRBu&!AE1MM7ZZ`;T*U(H`Jl?~K3EbA@dE^vV~jt@bcOJF-a6m1dE zhatSVJTjvYVU(+AfU(%W7YxxkRTofhOaBvq<QWH`k6oKvoJo&(8x^L>%D!g^i z|Da$i=kJT9u=#B3a59(2It;c(UY_Xj8& z`SYKQ@B_NrV7?B%^Yh;a=&-=ZojJgB{MVX=z8+ZIg{fsTm~tNyBn_!vbDx3b;%z6w zng@aRW2bX(Ev(aQG^b;^CVM#b=3YnJCqjY?9Ly;WAQ(%YcS7NJ#9a4T$K>hc+H^e+ z96P!3o@RSWcQj4gFM_-Suiu=%yL@pC>76`|=5RB#*`dvK^Q>h#;e+7DqICrO;Q9Q{ zGMNAodLH)!xdk>ibQ_R;z#RNCn_2FxIK~3+;|QRRv0%Q-?1Um2Qrj<(I=WBHRmyhz z^|Py2?KU_}2z|!D&^`UuvaMi=i_Y-goxg=>Tfk=q^Jq^?(Jl|m0z^E9OZWe}J4bfr!bou75&o1Ho<<*PlH!uIT^4L^5oa{Tn zAnHSSM6GFR?Q_$o@uURy% z8Igj=e8&(qBn@;rgxzCXOYi=??Guzb; z&M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T574KmR>^t0ePLt!T?YJ06>5pg8%>k diff --git a/scripts/latecommand/logrotate.jessie/aptitude b/scripts/latecommand/logrotate.jessie/aptitude new file mode 100644 index 0000000..25cbff8 --- /dev/null +++ b/scripts/latecommand/logrotate.jessie/aptitude @@ -0,0 +1,8 @@ +/var/log/aptitude { + rotate 6 + weekly + compress + missingok + notifempty + olddir /var/log/old_logs +} diff --git a/scripts/latecommand/logrotate.jessie/dpkg b/scripts/latecommand/logrotate.jessie/dpkg new file mode 100644 index 0000000..933457d --- /dev/null +++ b/scripts/latecommand/logrotate.jessie/dpkg @@ -0,0 +1,22 @@ +/var/log/dpkg.log { + weekly + rotate 12 + compress + delaycompress + missingok + notifempty + create 644 root root + olddir /var/log/old_logs +} + +/var/log/alternatives.log { + weekly + rotate 12 + compress + delaycompress + missingok + notifempty + create 644 root root + olddir /var/log/old_logs +} + diff --git a/scripts/latecommand/logrotate.jessie/logrotate.conf b/scripts/latecommand/logrotate.jessie/logrotate.conf new file mode 100644 index 0000000..446156b --- /dev/null +++ b/scripts/latecommand/logrotate.jessie/logrotate.conf @@ -0,0 +1,43 @@ +# see "man logrotate" for details +# rotate log files weekly +weekly + +# keep 4 weeks worth of backlogs +rotate 4 + +# create new (empty) log files after rotating old ones +create + +# uncomment this if you want your log files compressed +compress + +# compress only from the second log file +delaycompress + +# use date as a suffix of the rotated file +dateext + +# packages drop log rotation information into this directory +include /etc/logrotate.d + +# no packages own wtmp, or btmp -- we'll rotate them here +/var/log/wtmp { + missingok + notifempty + monthly + create 0664 root utmp + olddir /var/log/old_logs + rotate 3 +} + +/var/log/btmp { + missingok + notifempty + monthly + create 0664 root utmp + olddir /var/log/old_logs + rotate 3 +} + +# system-specific logs may be configured here +# See /etc/logrotate.d/rsyslog diff --git a/scripts/latecommand/logrotate.jessie/rsyslog b/scripts/latecommand/logrotate.jessie/rsyslog new file mode 100644 index 0000000..a1c5859 --- /dev/null +++ b/scripts/latecommand/logrotate.jessie/rsyslog @@ -0,0 +1,76 @@ +# Ensure to rotate all log files (old and new logpath from Rsyslog) + +/var/log/syslog/syslog +/var/log/syslog/syslog.log +/var/log/syslog/daemon.log +/var/log/syslog/local0.log +/var/log/syslog/local1.log +/var/log/syslog/local2.log +/var/log/syslog/local3.log +/var/log/syslog/local4.log +/var/log/syslog/local5.log +/var/log/syslog/local6.log +/var/log/syslog/local7.log +/var/log/syslog/uucp.log +/var/log/syslog +/var/log/syslog.log +/var/log/daemon.log +/var/log/local0.log +/var/log/local1.log +/var/log/local2.log +/var/log/local3.log +/var/log/local4.log +/var/log/local5.log +/var/log/local6.log +/var/log/local7.log +/var/log/uucp.log +{ + rotate 7 + daily + missingok + notifempty + compress + delaycompress + postrotate + invoke-rc.d rsyslog rotate > /dev/null + endscript +} + +/var/log/cron/cron.log +/var/log/cron/mark.log +/var/log/kernel/kern.log +/var/log/kernel/kernel.log +/var/log/lpr/lpr.log +/var/log/mail/*.log +/var/log/security/auth.log +/var/log/security/authpriv.log +/var/log/security/user.log +/var/log/messages/messages +/var/log/news/news.log +/var/log/cron.log +/var/log/mark.log +/var/log/kern.log +/var/log/kernel.log +/var/log/lpr.log +/var/log/mail.log +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/auth.log +/var/log/authpriv.log +/var/log/user.log +/var/log/messages +/var/log/debug +{ + rotate 4 + maxsize 250k + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + invoke-rc.d rsyslog rotate > /dev/null + endscript +} diff --git a/scripts/latecommand/post.jessie.sh b/scripts/latecommand/post.jessie.sh new file mode 100755 index 0000000..41fd0d3 --- /dev/null +++ b/scripts/latecommand/post.jessie.sh @@ -0,0 +1,84 @@ +#!/bin/sh + +RSYSLOGD_CONF="$(dirname $0)/rsyslog.jessie/rsyslog.conf" +RSYSLOGD_FILE="/etc/rsyslog.conf" +RSYSLOGD_SYSLOG_CONF="$(dirname $0)/rsyslog.jessie/99syslog.conf" +RSYSLOGD_SYSLOG_FILE="/etc/rsyslog.d/99syslog.conf" + +LOGROTATE_CONF="$(dirname $0)/logrotate.jessie/logrotate.conf" +LOGROTATE_FILE="/etc/logrotate.conf" +LOGROTATE_SYSLOG_CONF="$(dirname $0)/logrotate.jessie/rsyslog" +LOGROTATE_SYSLOG_FILE="/etc/logrotate.d/rsyslog" +LOGROTATE_APTITUDE_CONF="$(dirname $0)/logrotate.jessie/aptitude" +LOGROTATE_APTITUDE_FILE="/etc/logrotate.d/aptitude" +LOGROTATE_DPKG_CONF="$(dirname $0)/logrotate.jessie/dpkg" +LOGROTATE_DPKG_FILE="/etc/logrotate.d/dpkg" + +### Rsyslog ### + +# Install new Rsyslog configuration +if [ -f "${RSYSLOGD_FILE}" ]; then + cp "${RSYSLOGD_CONF}" "${RSYSLOGD_FILE}" +fi +cp "${RSYSLOGD_SYSLOG_CONF}" "${RSYSLOGD_SYSLOG_FILE}" + +# Remove old log files +## Kernel log files +rm -f /var/log/kern.log +## Authentication log files +rm -f /var/log/user.log /var/log/auth.log +## Mail log files +rm -f /var/log/mail.err /var/log/mail.info /var/log/mail.log /var/log/mail.warn +## System log files +rm -f /var/log/daemon.log /var/log/syslog /var/log/messages + +# Restart Rsyslog service +/etc/init.d/rsyslog restart + +### Logrotate {{{ + +# Install new Logrotate configuration +if [ -f "${LOGROTATE_FILE}" ]; then + cp "${LOGROTATE_CONF}" "${LOGROTATE_FILE}" +fi +cp "${LOGROTATE_SYSLOG_CONF}" "${LOGROTATE_SYSLOG_FILE}" +cp "${LOGROTATE_APTITUDE_CONF}" "${LOGROTATE_APTITUDE_FILE}" +cp "${LOGROTATE_DPKG_CONF}" "${LOGROTATE_DPKG_FILE}" + +# Create an archive directory for some log files (aptitude, dpkg,…) +mkdir -p -- /var/log/old_logs + +# Create the log directory for journald (Systemd), need the configuration Storage=(auto|persistent) +mkdir -p -- /var/log/journal +### }}} + +## Packages {{{ +# Ensure to have some basic packages +apt -y install aptitude tmux zsh + +# Remove NFS and rpcbind +aptitude -y remove nfs-common rpcbind + +### Tasksel {{{ + +if [ "$(dpkg -l task-french)" ]; then + # Move default wordlist to american before remove all packages + select-default-wordlist --set-default=american + aptitude -y remove tasksel tasksel-data task-english task-french task-ssh-server laptop-detect + + # Reinstall useful french doc and move back to french dict + aptitude -y install aspell-fr doc-debian-fr doc-linux-fr-text ifrench-gut manpages-fr manpages-fr-extra wfrench + select-default-wordlist --set-default=".*(F|f)rench.*" + +else + aptitude -y remove tasksel tasksel-data task-english task-ssh-server laptop-detect +fi + +### }}} + +# Ensure to reinstall openssh-server +aptitude -y install openssh-server openssh-sftp-server + +## }}} + +exit 0 diff --git a/scripts/latecommand/rsyslog.jessie/99syslog.conf b/scripts/latecommand/rsyslog.jessie/99syslog.conf new file mode 100644 index 0000000..6267bb0 --- /dev/null +++ b/scripts/latecommand/rsyslog.jessie/99syslog.conf @@ -0,0 +1,28 @@ +# Default rules for rsyslog. +# +# For more information see rsyslog.conf(5) and /etc/rsyslog.conf +#---------------------------------------------------------------------------- +# Fichier de configuration du daemon syslogd +#---------------------------------------------------------------------------- +kern.* /var/log/kernel/kernel.log +user.* /var/log/security/user.log +mail.* /var/log/mail/mail.log +daemon.* /var/log/syslog/daemon.log +auth.* /var/log/security/auth.log +lpr.* /var/log/lpr/lpr.log +news.* /var/log/news/news.log +uucp.* /var/log/syslog/uucp.log +cron.* /var/log/cron/cron.log +mark.* /var/log/cron/mark.log +local0.* /var/log/syslog/local0.log +local1.* /var/log/syslog/local1.log +local2.* /var/log/syslog/local2.log +local3.* /var/log/syslog/local3.log +local4.* /var/log/syslog/local4.log +local5.* /var/log/syslog/local5.log +local6.* /var/log/syslog/local6.log +local7.* /var/log/syslog/local7.log +syslog.* /var/log/syslog/syslog.log +authpriv.* /var/log/security/authpriv.log +*.=info;*.=notice /var/log/messages/messages + diff --git a/scripts/latecommand/rsyslog.jessie/rsyslog.conf b/scripts/latecommand/rsyslog.jessie/rsyslog.conf new file mode 100644 index 0000000..85967ca --- /dev/null +++ b/scripts/latecommand/rsyslog.jessie/rsyslog.conf @@ -0,0 +1,61 @@ +# /etc/rsyslog.conf Configuration file for rsyslog. +# More information http://wiki.rsyslog.com/index.php/ +# +# For more information see +# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html + + +################# +#### MODULES #### +################# + +$ModLoad imuxsock # provides support for local system logging +$ModLoad imklog # provides kernel logging support +#$ModLoad immark # provides --MARK-- message capability + +$KLogPath /proc/kmsg + +# provides UDP syslog reception +#$ModLoad imudp +#$UDPServerRun 514 + +# provides TCP syslog reception +#$ModLoad imtcp +#$InputTCPServerRun 514 + +########################### +#### GLOBAL DIRECTIVES #### +########################### + +# +# Use traditional timestamp format. +# To enable high precision timestamps, comment out the following line. +# +$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +# Filter duplicated messages +$RepeatedMsgReduction on + +# +# Set the default permissions for all log files. +# +$FileOwner root +$FileGroup adm +$FileCreateMode 0640 +$DirCreateMode 0755 +$Umask 0022 + +# +# Where to place spool and state files +# +$WorkDirectory /var/spool/rsyslog + +# +# Include all config files in /etc/rsyslog.d/ +# +$IncludeConfig /etc/rsyslog.d/*.conf + +############### +#### RULES #### +############### +# See /etc/rsyslog.d/99syslog.conf