forked from conveyal/gtfs-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3f6fa0
commit 9180b1f
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This folder contains init scripts to start the editor. By default they assume an installation in | ||
`/opt/gtfs-editor` and a user gtfs-editor to run the editor; feel free to edit as needed. | ||
|
||
Note that whatever user you choose must be able to write to teh log and pid server files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Upstart script to start GTFS Editor | ||
|
||
env user=matthewc | ||
# configure port and bind address in application.cong | ||
|
||
# application home directory | ||
chdir /home/matthewc/conveyal/gtfs-editor | ||
|
||
start on runlevel [3] | ||
|
||
pre-start script | ||
# We set up an exclusive temporary directory so that Geotools will play nice with other Geotools apps on the system, | ||
# which may be running as different users | ||
# see http://www.indicatrix.org/2014/10/20/using-geotools-with-multiple-user-accounts/ | ||
|
||
# The environment stuff with writing to a file is a bit annoying; see http://stackoverflow.com/questions/12610335 | ||
TMPDIR=`mktemp -d` | ||
chown $user $TMPDIR | ||
echo "TMPDIR=$TMPDIR" > "/tmp/$UPSTART_JOB" | ||
end script | ||
|
||
script | ||
. "/tmp/$UPSTART_JOB" | ||
su -m -c "exec play run --%production" $user | ||
end script | ||
|
||
post-stop script | ||
# Clear out our temporary directory | ||
. "/tmp/$UPSTART_JOB" | ||
rm -rf "$TMPDIR" | ||
rm "/tmp/$UPSTART_JOB" | ||
end script |