Comments (5)
You got closer but an issue with permissions remains (you can't write logs in /var/log as a consul user).
What about something like this?
exec su -s /bin/sh -c 'GOMAXPROCS=`nproc` exec "$0" "$@"' consul -- /opt/consul/bin/consul agent > {{ consul_log_file }} 2>&1
I have tested this out and it works as expected on debian/ubuntu (with upstart) but I am not sure about rhel/centos.
from ansible-consul.
You can.../var/log/consul is touched and chown to consul:consul during
install I believe - that is the owner after install in any case.
The previous code worked the same way in this regard and I've used my
branch for successful deployments already on Ubuntu.
On Monday, November 14, 2016, Jure Žvelc [email protected] wrote:
You got closer but an issue with permissions remains (you can't write logs
in /var/log as a consul user).
What about something like this?exec su -s /bin/sh -c 'GOMAXPROCS=
nproc
exec "$0" "$@"' consul -- /opt/consul/bin/consul agent > {{ consul_log_file }} 2>&1I have tested this out and it works as expected on debian/ubuntu (with
upstart) but I am not sure about rhel/centos.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#182 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFhjgGYz6t67qGR8woNmbhiaMtdKx1Jks5q-HN7gaJpZM4Kwzhr
.
from ansible-consul.
I just checked and I can confirm owner/g is consul:consul so it seems it is something else... Can you check if stopping/restarting upstart service works as expected? If I try to restart it I get stop: Unknown instance:
. So the issue is that service doesn't stop and restarting fails due to address already in use error.
Please check following log file: /var/log/upstart/consul.log
With your script I get following entries:
/opt/consul/bin/consul: 1: /opt/consul/bin/consul: cannot create 1: Permission denied
from ansible-consul.
What about this:
exec su -s /bin/sh -c 'GOMAXPROCS=
nprocexec "$0" "$@" > /var/log/consul 2>&1' consul -- /opt/consul/bin/consul agent
This also works for me.
from ansible-consul.
The only difference is it would totally wipe out the log each restart since
you are not appending. We could touch and chown the log before we su to be
sure in case permissions are a problem in some context.
Restarts are a different issue but I don't think it worked under sudo
either.
On Tuesday, November 15, 2016, Jure Žvelc [email protected] wrote:
What about this:
exec su -s /bin/sh -c 'GOMAXPROCS=nprocexec "$0" "$@" > /var/log/consul
2>&1' consul -- /opt/consul/bin/consul agentThis also works for me.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#182 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFhjpQ_3w4n2MU8fSt9Bavl8hDssbieks5q-WsOgaJpZM4Kwzhr
.
from ansible-consul.
Related Issues (20)
- SELinux check fails HOT 3
- Ansible Galaxy still points version 1.3 as latest release HOT 1
- How to make it work in Ubuntu? HOT 1
- Doesnt work in centos 6 HOT 2
- vagrant machine not existing
- consul_advertise_address_wan should be an address, not a boolean
- fails on ubuntu 14, setcap command not found
- consul service fails to see a running consul 0.7.1 server in Ubuntu HOT 1
- Getting error while running testcase via kitchen
- retry_join_ec2 configuration settings missing HOT 1
- Failed to validate the SSL certificate for releases.hashicorp.com:443 HOT 1
- Multiple Environments Isolation
- `consul config file` step in `install.yml` is not idempotent
- nginx default site not disabled
- Problem with envconsul timeouts due to consul long-polling
- Only update apt cache if required
- [Request] add more role maintainers ... or gather community for a more lively fork HOT 3
- Run web UI using `-ui` and remove dependency on nginx
- /etc/consul.conf not accepted by new consul HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-consul.