question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ldap2pg command not found

See original GitHub issue

Basically after following this https://ldap2pg.readthedocs.io/en/latest/install/#pure-python installation process, when I run ldap2pg --version or any other ldap2pg command I get command not found.

I am installing it inside a vagrant vm. I am running a dockerized active directory and postgresql db in a vagrant vm.

Not sure if it helps but here is the vagrantfile:

Vagrant.configure("2") do |config|
    # Install docker-compose plugin
    config.vagrant.plugins = [
        "vagrant-docker-compose",
        "vagrant-vbguest"
    ]

    # Vm box basic configuration
    config.vm.box = "ubuntu/bionic64"
    # Geoserver
    config.vm.network "forwarded_port", guest: 8093, host: 8093
    # Posgis db
    config.vm.network "forwarded_port", guest: 65433, host: 65433
    # Test active directory
    config.vm.network "forwarded_port", guest: 11389, host: 11389

    # Provisioning the vm
    config.vm.provider "virtualbox" do |vb|
        vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
        vb.gui = false
        vb.cpus = 2
        vb.memory = 4096
    end
    config.vm.provision :docker
    config.vm.provision :docker_compose, compose_version: "1.24.1"

    # Active directory
    config.vm.provision :shell,
        keep_color: true,
        privileged: false,
        run: "always",
        inline: <<-SCRIPT
            cd /vagrant/ldap/
            docker-compose up -d
        SCRIPT
    # Geoserver and posgis db
    config.vm.provision :shell,
        keep_color: true,
        privileged: false,
        run: "always",
        inline: <<-SCRIPT
            cd /vagrant/gis_droplet/
            docker-compose up -d
        SCRIPT
end

Regards, Sam

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bersacecommented, Sep 11, 2019

Hi,

Yes, the doc may be subtle, but the prompt is a # instead of $, which mean root shell.

The best option is to use sudo -i to have a clean root environment.

$ sudo -i pip3 install ldap2pg psycopg2-binary

Some people are used to sudo su for that prupose, but -i is enough.

If you want to install as user rather than root, use pip install --user without sudo, and ensure ~/.local/bin is in your PATH.

I think this issue is all about sudo and pip, not ldap2pg, thus I won’t update the installation doc. Would you ?

Thanks for sharing your solution.

0reactions
SamyOteroGlezcommented, Sep 10, 2019

Got it working!!! For some reason, I had to install it as sudo and add the -H tag. $/ sudo -H pip3 install ldap2pg and after that: $/ sudo pip3 install psycopg2-binary

Thanks!!!

I guess this can be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dalibo/ldap2pg: Manage PostgreSQL roles and privileges ...
Grants or revokes privileges statically or from LDAP entries. Dry run, check mode. Logs LDAP searches as ldapsearch(1) commands. Logs every SQL query....
Read more >
ldap2pg - PyPI
Creates static roles from YAML to complete LDAP entries. Manage role members (alias groups). Dry run. Logs LDAP queries as ldapsearch commands.
Read more >
Using ldap2pg K8S CronJob to sync Directory Users/Groups ...
First step, making a ldap tree is no fun. So we borrow helm-openldap with the following overrides. In the overrides, we specify the...
Read more >
EDB Docs - Using EDB LDAP Sync
ldap2pg. Output. Starting ldap2pg 5.7. Using /etc/ldap2pg.yml. ... To manually synchronize credentials, you can run the following command: Toggle Wrap
Read more >
Postgresql -bash: psql: command not found - Stack Overflow
export PATH=/usr/pgsql-9.2/bin:$PATH. The program executable psql is in the directory /usr/pgsql-9.2/bin , and that directory is not ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found