From 517dfa12da0aee0c546f21166f488dc19f88c2b5 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Mon, 18 Mar 2013 10:48:49 +0100 Subject: [PATCH] Ajout : vm_hosted : rule_runit_configure . --- .../configure} | 3 +- .../log/run | 0 .../run | 0 .../configure | 11 +++++++ .../run | 4 +-- .../run.sh | 0 vm_hosted | 33 +++++++++++++++++++ 7 files changed, 48 insertions(+), 3 deletions(-) rename etc/sv/{git-daemon.hc.9418.git.heureux-cyclage.org/run.sh => git-daemon.9418.git.heureux-cyclage.org/configure} (91%) mode change 100644 => 100755 rename etc/sv/{git-daemon.hc.9418.git.heureux-cyclage.org => git-daemon.9418.git.heureux-cyclage.org}/log/run (100%) rename etc/sv/{git-daemon.hc.9418.git.heureux-cyclage.org => git-daemon.9418.git.heureux-cyclage.org}/run (100%) create mode 100755 etc/sv/spawn-fcgi.80.git.heureux-cyclage.org/configure rename etc/sv/{spawn-fcgi.hc.80.git.heureux-cyclage.org => spawn-fcgi.80.git.heureux-cyclage.org}/run (67%) delete mode 100644 etc/sv/spawn-fcgi.hc.80.git.heureux-cyclage.org/run.sh diff --git a/etc/sv/git-daemon.hc.9418.git.heureux-cyclage.org/run.sh b/etc/sv/git-daemon.9418.git.heureux-cyclage.org/configure old mode 100644 new mode 100755 similarity index 91% rename from etc/sv/git-daemon.hc.9418.git.heureux-cyclage.org/run.sh rename to etc/sv/git-daemon.9418.git.heureux-cyclage.org/configure index c319358..dceee35 --- a/etc/sv/git-daemon.hc.9418.git.heureux-cyclage.org/run.sh +++ b/etc/sv/git-daemon.9418.git.heureux-cyclage.org/configure @@ -1,4 +1,5 @@ -local run_user="$user"-daemon +#!/bin/sh -efux +run_user=git-daemon id "$run_user" >/dev/null || sudo adduser \ --disabled-login \ diff --git a/etc/sv/git-daemon.hc.9418.git.heureux-cyclage.org/log/run b/etc/sv/git-daemon.9418.git.heureux-cyclage.org/log/run similarity index 100% rename from etc/sv/git-daemon.hc.9418.git.heureux-cyclage.org/log/run rename to etc/sv/git-daemon.9418.git.heureux-cyclage.org/log/run diff --git a/etc/sv/git-daemon.hc.9418.git.heureux-cyclage.org/run b/etc/sv/git-daemon.9418.git.heureux-cyclage.org/run similarity index 100% rename from etc/sv/git-daemon.hc.9418.git.heureux-cyclage.org/run rename to etc/sv/git-daemon.9418.git.heureux-cyclage.org/run diff --git a/etc/sv/spawn-fcgi.80.git.heureux-cyclage.org/configure b/etc/sv/spawn-fcgi.80.git.heureux-cyclage.org/configure new file mode 100755 index 0000000..b563226 --- /dev/null +++ b/etc/sv/spawn-fcgi.80.git.heureux-cyclage.org/configure @@ -0,0 +1,11 @@ +#!/bin/sh -efux +run_user=spawn-fcgi.80.git.heureux-cyclage.org +id "$run_user" >/dev/null || +sudo adduser \ + --disabled-login \ + --disabled-password \ + --group \ + --home /no-home \ + --shell /bin/false \ + --system \ + "$run_user" diff --git a/etc/sv/spawn-fcgi.hc.80.git.heureux-cyclage.org/run b/etc/sv/spawn-fcgi.80.git.heureux-cyclage.org/run similarity index 67% rename from etc/sv/spawn-fcgi.hc.80.git.heureux-cyclage.org/run rename to etc/sv/spawn-fcgi.80.git.heureux-cyclage.org/run index 3e598b4..6b97f39 100755 --- a/etc/sv/spawn-fcgi.hc.80.git.heureux-cyclage.org/run +++ b/etc/sv/spawn-fcgi.80.git.heureux-cyclage.org/run @@ -1,13 +1,13 @@ #!/bin/sh -efux exec 2>&1 -run_user=git-spawn-fcgi-80 +run_user=spawn-fcgi.80.git.heureux-cyclage.org sock_user=www-data exec /usr/bin/spawn-fcgi -g "$run_user" \ -G "$sock_user" \ -M 0660 \ -n \ - -s /run/nginx/fastcgi/spawn-fcgi.git.80.git.heureux-cyclage.org \ + -s /run/nginx/fastcgi/spawn-fcgi.80.git.heureux-cyclage.org \ -u "$run_user" \ -U "$sock_user" \ -- /usr/bin/multiwatch \ diff --git a/etc/sv/spawn-fcgi.hc.80.git.heureux-cyclage.org/run.sh b/etc/sv/spawn-fcgi.hc.80.git.heureux-cyclage.org/run.sh deleted file mode 100644 index e69de29..0000000 diff --git a/vm_hosted b/vm_hosted index 8ffc922..b4a73b5 100755 --- a/vm_hosted +++ b/vm_hosted @@ -660,6 +660,10 @@ rule_login_configure () { # Xen hypervisor console hvc:2345:respawn:/sbin/getty 38400 hvc0 #xvc:2345:respawn:/sbin/getty 38400 xvc0 + + #-- runit begin + SV:123456:respawn:/usr/sbin/runsvdir-start + #-- runit end EOF sudo install -m 644 -o root -g root /dev/stdin /etc/login.defs <<-EOF MAIL_DIR /var/mail @@ -1111,6 +1115,34 @@ rule_procmail_configure () { "$tool"/etc/skel/etc/mail/delivery.procmailrc \ /etc/skel/etc/mail/delivery.procmailrc } +rule_runit_configure () { + rule apt_get_install runit + local -; set +f + rm -f /etc/service/* + # NOTE: runsvdir éteindra les services qui n'apparaîtront plus ici. + for sv in "$tool"/etc/sv/* + do sv=${sv#"$tool"/etc/sv/} + sudo install -d -m 770 -o root -g root \ + /etc/sv/"$sv" + sudo install -m 770 -o root -g root \ + "$tool"/etc/sv/"$sv"/run \ + /etc/sv/"$sv"/run + if test -e "$tool"/etc/sv/"$sv"/log/run + then + sudo install -d -m 770 -o root -g root \ + /etc/sv/"$sv"/log + sudo install -m 770 -o root -g root \ + "$tool"/etc/sv/"$sv"/log/run \ + /etc/sv/"$sv"/log/run + fi + if test ! -x "$tool"/etc/sv/"$sv"/configure || + "$tool"/etc/sv/"$sv"/configure + then + ln -fns ../sv/"$sv" /etc/service/"$sv" + sv restart "$sv" + else + done + } rule_ssh_configure () { ssh-keygen -F "$vm_fqdn" -f "$tool"/etc/openssh/known_hosts | ( while IFS= read -r line @@ -1309,6 +1341,7 @@ rule_configure () { rule nginx_configure rule php5_fpm_configure rule gitolite_configure + rule runit_configure } rule_luks_key_change () { -- 2.20.1