]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/templates/default/updater.init.erb
bring nominatim under chef control
[chef.git] / cookbooks / nominatim / templates / default / updater.init.erb
diff --git a/cookbooks/nominatim/templates/default/updater.init.erb b/cookbooks/nominatim/templates/default/updater.init.erb
new file mode 100644 (file)
index 0000000..0afbf97
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# DO NOT EDIT - This file is being maintained by Chef
+
+start() {
+  start-stop-daemon --start --chuid suzuki --background --make-pidfile --pidfile /var/run/nominatim-update.pid --exec <%= @source_directory %>/utils/nominatim-update
+}
+
+stop() {
+  start-stop-daemon --stop --retry 3600 --pidfile /var/run/nominatim-update.pid
+}
+
+case "$1" in
+  start)
+    start
+    ;;
+  stop)
+    stop
+    ;;
+  restart)
+    stop || exit $?
+    start
+    ;;
+esac
+