Coder Social home page Coder Social logo

68b32 / php-chroot-bind Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 14.0 3 KB

Setup PHP-FPM chroots automatically. Create systemd unit files to setup chroots on boot.

Home Page: https://www.vennedey.net/resources/3-Secure-webspaces-with-NGINX-PHP-FPM-chroots-and-Lets-Encrypt#chroot_binds

Shell 100.00%

php-chroot-bind's People

Contributors

68b32 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

php-chroot-bind's Issues

php-chroots.target subsequent targets not active

Hi!

Thank you very much for your two very detailed articles and script on how to setup the chroots for PHP. I've been using this in low power ARM devices where I "can't" run docker/lxc/systemd-nspawn due to RAM limitations.

Now, over the years I've noticed a small glitch in the script that I never come around to fix. It appears that whenever I reboot the system php-chroots.target is reached however the subsequent targets aren't usually reached.

After rebooting here is what happened:

root@hostname:~# systemctl status php-chroots.target
● php-chroots.target - Bind all binds for all PHP-FPM chroots
   Loaded: loaded (/etc/systemd/system/php-chroots.target; enabled; vendor preset: enabled)
   Active: active since Sat 2020-11-07 19:20:14 UTC; 37s ago

root@hostname:~# ./web/php-chroot-bind status
Chroot: /mnt/NVME1/web/test_chroot/chroot
        - /usr/share/zoneinfo
        - /dev/urandom
        - /dev/zero
        - /dev/null
        - /etc/resolv.conf
        - /etc/hosts
        - /lib/aarch64-linux-gnu/libnss_dns.so.2
        - /usr/share/ca-certificates
        - /etc/ssl/certs

Now the test_chroot:

root@hostname:~# systemctl status php-chroot-mnt-NVME1-web-test_chroot-chroot.target
● php-chroot-mnt-NVME1-web-test_chroot-chroot.target - Bind all binds for PHP-FPM chroot /mnt/NVME1/web/test_chroot/chroot
   Loaded: loaded (/etc/systemd/system/php-chroot-mnt-NVME1-web-test_chroot-chroot.target; static; vendor preset: enabled)
   Active: inactive (dead)

As you can see php-chroots.target is loaded and active, and then php-chroot-mnt-NVME1-web-test_chroot-chroot.target is inactive.

To fix this, I just need to issue:

systemctl start php-chroots.target

And then all chroots get to work just fine. Any idea why this would be happening? I've also noticed that sometimes some of the other chroots start others don't. It seems random.

OS: Debian 10 / Armbian 20.08.17 Buster with Linux 4.4.213-rk3399

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.