Last active
August 2, 2016 18:09
-
-
Save mtgrosser/174c5a82dcafb23087c9 to your computer and use it in GitHub Desktop.
Passenger standalone systemd unit file for hosting multiple apps
This file contains hidden or 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
[Unit] | |
Description=Passenger Standalone Application Server | |
After=network.target | |
[Service] | |
Type=forking | |
PrivateTmp=yes | |
User=USERNAME | |
Group=GROUPNAME | |
WorkingDirectory=/apps/%i | |
#RuntimeDirectory=passenger | |
#RuntimeDirectoryMode=0755 | |
PIDFile=/run/passenger/app.%i.pid | |
Environment="PATH=/opt/rubies/2.1.5/bin:/usr/local/bin:/usr/bin" | |
Environment="GEM_HOME=/opt/rubies/2.1.5/lib/ruby/gems/2.1.0" | |
Environment="GEM_PATH=/opt/rubies/2.1.5/lib/ruby/gems/2.1.0" | |
Environment="PASSENGER_ROOT=/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/passenger-5.0.0.beta1" | |
Environment="PASSENGER_INSTANCE_REGISTRY_DIR=/run/passenger" | |
EnvironmentFile=-/apps/%i/current/config/passenger.env | |
ExecStart=/usr/bin/bash -c 'exec ${PASSENGER_ROOT}/bin/passenger start current --daemonize --instance-registry-dir /run/passenger --socket /run/passenger/app.%i.sock --pid-file /run/passenger/app.%i.pid --log-file /apps/%i/shared/log/passenger.log --environment production $PASSENGER_OPTS' | |
ExecReload=/usr/bin/bash -c 'exec ${PASSENGER_ROOT}/bin/passenger-config restart-app /apps/%i' | |
ExecStop=/usr/bin/bash -c 'exec ${PASSENGER_ROOT}/bin/passenger stop --pid-file /run/passenger/app.%i.pid' | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment