The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Feature #14612

Feature #17067: Redo the packaging of mcollective

systemd files for mcollective.

Added by Steve Traylen over 2 years ago. Updated 10 months ago.

Status:ClosedStart date:05/21/2012
Priority:NormalDue date:
Assignee:R.I. Pienaar% Done:

0%

Category:Packaging
Target version:2.3.3
Keywords:mcollective, systemd, rpm, fedora Affected mCollective version:
Branch:https://github.com/puppetlabs/marionette-collective/pull/41

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket is now tracked at: https://tickets.puppetlabs.com/browse/MCO-44


Description

  • A systemd file for mcollective.
  • A updated .spec file that uses systemd with fedora17.

fedora 17 is due out in few days.

History

#1 Updated by R.I. Pienaar over 2 years ago

  • Assignee set to R.I. Pienaar
  • Target version set to 2.0.x

nice, i will grab the beta and test thank

#2 Updated by R.I. Pienaar over 2 years ago

  • Status changed from Unreviewed to Needs Decision

Trying to test this but with little luck, there seems to be some known issues with the beta and VMWare Fusion so will park this till the next beta or release, hopefully some more luck then.

#3 Updated by Steve Traylen over 2 years ago

Updating from init.d to systemd mid OS on a running system is not well supported, you may want to put of till 18.

#4 Updated by R.I. Pienaar over 2 years ago

yeah I was attempting clean installs from the live media and dvd, no upgrades etc but its crashy during the init process

#5 Updated by R.I. Pienaar over 2 years ago

  • Status changed from Needs Decision to Needs More Information

Had some time to look at this now after managing to get fedora happy on my VMWare Fusion.

So we hardcore a requirement on ruby(abi) = 1.8 in the RPM spec file, FC17 of course uses ruby 1.9.3 which means rpms wont build. So we need to either have a special case there for fedora requiring 1.9 or we should just remove the requirement for a specific version abi? I am probably ok with the 2nd option.

Thoughts?

#6 Updated by Steve Traylen over 2 years ago

Have a look at the logic in : http://cern.ch/go/6RWJ in particular this has a case for ruby 1.8, or 1.9.

More genrally this spec file works from epel5 to fedora 18.

Steve.

#7 Updated by R.I. Pienaar over 2 years ago

OK, do you see anything wrong with just saying require ruby(abi) and not tie it to a version? Am worried this kind of thing will spiral out of control while trying to support all sorts of different rpm based repos.

Considering people who might upgrade to ruby 1.9 on rhel5/6. If they choose to do that htey need to rebuild all their stuff and just requiring ruby(abi) means they are a ‘rake rpm’ away from ready vs a nightmare otherwise. I think the goal of this spec file is perhaps different from that in EPEL where its targeted at a 100% known environment

#8 Updated by Matthaus Owens over 2 years ago

ruby(abi) >= 1.8 should do the right thing here and meet the goal of supporting ruby 1.8 and 1.9.

#9 Updated by R.I. Pienaar over 2 years ago

  • Status changed from Needs More Information to Code Insufficient

OK, have built fed17 RPMs with the ABI change and thats all fine.

Something isn’t right with the systemd scripts though…

Start it:

# /bin/systemctl start mcollective.service
# /bin/systemctl is-active mcollective.service
active
# /bin/systemctl  status mcollective.service 
# mcollective.service - The Marionette Collective
      Loaded: loaded (/usr/lib/systemd/system/mcollective.service; disabled)
      Active: active (running) since Fri, 20 Jul 2012 16:44:52 +0100; 20s ago
     Process: 17669 ExecStart=/usr/sbin/mcollectived --config=/etc/mcollective/server.cfg --pidfile=/var/run/mcollective.pid (code=exited, status=0/SUCCESS)
    Main PID: 17677 (ruby)
      CGroup: name=systemd:/system/mcollective.service
          └ 17677 ruby /usr/sbin/mcollectived --config=/etc/mcollective/server.cfg --pidfile=/var/run/mcollective.pid

So far so good, now lets make some bad thing happen to the daemon:

# kill -9 16677
# mcollective.service - The Marionette Collective
      Loaded: loaded (/usr/lib/systemd/system/mcollective.service; disabled)
      Active: active (running) (Result: signal) since Fri, 20 Jul 2012 16:44:52 +0100; 59s ago
     Process: 17669 ExecStart=/usr/sbin/mcollectived --config=/etc/mcollective/server.cfg --pidfile=/var/run/mcollective.pid (code=exited, status=0/SUCCESS)
    Main PID: 17677 (code=killed, signal=KILL)
      CGroup: name=systemd:/system/mcollective.service
# echo $?
0
# /bin/systemctl is-active mcollective.service 
active

It clearly knows the thing is dead – see next to Main PID – but its still reporting it as running so for example puppet wouldnt know to restart this service

If I give some other systemd managed service the same treatment like abrt-oops.service for example then it correctly reports things as dead and returns 3 like it should.

So there’s something not happening that should be happening here.

#10 Updated by Matthaus Owens about 2 years ago

I was able to avoid this problem by combining a daemonize of 0 in /etc/mcollective/server.cfg and Type=simple in mcollective.service. I’m not sure why this is the case, it may be due to how mcollective daemonizes, but i’m not sure.

[Unit]
Description=The Marionette Collective
After=network.target

[Service]
Type=simple
StandardOutput=syslog
StandardError=syslog
ExecStart=/usr/sbin/mcollectived --config=/etc/mcollective/server.cfg --pidfile=/var/run/mcollective.pid
ExecReload=/bin/kill -USR1 $MAINPID
PIDFile=/var/run/mcollective.pid

[Install]
WantedBy=multi-user.target
[root@fc17 ~]# cat /etc/mcollective/server.cfg 
topicprefix = /topic/
main_collective = mcollective
collectives = mcollective
libdir = /usr/libexec/mcollective
logfile = /var/log/mcollective.log
loglevel = info
daemonize = 0
...
[root@fc17 ~]# systemctl start mcollective.service
[root@fc17 ~]# ps -ef | grep mcollective
root      1179     1  5 09:40 ?        00:00:00 ruby /usr/sbin/mcollectived --config=/etc/mcollective/server.cfg --pidfile=/var/run/mcollective.pid
root      1191   775  0 09:40 pts/0    00:00:00 grep --color=auto mcollective
[root@fc17 ~]# kill -9 1179
[root@fc17 ~]# systemctl status mcollective.service
mcollective.service - The Marionette Collective
      Loaded: loaded (/usr/lib/systemd/system/mcollective.service; disabled)
      Active: failed (Result: signal) since Mon, 06 Aug 2012 09:40:56 -0700; 5s ago
     Process: 1179 ExecStart=/usr/sbin/mcollectived --config=/etc/mcollective/server.cfg --pidfile=/var/run/mcollective.pid (code=killed, signal=KILL)
      CGroup: name=systemd:/system/mcollective.service

[root@fc17 ~]# systemctl is-active mcollective.service
failed
[root@fc17 ~]# systemctl stop mcollective.service
[root@fc17 ~]# systemctl is-active mcollective.service
failed

#11 Updated by Matthaus Owens about 2 years ago

I have also opened a bug against systemd in fedora at https://bugzilla.redhat.com/show_bug.cgi?id=846150

#12 Updated by R.I. Pienaar about 2 years ago

  • Parent task set to #17067

#13 Updated by Richard Clamp 10 months ago

  • Status changed from Code Insufficient to Closed
  • Target version changed from 2.0.x to 2.3.3

Also available in: Atom PDF