Weird proxy/systemd issue

Hey,

I am finishing with discovery image RHEL7 support but I experience weird
issue. Proxy does come up via systemd and then shuts down after few
seconds (let's say 10). It does work properly for the ten seconds.

I wonder if we tested the proxy plugin refactoring on RHEL7 (or Fedora
18). This looks like systemd decides to shut the service down after some
time.

The service type is "forking" and systemd expect PID to be set. I am not
sure if that changed during the refactoring. I noticed that daemon mode
is false by default now, when I turn it on, proxy does not drop the PID
file and systemd fails.

Anyone?

··· -- Later, Lukas #lzap Zapletal

I’ll have to investigate — we are now relying on rack for pid file
population (https://github.com/theforeman/smart-proxy/blob/develop/lib/smart_proxy.rb#L86
and https://github.com/theforeman/smart-proxy/blob/develop/lib/smart_proxy.rb#L109).

-d

··· On Thu, Aug 14, 2014 at 5:17 PM, Lukas Zapletal wrote: > Hey, > > I am finishing with discovery image RHEL7 support but I experience weird > issue. Proxy does come up via systemd and then shuts down after few > seconds (let's say 10). It does work properly for the ten seconds. > > I wonder if we tested the proxy plugin refactoring on RHEL7 (or Fedora > 18). This looks like systemd decides to shut the service down after some > time. > > The service type is "forking" and systemd expect PID to be set. I am not > sure if that changed during the refactoring. I noticed that daemon mode > is false by default now, when I turn it on, proxy does not drop the PID > file and systemd fails. > > Anyone? > > -- > Later, > Lukas #lzap Zapletal > > -- > You received this message because you are subscribed to the Google Groups "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.

It's working OK for me on RHEL 7. This is a VM that's been running for
most of a day:

[root@localhost ~]# systemctl status foreman-proxy
foreman-proxy.service - Foreman Proxy
Loaded: loaded (/usr/lib/systemd/system/foreman-proxy.service; enabled)
Active: active (running) since Thu 2014-08-14 04:49:02 EDT; 22h ago
Process: 4297 ExecStart=/usr/share/foreman-proxy/bin/smart-proxy
(code=exited, status=0/SUCCESS)
Main PID: 4309 (ruby)
CGroup: /system.slice/foreman-proxy.service
└─4309 ruby /usr/share/foreman-proxy/bin/smart-proxy

Aug 14 04:49:01 localhost.localdomain.localdomain systemd[1]: Starting
Foreman Proxy…
Aug 14 04:49:02 localhost.localdomain.localdomain systemd[1]: PID file
/run/foreman-proxy/foreman-proxy.pid not readable (yet?) after start.
Aug 14 04:49:02 localhost.localdomain.localdomain systemd[1]: Started
Foreman Proxy.

Note the journal entry above about the PID file, but it does appear to
have been written OK (since?):

[root@localhost ~]# ll /run/foreman-proxy/foreman-proxy.pid
-rw-r–r--. 1 foreman-proxy foreman-proxy 4 Aug 14 04:49
/run/foreman-proxy/foreman-proxy.pid
[root@localhost ~]# rpm -q rubygem-rack
rubygem-rack-1.4.5-3.el7.noarch

··· On 14/08/14 17:17, Lukas Zapletal wrote: > Hey, > > I am finishing with discovery image RHEL7 support but I experience weird > issue. Proxy does come up via systemd and then shuts down after few > seconds (let's say 10). It does work properly for the ten seconds. > > I wonder if we tested the proxy plugin refactoring on RHEL7 (or Fedora > 18). This looks like systemd decides to shut the service down after some > time. > > The service type is "forking" and systemd expect PID to be set. I am not > sure if that changed during the refactoring. I noticed that daemon mode > is false by default now, when I turn it on, proxy does not drop the PID > file and systemd fails.


Dominic Cleal
Red Hat Engineering

Yeah, I just found that the process was dying because the port was
occupied by another instance. It looks like it is working good. The PID
is dropped, systemd works as expected.

··· -- Later, Lukas #lzap Zapletal