X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=vm_hosted;h=fae784e9eb60335e894ae7f996ec0ce3f27307dd;hb=a69c7802612266236658a37bda14547fada629c4;hp=5915841401556329ae4e2f22eedf00dbb04ece8f;hpb=ef3c0950dae2dfa4d258e98ad7c1dd6b30a47599;p=lhc%2Fateliers.git diff --git a/vm_hosted b/vm_hosted index 5915841..fae784e 100755 --- a/vm_hosted +++ b/vm_hosted @@ -413,24 +413,7 @@ rule_filesystem_configure () { ${vm_lvm_lv}_home_deciphered /dev/$vm_lvm_vg/${vm_lvm_lv}_home ${vm_lvm_lv}_root_deciphered luks,lvm=$vm_lvm_vg,keyscript=/lib/cryptsetup/scripts/decrypt_derived ${vm_lvm_lv}_swap_deciphered /dev/$vm_lvm_vg/${vm_lvm_lv}_swap ${vm_lvm_lv}_root_deciphered luks,lvm=$vm_lvm_vg,keyscript=/lib/cryptsetup/scripts/decrypt_derived EOF - sudo install -m 644 -o root -g root /dev/stdin /etc/default/tmpfs <<-EOF - LOCK_SIZE=5242880 # NOTE: 5MiB - RAMLOCK=yes - RAMSHM=yes - RAMTMP=yes - RUN_SIZE=10% - SHM_SIZE= - TMP_MODE=1777,nr_inodes=1000k,noatime - TMP_OVERFLOW_LIMIT=1024 - # NOTE: mount tmpfs on /tmp if there is less than the limit size (in kiB) - # on the root filesystem (overriding RAMTMP). - TMP_SIZE=200m - TMPFS_SIZE=20%VM - EOF - sudo install -m 775 -o root -g root \ - "$tool"/etc/init.d/tmpfs \ - /etc/init.d/tmpfs - sudo update-rc.d tmpfs defaults + rule tmpfs_configure } rule_initramfs_configure () { sudo install -m 644 -o root -g root /dev/stdin /etc/initramfs-tools/initramfs.conf <<-EOF @@ -1091,6 +1074,12 @@ rule_postfix_configure () { } rule_postgresql_configure () { rule apt_get_install postgresql-9.1 + if [ ! -d /var/lib/postgresql/9.1/ ]; then + pg_createcluster -u postgres --start 9.1 main + fi + sudo install -m 660 -o root -g root \ + "$tool"/etc/postgresql/9.1/main/postgresql.conf \ + /etc/postgresql/9.1/main/postgresql.conf sudo service postgresql restart } rule_openerp_configure () { @@ -1140,7 +1129,7 @@ rule_runit_configure () { then ln -fns ../sv/"$sv" /etc/service/"$sv" sv restart "$sv" - else + fi done } rule_ssh_configure () { @@ -1205,6 +1194,26 @@ rule_sysctl_configure () { done sudo sysctl --system } +rule_tmpfs_configure () { + sudo install -m 644 -o root -g root /dev/stdin /etc/default/tmpfs <<-EOF + LOCK_SIZE=5242880 # NOTE: 5MiB + RAMLOCK=yes + RAMSHM=yes + RAMTMP=yes + RUN_SIZE=10% + SHM_SIZE= + TMP_MODE=1777,nr_inodes=1000k,noatime + TMP_OVERFLOW_LIMIT=1024 + # NOTE: mount tmpfs on /tmp if there is less than the limit size (in kiB) + # on the root filesystem (overriding RAMTMP). + TMP_SIZE=200m + TMPFS_SIZE=20%VM + EOF + sudo install -m 775 -o root -g root \ + "$tool"/etc/init.d/tmpfs \ + /etc/init.d/tmpfs + sudo update-rc.d tmpfs defaults + } rule_time_configure () { sudo install -m 644 -o root -g root /dev/stdin /etc/timezone <<-EOF Europe/Paris @@ -1219,7 +1228,7 @@ rule_time_configure () { rule_user_add () { # SYNTAX: $user rule user_configure local user=$1 - id "$user" >/dev/null || + getent passwd "$user" >/dev/null || sudo adduser --disabled-password "$user" # NOTE: le mot-de-passe doit être initialisé par l'utilisateur à l'aide de passwd-init . eval local home\; home="~$user"