From c4c9b5dd6c6312478fcac5eb02e51375bfed7b59 Mon Sep 17 00:00:00 2001 From: Vincent BENOIT Date: Tue, 22 Nov 2022 10:45:12 +0100 Subject: [PATCH] =?UTF-8?q?ajout=20de=20nouveaux=20fichiers=20de=20configu?= =?UTF-8?q?ration=20du=20syst=C3=A8me=20RPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kinerpisys-1.0.0/debian/install | 3 + kinerpisys-1.0.0/debian/kinerpisys.postinst | 51 ++++++++++++++ kinerpisys-1.0.0/dhcpcd.conf | 26 +------ kinerpisys-1.0.0/dnsmasq.conf | 2 +- kinerpisys-1.0.0/logrotate.conf | 73 ++++++++++++++++++++ kinerpisys-1.0.0/rsyslog.conf | 75 +++++++++++++++++++++ 6 files changed, 204 insertions(+), 26 deletions(-) create mode 100644 kinerpisys-1.0.0/debian/kinerpisys.postinst create mode 100644 kinerpisys-1.0.0/logrotate.conf create mode 100644 kinerpisys-1.0.0/rsyslog.conf diff --git a/kinerpisys-1.0.0/debian/install b/kinerpisys-1.0.0/debian/install index 9dd0c1c..5605954 100644 --- a/kinerpisys-1.0.0/debian/install +++ b/kinerpisys-1.0.0/debian/install @@ -1,5 +1,8 @@ dhcpcd.conf /etc/ dnsmasq.conf /etc/ hostapd.conf /etc/hostapd/ +hostapd /etc/default/ +logrotate.conf /etc/ +rsyslog.conf /etc/ hostname /etc/ hosts /etc/ diff --git a/kinerpisys-1.0.0/debian/kinerpisys.postinst b/kinerpisys-1.0.0/debian/kinerpisys.postinst new file mode 100644 index 0000000..4836d3a --- /dev/null +++ b/kinerpisys-1.0.0/debian/kinerpisys.postinst @@ -0,0 +1,51 @@ +#!/bin/sh +# postinst script for sclesignrestfulmisc +# +# see: dh_installdeb(1) + +set -e +user="root" + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +userpi="pi" + +# Restart service +# RSYSLOG +ret=$(/usr/bin/systemctl is-enabled rsyslog.service) +if [ "$ret" = "disabled" ]; then + /usr/bin/systemctl enable rsyslog.service +fi +/usr/bin/systemctl restart rsyslog.service + +# LOGROTATE +ret=$(/usr/bin/systemctl is-enabled logrotate.service) +if [ "$ret" = "disabled" ]; then + /usr/bin/systemctl enable logrotate.service +fi +/usr/bin/systemctl restart logrotate.service + +# DHCPCD +ret=$(/usr/bin/systemctl is-enabled dhcpcd.service) +if [ "$ret" = "disabled" ]; then + /usr/bin/systemctl enable dhcpcd.service +fi +/usr/bin/systemctl restart dhcpcd.service + +# DNSMASQ +ret=$(/usr/bin/systemctl is-enabled dnsmasq.service) +if [ "$ret" = "disabled" ]; then + /usr/bin/systemctl enable dnsmasq.service +fi +/usr/bin/systemctl restart dnsmasq.service + +# HOSTAPD +/usr/bin/systemctl unmask hostapd.service +ret=$(/usr/bin/systemctl is-enabled hostapd.service) +if [ "$ret" = "disabled" ]; then + /usr/bin/systemctl enable hostapd.service +fi +/usr/bin/systemctl restart hostapd.service diff --git a/kinerpisys-1.0.0/dhcpcd.conf b/kinerpisys-1.0.0/dhcpcd.conf index d5dca1f..bd9f474 100644 --- a/kinerpisys-1.0.0/dhcpcd.conf +++ b/kinerpisys-1.0.0/dhcpcd.conf @@ -1,19 +1,11 @@ # A sample configuration for dhcpcd. # See dhcpcd.conf(5) for details. -# Allow users of this group to interact with dhcpcd via the control socket. -#controlgroup wheel - # Inform the DHCP server of our hostname for DDNS. hostname # Use the hardware address of the interface for the Client ID. clientid -# or -# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361. -# Some non-RFC compliant DHCP servers do not reply with this set. -# In this case, comment out duid and enable clientid above. -#duid # Persist interface configuration when dhcpcd exits. persistent @@ -29,9 +21,6 @@ option classless_static_routes # Respect the network MTU. This is applied to DHCP routes. option interface_mtu -# Most distributions have NTP support. -#option ntp_servers - # A ServerID is required by RFC2131. require dhcp_server_identifier @@ -40,27 +29,14 @@ require dhcp_server_identifier # OR generate Stable Private IPv6 Addresses based from the DUID slaac private -# Example static IP configuration: +# static IP configuration: interface eth0 static ip_address=192.168.10.10/24 static routers=192.168.10.1 static domain_name_servers=192.168.10.1 -#static ip6_address=fd51:42f8:caae:d92e::ff/64 -#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1 interface wlan0 static ip_address=10.1.1.10/24 static routers=10.1.1.1 static domain_name_servers=10.1.1.1 nohook wpa_supplicant - -# It is possible to fall back to a static IP if DHCP fails: -# define static profile -#profile static_eth0 -#static ip_address=192.168.1.23/24 -#static routers=192.168.1.1 -#static domain_name_servers=192.168.1.1 - -# fallback to static profile on eth0 -#interface eth0 -#fallback static_eth0 diff --git a/kinerpisys-1.0.0/dnsmasq.conf b/kinerpisys-1.0.0/dnsmasq.conf index 64697ba..c12662d 100644 --- a/kinerpisys-1.0.0/dnsmasq.conf +++ b/kinerpisys-1.0.0/dnsmasq.conf @@ -1,3 +1,3 @@ interface=wlan0 bind-dynamic -dhcp-range=10.1.1.10,10.1.1.150,255.255.255.0,24h +dhcp-range=10.1.1.11,10.1.1.150,255.255.255.0,12h diff --git a/kinerpisys-1.0.0/logrotate.conf b/kinerpisys-1.0.0/logrotate.conf new file mode 100644 index 0000000..e24cf22 --- /dev/null +++ b/kinerpisys-1.0.0/logrotate.conf @@ -0,0 +1,73 @@ +# see "man logrotate" for details + +# system-specific logs may also be configured here. +/var/log/syslog { + # Les logs sont compréssé avant rotation + compress + # compression au tour d'après + delaycompress + # garder 20 archives + rotate 20 + # Fréquence de rotation hebdomadaire + daily + # Si la taille est supérieure à 20 Mo, déclencher la rotation + maxsize 20M + # Toutes les archives sont stockées dans /var/log + olddir /var/log + # Si le fichier est manquant, ne pas générer d'erreur et continuer + missingok + # On écrit la date dans le nom du fichier + dateext + dateformat -%Y%m%d_%H%M%S + postrotate + systemctl restart rsyslog > /dev/null + endscript +} + +/var/log/debug +/var/log/kern.log +/var/log/daemon.log +/var/log/dpkg.log +/var/log/user.log +/var/log/messages { + # Les logs sont compréssé avant rotation + compress + # compression au tour d'après + delaycompress + # garder 10 archives + rotate 10 + # Fréquence de rotation mensuelle + daily + # Si la taille est supérieure à 20 Mo, déclencher la rotation + maxsize 20M + # Toutes les archives sont stockées dans /var/log + olddir /var/log + # Si le fichier est manquant, ne pas générer d'erreur et continuer + missingok + # On écrit la date dans le nom du fichier + dateext + dateformat -%Y%m%d_%H%M%S +} + +/var/log/kineintercom/Intercom.log { + # Rotate log files set under this user and group + # instead of using default user/group (usually root) + su root pi + # Les logs sont compréssé avant rotation + compress + # compression au tour d'après + delaycompress + # garder 20 archives + rotate 30 + # Fréquence de rotation hebdomadaire + daily + # Si la taille est supérieure à 20 Mo, déclencher la rotation + maxsize 20M + # Toutes les archives sont stockées dans /var/log + olddir /var/log/kineintercom + # Si le fichier est manquant, ne pas générer d'erreur et continuer + missingok + # On écrit la date dans le nom du fichier + dateext + dateformat -%Y%m%d_%H%M%S +} diff --git a/kinerpisys-1.0.0/rsyslog.conf b/kinerpisys-1.0.0/rsyslog.conf new file mode 100644 index 0000000..5cd1e2e --- /dev/null +++ b/kinerpisys-1.0.0/rsyslog.conf @@ -0,0 +1,75 @@ +# /etc/rsyslog.conf configuration file for rsyslog +# +# For more information install rsyslog-doc and see +# /usr/share/doc/rsyslog-doc/html/configuration/index.html + + +################# +#### MODULES #### +################# + +module(load="imuxsock") # provides support for local system logging +module(load="imklog") # provides kernel logging support +#module(load="immark") # provides --MARK-- message capability + +# provides UDP syslog reception +#module(load="imudp") +#input(type="imudp" port="514") + +# provides TCP syslog reception +#module(load="imtcp") +#input(type="imtcp" port="514") + + +########################### +#### GLOBAL DIRECTIVES #### +########################### + +# +# Use traditional timestamp format. +# To enable high precision timestamps, comment out the following line. +# +$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat + +# +# 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 #### +############### + +# +# First some standard log files. Log by facility. +# +*.*;auth,authpriv.none -/var/log/syslog +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +user.* -/var/log/user.log + +# +# Some "catch-all" log files. +# +*.=debug;\ + auth,authpriv.none;\ + mail.none -/var/log/debug +*.=info;*.=notice;*.=warn;\ + auth,authpriv.none;\ + cron,daemon.none;\ + mail.none -/var/log/messages