Bug 1450315 - passenger-status can't find running mod_passenger instance due to PrivateTmp
Summary: passenger-status can't find running mod_passenger instance due to PrivateTmp
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: passenger
Version: epel7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dennis Chen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-12 08:57 UTC by Dominic Cleal
Modified: 2024-07-09 02:05 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1450295
Environment:
Last Closed: 2024-07-09 02:05:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
dist-git (epel7) patch: change temp directory to /run/passenger (5.25 KB, patch)
2017-05-12 09:30 UTC, Dominic Cleal
no flags Details | Diff
Patch to allow passenger-status to look into privatetmp dirs if run as root (1.08 KB, text/plain)
2017-09-13 15:11 UTC, Klaas Demter
no flags Details

Description Dominic Cleal 2017-05-12 08:57:47 UTC
Same issue on EPEL7, but the module doesn't have PassengerInstanceRegistryDir support.

+++ This bug was initially created as a clone of Bug #1450295 +++

Description of problem:
passenger-status is unable to read status information from mod_passenger, as httpd is configured to use systemd's PrivateTmp feature, limiting access to the status directory for external processes.

mod_passenger should have the PassengerInstanceRegistryDir directive set by default, pointing to /run/passenger-instreg so mod_passenger stores its status files in a world-accessible directory.

Version-Release number of selected component (if applicable):
mod_passenger-5.0.30-3.fc26.x86_64
httpd-2.4.25-7.fc27.x86_64
systemd-233-2.fc27.x86_64

How reproducible:
Always

Steps to Reproduce:
1. run: dnf install mod_passenger
2. Add a Passenger app to Apache (e.g. point DocumentRoot at one)
3. run: passenger-status

Actual results:

# passenger-status
ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it is running, then the causes of this problem could be:

1. You customized the instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument. If so, please set the environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory and run passenger-status again.
2. The instance directory has been removed by an operating system background service. Please set a different instance registry directory using Apache's PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir option, or Phusion Passenger Standalone's --instance-registry-dir command line argument.


Expected results:
# passenger-status
Version : 5.0.30
Date    : 2017-05-12 07:52:37 +0000
Instance: CDWNqcuz (Apache/2.4.25 (Fedora) Phusion_Passenger/5.0.30)

----------- General information -----------
Max pool size : 6
App groups    : 1
Processes     : 1
Requests in top-level queue : 0

----------- Application groups -----------
/var/www/html:
  App root: /var/www/html
  Requests in queue: 0
  * PID: 4498    Sessions: 0       Processed: 16      Uptime: 18h 16m 57s
    CPU: 0%      Memory  : 17M     Last used: 18m 43s


Additional info:
PrivateTmp is set on httpd.service, so the default /tmp status directory is unreadable for passenger-status:

# ls -l /tmp/systemd-private-*-httpd.service-*/tmp/passenger*                      
total 28
drwxr-xr-x. 2 root root 4096 May 12 07:52 agents.s
drwx-wx-wt. 2 root root 4096 May 12 07:52 apps.s
-rw-r--r--. 1 root root    5 May 12 07:52 core.pid
-rw-r--r--. 1 root root    0 May 12 07:52 creation_finalized
-rw-------. 1 root root   24 May 12 07:52 full_admin_password.txt
-rw-r--r--. 1 root root    0 May 12 07:52 lock
-rw-r--r--. 1 root root  311 May 12 07:52 properties.json
-rw-------. 1 root root   24 May 12 07:52 read_only_admin_password.txt
-rw-r--r--. 1 root root    5 May 12 07:52 watchdog.pid

mod_passenger has a PassengerInstanceRegistryDir directive that should be set to /run/passenger-instreg in the default module config file, so status files are stored in a public directory.

/var/run/instreg is a default search directory for passenger-status: https://github.com/phusion/passenger/blob/stable-5.1/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb#L95-L97.

--- Additional comment from Dominic Cleal on 2017-05-12 04:27 EDT ---

Patch against dist-git's master branch added.

Comment 1 Dominic Cleal 2017-05-12 09:30:41 UTC
Created attachment 1278114 [details]
dist-git (epel7) patch: change temp directory to /run/passenger

Comment 2 Dominic Cleal 2017-05-12 09:32:00 UTC
I added a dist-git patch in comment #1 that patches the default /tmp directory over to /run/passenger so the passenger-status command can find the mod_passenger data, as this isn't configurable in 4.0.53.

Comment 3 Klaas Demter 2017-09-13 15:11:47 UTC
Created attachment 1325502 [details]
Patch to allow passenger-status to look into privatetmp dirs if run as root

if you don't want to integrate dominics patch maybe we could solve it a little simpler by patching the command to look inside the privatetmp dirs.

Comment 4 Troy Dawson 2024-07-09 02:05:04 UTC
EPEL 7 entered end-of-life (EOL) status on 2024-06-30.\n\nEPEL 7 is no longer maintained, which means that it\nwill not receive any further security or bug fix updates.\n As a result we are closing this bug.


Note You need to log in before you can comment on or make changes to this bug.