Giter VIP home page Giter VIP logo

Comments (5)

jzvelc avatar jzvelc commented on August 10, 2024

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.

jeremyjh avatar jeremyjh commented on August 10, 2024

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>&1

I 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.

jzvelc avatar jzvelc commented on August 10, 2024

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.

jzvelc avatar jzvelc commented on August 10, 2024

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.

jeremyjh avatar jeremyjh commented on August 10, 2024

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 agent

This 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.