diff --git a/rc.nginx/nginx-log/consumer-for b/rc.nginx/nginx-log/consumer-for new file mode 100644 index 0000000..5253051 --- /dev/null +++ b/rc.nginx/nginx-log/consumer-for @@ -0,0 +1 @@ +nginx-srv diff --git a/rc.nginx/nginx-log/dependencies b/rc.nginx/nginx-log/dependencies new file mode 100644 index 0000000..e85efae --- /dev/null +++ b/rc.nginx/nginx-log/dependencies @@ -0,0 +1,4 @@ +# Comment out "remount-root" and uncomment "local-fs" +# if you use separate partition for /var/log +remount-root +#local-fs diff --git a/rc.nginx/nginx-log/env/CMD b/rc.nginx/nginx-log/env/CMD new file mode 100644 index 0000000..9d5239c --- /dev/null +++ b/rc.nginx/nginx-log/env/CMD @@ -0,0 +1 @@ +s6-log diff --git a/rc.nginx/nginx-log/env/CMD_OPTS b/rc.nginx/nginx-log/env/CMD_OPTS new file mode 100644 index 0000000..00d672e --- /dev/null +++ b/rc.nginx/nginx-log/env/CMD_OPTS @@ -0,0 +1 @@ +-d3 diff --git a/rc.nginx/nginx-log/env/LOGDIR_GROUP b/rc.nginx/nginx-log/env/LOGDIR_GROUP new file mode 100644 index 0000000..3794bcd --- /dev/null +++ b/rc.nginx/nginx-log/env/LOGDIR_GROUP @@ -0,0 +1,2 @@ +root +# Logging directory group ownership diff --git a/rc.nginx/nginx-log/env/LOGDIR_OWNER b/rc.nginx/nginx-log/env/LOGDIR_OWNER new file mode 100644 index 0000000..9f9fd12 --- /dev/null +++ b/rc.nginx/nginx-log/env/LOGDIR_OWNER @@ -0,0 +1,2 @@ +root +# Logging directory owner diff --git a/rc.nginx/nginx-log/env/LOGDIR_PATH b/rc.nginx/nginx-log/env/LOGDIR_PATH new file mode 100644 index 0000000..8e3722a --- /dev/null +++ b/rc.nginx/nginx-log/env/LOGDIR_PATH @@ -0,0 +1,2 @@ +/var/log/nginx +# Logging directory path diff --git a/rc.nginx/nginx-log/env/LOGDIR_PERMS b/rc.nginx/nginx-log/env/LOGDIR_PERMS new file mode 100644 index 0000000..ccece6e --- /dev/null +++ b/rc.nginx/nginx-log/env/LOGDIR_PERMS @@ -0,0 +1,2 @@ +750 +# Logging directory access rights in octal diff --git a/rc.nginx/nginx-log/env/LOG_SCRIPT b/rc.nginx/nginx-log/env/LOG_SCRIPT new file mode 100644 index 0000000..948a563 --- /dev/null +++ b/rc.nginx/nginx-log/env/LOG_SCRIPT @@ -0,0 +1,2 @@ +n4 s500000 T $LOGDIR_PATH +# Logging script used by s6-log diff --git a/rc.nginx/nginx-log/notification-fd b/rc.nginx/nginx-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/rc.nginx/nginx-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/rc.nginx/nginx-log/pipeline-name b/rc.nginx/nginx-log/pipeline-name new file mode 100644 index 0000000..68b7d12 --- /dev/null +++ b/rc.nginx/nginx-log/pipeline-name @@ -0,0 +1 @@ +nginx diff --git a/rc.nginx/nginx-log/run b/rc.nginx/nginx-log/run new file mode 100644 index 0000000..aad3b37 --- /dev/null +++ b/rc.nginx/nginx-log/run @@ -0,0 +1,24 @@ +#!/bin/execlineb -P + +############################################### +# Start a logging daemon for the nginx daemon # +############################################### + +s6-envdir env +multisubstitute { + importas -u LOGDIR_OWNER LOGDIR_OWNER + importas -u LOGDIR_GROUP LOGDIR_GROUP + importas -u LOGDIR_PERMS LOGDIR_PERMS + importas -u CMD CMD + importas -usCd" " CMD_OPTS CMD_OPTS + importas -usCd" " LOG_SCRIPT LOG_SCRIPT +} +s6-envuidgid -B ${LOGDIR_OWNER}:${LOGDIR_GROUP} +multisubstitute { + importas -u LOGDIR_PATH LOGDIR_PATH + importas -u UID UID + importas -u GID GID +} +if { install -dm $LOGDIR_PERMS -o $UID -g $GID $LOGDIR_PATH } +s6-setuidgid ${UID}:${GID} +exec -c $CMD $CMD_OPTS -- $LOG_SCRIPT diff --git a/rc.nginx/nginx-log/type b/rc.nginx/nginx-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rc.nginx/nginx-log/type @@ -0,0 +1 @@ +longrun diff --git a/rc.nginx/nginx-srv/dependencies b/rc.nginx/nginx-srv/dependencies new file mode 100644 index 0000000..6c7200d --- /dev/null +++ b/rc.nginx/nginx-srv/dependencies @@ -0,0 +1,6 @@ +tmpfs-run +network +# Comment out "remount-root" and uncomment "local-fs" +# if you use separate partition for /var +remount-root +#local-fs diff --git a/rc.nginx/nginx-srv/down-signal b/rc.nginx/nginx-srv/down-signal new file mode 100644 index 0000000..c91fe26 --- /dev/null +++ b/rc.nginx/nginx-srv/down-signal @@ -0,0 +1 @@ +SIGQUIT diff --git a/rc.nginx/nginx-srv/env/CMD b/rc.nginx/nginx-srv/env/CMD new file mode 100644 index 0000000..68b7d12 --- /dev/null +++ b/rc.nginx/nginx-srv/env/CMD @@ -0,0 +1 @@ +nginx diff --git a/rc.nginx/nginx-srv/env/CMD_OPTS b/rc.nginx/nginx-srv/env/CMD_OPTS new file mode 100644 index 0000000..4c24298 --- /dev/null +++ b/rc.nginx/nginx-srv/env/CMD_OPTS @@ -0,0 +1 @@ +-c /etc/nginx/nginx.conf diff --git a/rc.nginx/nginx-srv/notification-fd b/rc.nginx/nginx-srv/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/rc.nginx/nginx-srv/notification-fd @@ -0,0 +1 @@ +3 diff --git a/rc.nginx/nginx-srv/producer-for b/rc.nginx/nginx-srv/producer-for new file mode 100644 index 0000000..307d740 --- /dev/null +++ b/rc.nginx/nginx-srv/producer-for @@ -0,0 +1 @@ +nginx-log diff --git a/rc.nginx/nginx-srv/run b/rc.nginx/nginx-srv/run new file mode 100644 index 0000000..ba8bb24 --- /dev/null +++ b/rc.nginx/nginx-srv/run @@ -0,0 +1,15 @@ +#!/bin/execlineb -P + +###################################### +# Start nginx (http/imap/pop3 proxy) # +###################################### + +fdmove -c 2 1 +s6-envdir env +multisubstitute { + importas -u CMD CMD + importas -usCd" " CMD_OPTS CMD_OPTS +} +# Using /var/run/nginx.pid existence as readiness indicator +s6-notifyoncheck -dn0 -c "[ -r /var/run/nginx.pid ]" +exec -c $CMD $CMD_OPTS -g "daemon off;" diff --git a/rc.nginx/nginx-srv/timeout-up b/rc.nginx/nginx-srv/timeout-up new file mode 100644 index 0000000..5caff40 --- /dev/null +++ b/rc.nginx/nginx-srv/timeout-up @@ -0,0 +1 @@ +10000 diff --git a/rc.nginx/nginx-srv/type b/rc.nginx/nginx-srv/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rc.nginx/nginx-srv/type @@ -0,0 +1 @@ +longrun