Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Systemd files for mcollective #41

Closed
wants to merge 2 commits into from

5 participants

@traylenator

Use systemd with fedora17.

@ripienaar

Nice, we'd need a ticket over at redmine for this so we can track authorship and CLA signing etc before I can merge this

thanks

@haus haus commented on the diff
ext/redhat/mcollective.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=The Marionette Collective
+After=network.target
+
+[Service]
+Type=forking
@haus Owner
haus added a note

Unless daemonize is set to 1 in server.cfg starting the service with this service file will hang. If the type is set to simple it behaves as expected, even with the default daemonize of 0.

Edit: never mind, server.cfg has daemonize of 1, so this will work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@haus haus commented on the diff
ext/redhat/mcollective.spec
@@ -69,8 +73,12 @@ rm -rf %{buildroot}
%if 0%{?suse_version}
%{__install} -m0755 mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective
%else
+%if 0%{?fedora} >= 17
+%{__install} -m0755 ext/redhat/mcollective.service %{buildroot}%{_unitdir}/mcollective.service
@haus Owner
haus added a note

The standard for services on fedora seem to be 0644, not 0755, probably because they are loaded by systemctl, and not designed to be invoked directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@puppetcla

CLA Signed by traylenator on 2012-03-17 21:00:00 -0700

@ploubser
Owner

Closing since it has been idle for over a year. Feel free to reopen.

@ploubser ploubser closed this
@haus haus referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@haus haus referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@haus haus referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@haus haus referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@haus haus referenced this pull request from a commit in haus/marionette-collective
@haus haus (#17067, #14612, #19319) Templatize and improve the mcollective.spec
Our packaging tools expect to find a redhat spec template in ext/redhat. This
commit copies the current mcollective specfile into an erb file. It also brings
in the work of puppetlabs#41 to
add systemd files for the systemd init system and updates the specfile to use
them on systems with systemd.  Thanks to Steve Traylen (traylenator on github)
for the systemd work included here.
62d8b71
@raphink raphink referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 21, 2012
  1. @traylenator
  2. @traylenator
This page is out of date. Refresh to see the latest.
Showing with 47 additions and 0 deletions.
  1. +14 −0 ext/redhat/mcollective.service
  2. +33 −0 ext/redhat/mcollective.spec
View
14 ext/redhat/mcollective.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=The Marionette Collective
+After=network.target
+
+[Service]
+Type=forking
@haus Owner
haus added a note

Unless daemonize is set to 1 in server.cfg starting the service with this service file will hang. If the type is set to simple it behaves as expected, even with the default daemonize of 0.

Edit: never mind, server.cfg has daemonize of 1, so this will work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+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
View
33 ext/redhat/mcollective.spec
@@ -54,7 +54,11 @@ rm -rf %{buildroot}
%{__install} -d -m0755 %{buildroot}/%{ruby_sitelib}/mcollective
%{__install} -d -m0755 %{buildroot}%{_bindir}
%{__install} -d -m0755 %{buildroot}%{_sbindir}
+%if 0%{?fedora} >= 17
+%{__install} -d -m0755 %{buildroot}%{_unitdir}
+%else
%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/init.d
+%endif
%{__install} -d -m0755 %{buildroot}%{_libexecdir}/mcollective/
%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/mcollective
%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/mcollective/plugin.d
@@ -69,8 +73,12 @@ rm -rf %{buildroot}
%if 0%{?suse_version}
%{__install} -m0755 mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective
%else
+%if 0%{?fedora} >= 17
+%{__install} -m0755 ext/redhat/mcollective.service %{buildroot}%{_unitdir}/mcollective.service
@haus Owner
haus added a note

The standard for services on fedora seem to be 0644, not 0755, probably because they are loaded by systemctl, and not designed to be invoked directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+%else
%{__install} -m0755 ext/redhat/mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective
%endif
+%endif
cp -R lib/* %{buildroot}/%{ruby_sitelib}/
@@ -83,18 +91,39 @@ chmod 0755 %{buildroot}%{_sbindir}/*
rm -rf %{buildroot}
%post
+%if 0%{?fedora} >= 17
+if [ $1 -eq 1 ] ; then
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+%else
/sbin/chkconfig --add mcollective || :
+%endif
%postun
+%if 0%{?fedora} >= 17
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart mcollective.service >/dev/null 2>&1 || :
+fi
+%else
if [ "$1" -ge 1 ]; then
/sbin/service mcollective condrestart &>/dev/null || :
fi
+%endif
%preun
+%if 0%{?fedora} >= 17
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable mcollective.service > /dev/null 2>&1 || :
+ /bin/systemctl stop mcollective.service > /dev/null 2>&1 || :
+fi
+%else
if [ "$1" = 0 ] ; then
/sbin/service mcollective stop > /dev/null 2>&1
/sbin/chkconfig --del mcollective || :
fi
+%endif
%files common
%doc COPYING
@@ -123,7 +152,11 @@ fi
%files
%doc COPYING
%{_sbindir}/mcollectived
+%if 0%{?fedora} >= 17
+%{_unitdir}/mcollective.service
+%else
%{_sysconfdir}/init.d/mcollective
+%endif
%config(noreplace)%{_sysconfdir}/mcollective/server.cfg
%config(noreplace)%{_sysconfdir}/mcollective/facts.yaml
%dir %{_sysconfdir}/mcollective/ssl/clients
Something went wrong with that request. Please try again.