Code Monkey home page Code Monkey logo

Comments (3)

gdraheim avatar gdraheim commented on September 25, 2024
> systemctl show postgresql.service
INFO:systemctl:EXEC BEGIN /usr/bin/systemctl show postgresql.service --system
INFO:systemctl:try read unit postgresql.service
Id=postgresql.service
Names=postgresql.service
Description=PostgreSQL database server
MainPID=0
SubState=dead
ActiveState=inactive
LoadState=loaded
UnitFileState=disabled
TimeoutStartUSec=3min 20s
TimeoutStopUSec=3min 20s
Environment=PGPORT=5432 PGDATA=/var/lib/pgsql/data

> systemctl show postgresql.service -p Environment
INFO:systemctl:EXEC BEGIN /usr/bin/systemctl show postgresql.service --system
INFO:systemctl:try read unit postgresql.service
Environment=PGPORT=5432 PGDATA=/var/lib/pgsql/data

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 25, 2024

Checking into the execution of postgresql-setup

+ systemctl show -p Environment postgresql.service
Traceback (most recent call last):
  File "/usr/bin/systemctl", line 4155, in <module>
    loggfile = logging.FileHandler(_systemctl_extra_log)
  File "/usr/lib64/python2.7/logging/__init__.py", line 902, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python2.7/logging/__init__.py", line 925, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/var/log/systemctl.log'

actually, we can find that the command will restart itself as the postgres-user when it finds to be root.

if test "$(id -u)" -eq 0; then
    exec $SU -s /bin/sh postgres -c "$cmd"
fi
test "$(id -u)" -eq 0 && exit 1

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on September 25, 2024

So as a workaround, the centar /var/log file is only written when writable. Most people doing some docker deployment will have the logfile owned by root and world non-writable, so you can not see any debug log lines in there - atleast for programs like postgresql show do the switch-user themselves.

Anyone who do still want to see debug logs, will have to switch the ownership of the log file or to make it word writable.

from docker-systemctl-replacement.

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.