From: Julien Moutinho Date: Tue, 19 Mar 2013 22:03:15 +0000 (+0100) Subject: Modification : etc/sv/ : polissage et généralise un peu. X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=commitdiff_plain;h=c66bfacc6bac1bcb030675983107e4b90b08029b Modification : etc/sv/ : polissage et généralise un peu. --- diff --git a/etc/sv/fcgi.80.git.heureux-cyclage.org/configure b/etc/sv/fcgi.80.git.heureux-cyclage.org/configure index c01e6d0..ee22eba 100755 --- a/etc/sv/fcgi.80.git.heureux-cyclage.org/configure +++ b/etc/sv/fcgi.80.git.heureux-cyclage.org/configure @@ -1,11 +1,15 @@ #!/bin/sh -efux -run_user=fcgi.80.git.heureux-cyclage.org -id "$run_user" >/dev/null || +sv=$(basename "$(cd "$(dirname "$0")" && cd -)") +IFS=. read -r service site <<-EOF + $sv + EOF +user=$sv +getent passwd "$user" >/dev/null || sudo adduser \ --disabled-login \ --disabled-password \ --group \ - --home /no-home \ + --home /home/www/pub/"$site" \ --shell /bin/false \ --system \ - "$run_user" + "$user" diff --git a/etc/sv/fcgi.80.git.heureux-cyclage.org/run b/etc/sv/fcgi.80.git.heureux-cyclage.org/run index 5e19e1f..fc32089 100755 --- a/etc/sv/fcgi.80.git.heureux-cyclage.org/run +++ b/etc/sv/fcgi.80.git.heureux-cyclage.org/run @@ -1,6 +1,10 @@ #!/bin/sh -efux exec 2>&1 -run_user=fcgi.80.git.heureux-cyclage.org +sv=$(basename "$(cd "$(dirname "$0")" && cd -)") +IFS=. read -r service site <<-EOF + $sv + EOF +run_user=$sv sock_user=www-data exec /usr/bin/spawn-fcgi \ -g "$run_user" \ diff --git a/etc/sv/git-daemon.9418.git.heureux-cyclage.org/configure b/etc/sv/git-daemon.9418.git.heureux-cyclage.org/configure deleted file mode 100755 index dceee35..0000000 --- a/etc/sv/git-daemon.9418.git.heureux-cyclage.org/configure +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -efux -run_user=git-daemon -id "$run_user" >/dev/null || -sudo adduser \ - --disabled-login \ - --disabled-password \ - --group \ - --home /home/git/pub \ - --shell /bin/false \ - --system \ - "$run_user" -log_user=git-daemon-log -id "$log_user" >/dev/null || -sudo adduser \ - --disabled-login \ - --disabled-password \ - --group \ - --home /home/git/log/git-daemon \ - --shell /bin/false \ - --system \ - "$log_user" diff --git a/etc/sv/git-daemon.9418.git.heureux-cyclage.org/log/run b/etc/sv/git-daemon.9418.git.heureux-cyclage.org/log/run deleted file mode 100755 index f556886..0000000 --- a/etc/sv/git-daemon.9418.git.heureux-cyclage.org/log/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -efux -install -d -m 770 -o log.git-daemon -g log.git-daemon /home/git/log/git-daemon/ -exec chpst -u log.git-daemon svlogd -tt /home/git/log/git-daemon/ diff --git a/etc/sv/git-daemon.9418.git.heureux-cyclage.org/run b/etc/sv/git-daemon.9418.git.heureux-cyclage.org/run deleted file mode 100755 index c994c65..0000000 --- a/etc/sv/git-daemon.9418.git.heureux-cyclage.org/run +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -efux -exec 2>&1 -exec /usr/bin/chpst \ - -u git-daemon:git-daemon \ - /usr/bin/git daemon \ - --base-path=/home/git/pub/git \ - --interpolated-path=/home/git/srv/git/%H%D \ - --reuseaddr \ - --syslog \ - --user-path=pub/git \ - --verbose \ - -- \ - /home/git/pub/git diff --git a/etc/sv/git-daemon/configure b/etc/sv/git-daemon/configure new file mode 100755 index 0000000..8c3783b --- /dev/null +++ b/etc/sv/git-daemon/configure @@ -0,0 +1,20 @@ +#!/bin/sh -efux +user=git-daemon +getent passwd "$user" >/dev/null || +sudo adduser \ + --disabled-login \ + --disabled-password \ + --group \ + --home /home/git/pub \ + --shell /bin/false \ + --system \ + "$user" +getent passwd log."$user" >/dev/null || +sudo adduser \ + --disabled-login \ + --disabled-password \ + --group \ + --home /home/git/log/git-daemon \ + --shell /bin/false \ + --system \ + log."$user" diff --git a/etc/sv/git-daemon/log/run b/etc/sv/git-daemon/log/run new file mode 100755 index 0000000..bcecd63 --- /dev/null +++ b/etc/sv/git-daemon/log/run @@ -0,0 +1,4 @@ +#!/bin/sh -efux +user=git-daemon +install -d -m 770 -o log."$user" -g log."$user" /home/git/log/git-daemon/ +exec chpst -u log."$user" svlogd -tt /home/git/log/git-daemon/ diff --git a/etc/sv/git-daemon/run b/etc/sv/git-daemon/run new file mode 100755 index 0000000..c994c65 --- /dev/null +++ b/etc/sv/git-daemon/run @@ -0,0 +1,13 @@ +#!/bin/sh -efux +exec 2>&1 +exec /usr/bin/chpst \ + -u git-daemon:git-daemon \ + /usr/bin/git daemon \ + --base-path=/home/git/pub/git \ + --interpolated-path=/home/git/srv/git/%H%D \ + --reuseaddr \ + --syslog \ + --user-path=pub/git \ + --verbose \ + -- \ + /home/git/pub/git diff --git a/etc/sv/mysql.3306/run b/etc/sv/mysql.3306/run index 4d9f5fa..f8597b2 100755 --- a/etc/sv/mysql.3306/run +++ b/etc/sv/mysql.3306/run @@ -5,8 +5,8 @@ exec /usr/bin/chpst \ /usr/sbin/mysqld \ --basedir=/usr \ --datadir=/home/mysql \ - --plugin-dir=/usr/lib/mysql/plugin \ - --user=mysql \ --pid-file=/var/run/mysqld/mysqld.pid \ + --plugin-dir=/usr/lib/mysql/plugin \ + --port=3306 \ --socket=/var/run/mysqld/mysqld.sock \ - --port=3306 + --user=mysql