Anonymous avatar Anonymous committed ce641c2

Add in a daemontools service definition.

Comments (0)

Files changed (9)

support/daemontools-service/README.md

+# Daemontools Service Definition
+
+This is meant for being used with Dan Bernstein's [daemontools](http://cr.yp.to/daemontools.html) or Gerrit Pape's [runit](http://smarden.org/runit/) packages.
+
+## Usage
+
+Deploy the application somewhere on the system. I choose `/apps/magfest.org.development.moyi.us/ubersystem/deployments/current`, which is actually a symlink somewhere else.
+
+`cp -a $HOME/w/hg/bitbucket.org/nrr/magfest/support/daemontools-service /apps/magfest.org.development.moyi.us/ubersystem/service`
+
+`find /apps/magfest.org.development.moyi.us/ubersystem/service -type d -exec chmod 2755 '{}' \;`
+
+`chmod 3755 /apps/magfest.org.development.moyi.us/ubersystem/service`
+
+Make sure the environment variables are set to suit in `/apps/magfest.org.development.moyi.us/ubersystem/service/env` and `/apps/magfest.org.development.moyi.us/ubersystem/service/log/env`. Make sure that user and group exists as well.
+
+`cd /apps/magfest.org.development.moyi.us/ubersystem/service ; ln -s /apps/magfest.org.development.moyi.us/ubersystem/deployments/current root`
+
+`ln -s /apps/magfest.org.development.moyi.us/ubersystem/service /service/app_ubersystem.magfest.org.development.moyi.us`
+
+`tail -n 1000 -F /service/app_ubersystem.magfest.org.development.moyi.us/log/main/current`

support/daemontools-service/env/PYTHON

+/opt/python/2.7/bin/python

support/daemontools-service/env/USER

+Gmagfest

support/daemontools-service/log/env/MAXFILESIZE

+5000000

support/daemontools-service/log/env/MAXLOGFILES

+20
Add a comment to this file

support/daemontools-service/log/env/PROCESSOR

Empty file added.

support/daemontools-service/log/env/USER

+Gmagfest

support/daemontools-service/log/run

+#! /bin/sh
+
+exec \
+envdir ./env \
+sh -c '
+	exec \
+	setuidgid ${USER+"$USER"} \
+	multilog \
+	t \
+	${MAXFILESIZE+"s$MAXFILESIZE"} \
+	${MAXLOGFILES+"n$MAXLOGFILES"} \
+	${PROCESSOR+"!$PROCESSOR"} \
+	./main
+'

support/daemontools-service/run

+#! /bin/sh
+
+exec 2>&1 \
+envdir ./env \
+sh -c '
+	cd ./root
+	exec setuidgid ${USER+"$USER"} \
+	$PYTHON main.py
+'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.