From c66bfacc6bac1bcb030675983107e4b90b08029b Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Tue, 19 Mar 2013 23:03:15 +0100 Subject: [PATCH 1/1] =?utf8?q?Modification=20:=20etc/sv/=20:=20polissage?= =?utf8?q?=20et=20g=C3=A9n=C3=A9ralise=20un=20peu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- etc/sv/fcgi.80.git.heureux-cyclage.org/configure | 12 ++++++++---- etc/sv/fcgi.80.git.heureux-cyclage.org/run | 6 +++++- .../git-daemon.9418.git.heureux-cyclage.org/log/run | 3 --- .../configure | 11 +++++------ etc/sv/git-daemon/log/run | 4 ++++ .../run | 0 etc/sv/mysql.3306/run | 6 +++--- 7 files changed, 25 insertions(+), 17 deletions(-) delete mode 100755 etc/sv/git-daemon.9418.git.heureux-cyclage.org/log/run rename etc/sv/{git-daemon.9418.git.heureux-cyclage.org => git-daemon}/configure (68%) create mode 100755 etc/sv/git-daemon/log/run rename etc/sv/{git-daemon.9418.git.heureux-cyclage.org => git-daemon}/run (100%) 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/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/configure b/etc/sv/git-daemon/configure similarity index 68% rename from etc/sv/git-daemon.9418.git.heureux-cyclage.org/configure rename to etc/sv/git-daemon/configure index dceee35..8c3783b 100755 --- a/etc/sv/git-daemon.9418.git.heureux-cyclage.org/configure +++ b/etc/sv/git-daemon/configure @@ -1,6 +1,6 @@ #!/bin/sh -efux -run_user=git-daemon -id "$run_user" >/dev/null || +user=git-daemon +getent passwd "$user" >/dev/null || sudo adduser \ --disabled-login \ --disabled-password \ @@ -8,9 +8,8 @@ sudo adduser \ --home /home/git/pub \ --shell /bin/false \ --system \ - "$run_user" -log_user=git-daemon-log -id "$log_user" >/dev/null || + "$user" +getent passwd log."$user" >/dev/null || sudo adduser \ --disabled-login \ --disabled-password \ @@ -18,4 +17,4 @@ sudo adduser \ --home /home/git/log/git-daemon \ --shell /bin/false \ --system \ - "$log_user" + 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.9418.git.heureux-cyclage.org/run b/etc/sv/git-daemon/run similarity index 100% rename from etc/sv/git-daemon.9418.git.heureux-cyclage.org/run rename to etc/sv/git-daemon/run 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 -- 2.20.1