Skip to main content

Now Bald, questioning my life (libraries + env paths)

Comments

4 comments

  • cPRex Jurassic Moderator
    Hey there! By default, I would expect "echo $PATH" to work properly when run as a cPanel user with command line access. Here is what I see on my test machine: [username@host /]$ echo $PATH /usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:/root/bin:/opt/cpanel/composer/bin
    This could indicate a path issue with that user you tested with. It's important to note that cPanel doesn't offer either jpegoptim or optipng as part of our tools, so if they have been installed manually it's possible they may not be available to all users.
    0
  • iamoort
    Thanks for the reply. I did manage to figure out the issue. It appears to be CloudLinux's CageFS feature, which makes sense now since it encapsulates each user. I found that it worked if I disabled CageFS for the user (just popped up in my head as a last-ditch effort to try after a little nudging by CloudLinux). In case anyone else runs into an issue like this; once I found that it started working, I had to create a new file in /etc/cagefs/jpegoptim.cfg with the text: [jpegoptim] comment=jpegoptim paths=/usr/bin/jpegoptim,/usr/local/bin/jpegoptim
    Then restart cagefs: cagefsctl --force-update cagefsctl --remount-all
    Adding that config file allows the library to be executable by all cpanel users.
    0
  • cPRex Jurassic Moderator
    Ah, CageFS - you don't want to know how many times CageFS has tripped me up :D
    0
  • iamoort
    lol it definitely did for me. It was roughly a full day's worth of doing everything under the sun I could think of. I installed two different version of jpegoptim, and the PHP application kept erroring out that it couldn't access it. So I manually ran jpegoptim and it compressed fine, created a small php script to echo the errors, and it kept returning the errors. Printed results to files. Literally anything you could think of, and I was going crazy. Then I opened a ticket with CloudLinux initially asking if there were any special things in the OS that could limit, while I waited I went back to WHM, and just so happened to scroll past the LVE Manager saw CageFS, and a lightbulb kicked on. I disabled Cage on that one user, tested, and it worked immediately. Talk about a frustrating set of events; all to be outsmarted by a single damn toggle switch and a config file with 3 lines. I'll definitely look to CageFS first for any future issues. lol Thanks for the reply though.
    0

Please sign in to leave a comment.