diff --git a/rc.prosody/prosody-log/consumer-for b/rc.prosody/prosody-log/consumer-for new file mode 100644 index 0000000..4066033 --- /dev/null +++ b/rc.prosody/prosody-log/consumer-for @@ -0,0 +1 @@ +prosody-srv diff --git a/rc.prosody/prosody-log/dependencies b/rc.prosody/prosody-log/dependencies new file mode 100644 index 0000000..dc2488d --- /dev/null +++ b/rc.prosody/prosody-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.prosody/prosody-log/env/CMD b/rc.prosody/prosody-log/env/CMD new file mode 100644 index 0000000..9d5239c --- /dev/null +++ b/rc.prosody/prosody-log/env/CMD @@ -0,0 +1 @@ +s6-log diff --git a/rc.prosody/prosody-log/env/CMD_OPTS b/rc.prosody/prosody-log/env/CMD_OPTS new file mode 100644 index 0000000..00d672e --- /dev/null +++ b/rc.prosody/prosody-log/env/CMD_OPTS @@ -0,0 +1 @@ +-d3 diff --git a/rc.prosody/prosody-log/env/LOGDIR_GROUP b/rc.prosody/prosody-log/env/LOGDIR_GROUP new file mode 100644 index 0000000..3794bcd --- /dev/null +++ b/rc.prosody/prosody-log/env/LOGDIR_GROUP @@ -0,0 +1,2 @@ +root +# Logging directory group ownership diff --git a/rc.prosody/prosody-log/env/LOGDIR_OWNER b/rc.prosody/prosody-log/env/LOGDIR_OWNER new file mode 100644 index 0000000..9f9fd12 --- /dev/null +++ b/rc.prosody/prosody-log/env/LOGDIR_OWNER @@ -0,0 +1,2 @@ +root +# Logging directory owner diff --git a/rc.prosody/prosody-log/env/LOGDIR_PATH b/rc.prosody/prosody-log/env/LOGDIR_PATH new file mode 100644 index 0000000..01c418f --- /dev/null +++ b/rc.prosody/prosody-log/env/LOGDIR_PATH @@ -0,0 +1,2 @@ +/var/log/prosody +# Logging directory path diff --git a/rc.prosody/prosody-log/env/LOGDIR_PERMS b/rc.prosody/prosody-log/env/LOGDIR_PERMS new file mode 100644 index 0000000..ccece6e --- /dev/null +++ b/rc.prosody/prosody-log/env/LOGDIR_PERMS @@ -0,0 +1,2 @@ +750 +# Logging directory access rights in octal diff --git a/rc.prosody/prosody-log/env/LOG_SCRIPT b/rc.prosody/prosody-log/env/LOG_SCRIPT new file mode 100644 index 0000000..948a563 --- /dev/null +++ b/rc.prosody/prosody-log/env/LOG_SCRIPT @@ -0,0 +1,2 @@ +n4 s500000 T $LOGDIR_PATH +# Logging script used by s6-log diff --git a/rc.prosody/prosody-log/notification-fd b/rc.prosody/prosody-log/notification-fd new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/rc.prosody/prosody-log/notification-fd @@ -0,0 +1 @@ +3 diff --git a/rc.prosody/prosody-log/pipeline-name b/rc.prosody/prosody-log/pipeline-name new file mode 100644 index 0000000..49c3cb8 --- /dev/null +++ b/rc.prosody/prosody-log/pipeline-name @@ -0,0 +1 @@ +prosody diff --git a/rc.prosody/prosody-log/run b/rc.prosody/prosody-log/run new file mode 100644 index 0000000..2d163e7 --- /dev/null +++ b/rc.prosody/prosody-log/run @@ -0,0 +1,24 @@ +#!/bin/execlineb -P + +################################################# +# Start a logging daemon for the prosody 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.prosody/prosody-log/type b/rc.prosody/prosody-log/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rc.prosody/prosody-log/type @@ -0,0 +1 @@ +longrun diff --git a/rc.prosody/prosody-srv/dependencies b/rc.prosody/prosody-srv/dependencies new file mode 100644 index 0000000..a262a61 --- /dev/null +++ b/rc.prosody/prosody-srv/dependencies @@ -0,0 +1,5 @@ +tmpfs-run +# Comment out "remount-root" and uncomment "local-fs" +# if you use separate partition for /var +remount-root +#local-fs diff --git a/rc.prosody/prosody-srv/env/CMD b/rc.prosody/prosody-srv/env/CMD new file mode 100644 index 0000000..49c3cb8 --- /dev/null +++ b/rc.prosody/prosody-srv/env/CMD @@ -0,0 +1 @@ +prosody diff --git a/rc.prosody/prosody-srv/env/CMD_OPTS b/rc.prosody/prosody-srv/env/CMD_OPTS new file mode 100644 index 0000000..aaaf277 --- /dev/null +++ b/rc.prosody/prosody-srv/env/CMD_OPTS @@ -0,0 +1 @@ +--config /etc/prosody/prosody.cfg.lua -F diff --git a/rc.prosody/prosody-srv/producer-for b/rc.prosody/prosody-srv/producer-for new file mode 100644 index 0000000..3a1fe68 --- /dev/null +++ b/rc.prosody/prosody-srv/producer-for @@ -0,0 +1 @@ +prosody-log diff --git a/rc.prosody/prosody-srv/run b/rc.prosody/prosody-srv/run new file mode 100644 index 0000000..3326f65 --- /dev/null +++ b/rc.prosody/prosody-srv/run @@ -0,0 +1,16 @@ +#!/bin/execlineb -P + +################################### +# Start prosody (Lua XMPP Server) # +################################### + +fdmove -c 2 1 +if { install -do ldap -g ldap /var/run/openldap } +emptyenv -p +s6-envdir env +multisubstitute { + importas -u CMD CMD + importas -usCd" " CMD_OPTS CMD_OPTS +} +s6-setuidgid prosody +exec -c $CMD $CMD_OPTS diff --git a/rc.prosody/prosody-srv/type b/rc.prosody/prosody-srv/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/rc.prosody/prosody-srv/type @@ -0,0 +1 @@ +longrun