Have you defined RUN_AS_USER in the karaf-service file to something other than `root`?
This should be very simple to reproduce. I can see the problem on a stock RHEL 7 system after having updated to the 7.7 release packages which were made available in August. I would expect centOS 7.7 to behave the same. systemd appears to be checking the ownership of the PIDFile as listed in the unit file karaf.service and is reporting the unit as failing. Use `systemctl (start|stop) karaf.service` when testing. I do not know for certain if adding the `User=` directive into the unit file is the best solution, but it works in out environment. -Charles ________________________________________ From: Jean-Baptiste Onofré <[email protected]> Sent: Tuesday, October 15, 2019 11:32:23 PM To: [email protected] Subject: Re: Karaf generated systemd unit file failure with RHEL 7.7 I think I don't get it as it works fine for me on VM. What change are you proposing ? Remove RUN_AS_USER from bin/karaf-service ? Regards JB On 15/10/2019 23:52, Charles A Slivkoff wrote: > I just confirmed. Karaf 4.2.7 behaves the same. > > I worked around this issue by using the unit file `User=` directive in the > `[Service]` block of bin/karaf.service. > > https://askubuntu.com/questions/676007/how-do-i-make-my-systemd-service-run-via-specific-user-and-start-on-boot > > I don't believe that the RUN_AS_USER is needed in bin/karaf-service. > > This works for Karaf 4.2.7 as well as ServiceMix 7.0.1 which is what we have > in production. > ________________________________________ > From: Jean-Baptiste Onofré <[email protected]> > Sent: Sunday, October 13, 2019 1:54:53 AM > To: [email protected] > Subject: Re: Karaf generated systemd unit file failure with RHEL 7.7 > > Hi, > > It seems to work fine for me on new Karaf version (updated wrapper). > > Did you try with new Karaf version (4.2.x) ? > > Regards > JB > > On 10/10/2019 14:34, Charles A Slivkoff wrote: >> Any word on this? >> >> On 10/2/19, 1:40 PM, "Charles A Slivkoff" <[email protected]> wrote: >> >> We are using the Servicemix 7.0.1 download posted >> >> >> http://www.apache.org/dyn/closer.lua/servicemix/servicemix-7/7.0.1/apache-servicemix-7.0.1.zip >> >> From the karaf shell, we execute >> >> feature:install wrapper >> wrapper:install >> >> Then, we edit the $INSTALLDIR/bin/karaf-service file, setting >> RUN_AS_USER to the account we have defined. >> >> Is this what you need? >> ________________________________________ >> From: Jean-Baptiste Onofré <[email protected]> >> Sent: Wednesday, October 2, 2019 1:24:26 PM >> To: [email protected] >> Subject: Re: Karaf generated systemd unit file failure with RHEL 7.7 >> >> Hey, >> >> sorry my previous message didn't reach the mailing list. >> >> What's the Karaf version ? >> >> I didn't have any report AFAIR. >> >> Regards >> JB >> >> On 02/10/2019 17:45, Charles A Slivkoff wrote: >> > Apologies if this has been reported, but I could not find any >> references. >> > >> > The systemd unit file has recently begun being reported as failing >> with the RHEL 7.7 updates. The service does start but systemd thinks it has >> failed. >> > Also, the `systemctl stop karaf.service` action is failing to stop the >> service. >> > >> > Based on the logged messages: >> > >> > Sep 10 18:24:13 ********.andrew.cmu.edu systemd[1]: Starting karaf... >> > Sep 10 18:24:13 ********.andrew.cmu.edu su[63432]: (to esbadmin) root >> on none >> > Sep 10 18:24:13 ********.andrew.cmu.edu karaf-service[63396]: Starting >> karaf... >> > Sep 10 18:24:13 ********.andrew.cmu.edu systemd[1]: New main PID 63464 >> does not belong to service, and PID file is not owned by root. Refusing. >> > Sep 10 18:24:13 ********.andrew.cmu.edu systemd[1]: New main PID 63464 >> does not belong to service, and PID file is not owned by root. Refusing. >> > Sep 10 18:24:13 ********.andrew.cmu.edu systemd[1]: Failed to start >> karaf. >> > Sep 10 18:24:13 ********.andrew.cmu.edu systemd[1]: Unit karaf.service >> entered failed state. >> > Sep 10 18:24:13 ********.andrew.cmu.edu systemd[1]: karaf.service >> failed. >> > >> > My guess is this has to do with RUN_AS_USER in ./bin/karaf-service >> script which is called by the unit file. >> > >> > Is anyone investigating this? >> > >> > Thanks, >> > >> > -Charles >> > >> > >> >> -- >> Jean-Baptiste Onofré >> [email protected] >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> >> > > -- > Jean-Baptiste Onofré > [email protected] > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Jean-Baptiste Onofré [email protected] http://blog.nanthrax.net Talend - http://www.talend.com
