From da9bb735ce1f6985057e13494d9f8db832dd3855 Mon Sep 17 00:00:00 2001 From: Kim <kim.sidney@gmail.com> Date: Wed, 21 Feb 2018 10:23:14 +0100 Subject: Manage config files with included files instead of echo, sed etc. (#16) Manage system.conf from file instead of hook. Add comment to the files where they are managed --- .../hooks/21-pam_mkhomedir.chroot | 16 +++++++ .../live-build-config/hooks/21-systemd_conf.chroot | 5 -- .../hooks/22-pam_mkhomedir.chroot | 16 ------- .../includes.chroot/etc/systemd/journald.conf | 2 + .../includes.chroot/etc/systemd/system.conf | 55 ++++++++++++++++++++++ 5 files changed, 73 insertions(+), 21 deletions(-) create mode 100755 data/live-build-config/hooks/21-pam_mkhomedir.chroot delete mode 100755 data/live-build-config/hooks/21-systemd_conf.chroot delete mode 100755 data/live-build-config/hooks/22-pam_mkhomedir.chroot create mode 100644 data/live-build-config/includes.chroot/etc/systemd/system.conf diff --git a/data/live-build-config/hooks/21-pam_mkhomedir.chroot b/data/live-build-config/hooks/21-pam_mkhomedir.chroot new file mode 100755 index 00000000..af155ba4 --- /dev/null +++ b/data/live-build-config/hooks/21-pam_mkhomedir.chroot @@ -0,0 +1,16 @@ +#!/bin/sh + +echo I: Create home directory on login. + +cat > /usr/share/pam-configs/mkhomedir <<EOF +Name: Create home directory during login +Default: yes +Priority: 900 +Session-Type: Additional +Session: + required pam_mkhomedir.so umask=0022 skel=/etc/skel +EOF +sync +sed -i '/mkhomedir/d' /var/lib/pam/seen +pam-auth-update --package + diff --git a/data/live-build-config/hooks/21-systemd_conf.chroot b/data/live-build-config/hooks/21-systemd_conf.chroot deleted file mode 100755 index 541fdf11..00000000 --- a/data/live-build-config/hooks/21-systemd_conf.chroot +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -echo I: Show systemd statuson boot. - -echo "ShowStatus=yes" >> /etc/systemd/system.conf diff --git a/data/live-build-config/hooks/22-pam_mkhomedir.chroot b/data/live-build-config/hooks/22-pam_mkhomedir.chroot deleted file mode 100755 index af155ba4..00000000 --- a/data/live-build-config/hooks/22-pam_mkhomedir.chroot +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -echo I: Create home directory on login. - -cat > /usr/share/pam-configs/mkhomedir <<EOF -Name: Create home directory during login -Default: yes -Priority: 900 -Session-Type: Additional -Session: - required pam_mkhomedir.so umask=0022 skel=/etc/skel -EOF -sync -sed -i '/mkhomedir/d' /var/lib/pam/seen -pam-auth-update --package - diff --git a/data/live-build-config/includes.chroot/etc/systemd/journald.conf b/data/live-build-config/includes.chroot/etc/systemd/journald.conf index 07612424..5aecf4f8 100644 --- a/data/live-build-config/includes.chroot/etc/systemd/journald.conf +++ b/data/live-build-config/includes.chroot/etc/systemd/journald.conf @@ -1,3 +1,5 @@ +# This file is managed in vyos-build +# # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it diff --git a/data/live-build-config/includes.chroot/etc/systemd/system.conf b/data/live-build-config/includes.chroot/etc/systemd/system.conf new file mode 100644 index 00000000..91af4090 --- /dev/null +++ b/data/live-build-config/includes.chroot/etc/systemd/system.conf @@ -0,0 +1,55 @@ +# This file is managed in vyos-build +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# See systemd-system.conf(5) for details + +[Manager] +#LogLevel=info +#LogTarget=journal-or-kmsg +#LogColor=yes +#LogLocation=no +#DumpCore=yes +#CrashShell=no +ShowStatus=yes +#CrashChVT=1 +#CPUAffinity=1 2 +#JoinControllers=cpu,cpuacct net_cls,net_prio +#RuntimeWatchdogSec=0 +#ShutdownWatchdogSec=10min +#CapabilityBoundingSet= +#SystemCallArchitectures= +#TimerSlackNSec= +#DefaultTimerAccuracySec=1min +#DefaultStandardOutput=journal +#DefaultStandardError=inherit +#DefaultTimeoutStartSec=90s +#DefaultTimeoutStopSec=90s +#DefaultRestartSec=100ms +#DefaultStartLimitInterval=10s +#DefaultStartLimitBurst=5 +#DefaultEnvironment= +#DefaultCPUAccounting=no +#DefaultBlockIOAccounting=no +#DefaultMemoryAccounting=no +#DefaultLimitCPU= +#DefaultLimitFSIZE= +#DefaultLimitDATA= +#DefaultLimitSTACK= +#DefaultLimitCORE= +#DefaultLimitRSS= +#DefaultLimitNOFILE= +#DefaultLimitAS= +#DefaultLimitNPROC= +#DefaultLimitMEMLOCK= +#DefaultLimitLOCKS= +#DefaultLimitSIGPENDING= +#DefaultLimitMSGQUEUE= +#DefaultLimitNICE= +#DefaultLimitRTPRIO= +#DefaultLimitRTTIME= -- cgit v1.2.3