Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More compact and escaped environment variable names in systemd service files #652

Merged
merged 3 commits into from
Nov 26, 2016

Conversation

l1n
Copy link
Contributor

@l1n l1n commented Nov 25, 2016

No description provided.

@ddollar ddollar merged commit 19c77d3 into ddollar:master Nov 26, 2016
@ddollar
Copy link
Owner

ddollar commented Nov 26, 2016

Thanks!

@timurb timurb mentioned this pull request Jan 24, 2017
timurb added a commit to timurb/foreman that referenced this pull request Jan 25, 2017
This reverts commit 19c77d3, reversing
changes made to 986736d.
timurb added a commit to timurb/foreman that referenced this pull request Jan 25, 2017
@timurb timurb mentioned this pull request Jan 25, 2017
@timurb
Copy link
Contributor

timurb commented Jan 25, 2017

The syntax works for me (with the exception of #664) but the new syntax is hardly readable.
Old:

[Service]
User=rails
WorkingDirectory=/opt/cga/current
Environment=PORT=%i
Environment=DB_HOST=XXXXXXX
Environment=DB_PORT=3306
Environment=DB_NAME=XXXXXXXX
Environment=DB_USERNAME=rails
Environment=DB_PASSWORD=XXXXXXX
Environment=MAILGUN_API_KEY=XXXXXX
Environment=MAILGUN_DOMAIN=XXXXXXXX
Environment=MAILGUN_PUBLIC_KEY=XXXXXXX
Environment=MAILGUN_SMTP_LOGIN=XXXXXXX
Environment=MAILGUN_SMTP_PASSWORD=XXXXXXX
Environment=MAILGUN_SMTP_PORT=587
Environment=MAILGUN_SMTP_SERVER=smtp.mailgun.org
.....a few more dozens of Environment lines....
ExecStart=/bin/bash -lc 'bundle exec unicorn -p $PORT -c ./config/unicorn.rb'

New (scroll to the side):

[Service]
User=rails
WorkingDirectory=/opt/cga/current
Environment=PORT=%i
Environment="DB_HOST=XXXXXXX" "DB_PORT=3306" "DB_NAME=XXXXXXXX" "DB_USERNAME=rails" "DB_PASSWORD=XXXXXXX" "MAILGUN_API_KEY=XXXXXX" "MAILGUN_DOMAIN=XXXXXXXX" "MAILGUN_PUBLIC_KEY=XXXXXXX" "MAILGUN_SMTP_LOGIN=XXXXXXX" "MAILGUN_SMTP_PASSWORD=XXXXXXX" "MAILGUN_SMTP_PORT=587" "MAILGUN_SMTP_SERVER=smtp.mailgun.org" 
ExecStart=/bin/bash -lc 'bundle exec unicorn -p $PORT -c ./config/unicorn.rb'

Variable quoting looks nice addition though and I'll keep it in place.
Here is my pull request with the fix: #665

timurb added a commit to timurb/foreman that referenced this pull request Mar 28, 2017
This reverts commit 19c77d3, reversing
changes made to 986736d.
timurb added a commit to timurb/foreman that referenced this pull request Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants