Feature #2697

add systemd scripts for the OpenNebula init scripts

Added by Jaime Melis over 6 years ago. Updated over 5 years ago.

Status:ClosedStart date:01/30/2014
Priority:NormalDue date:
Assignee:Javi Fontan% Done:

0%

Category:Documentation
Target version:Release 4.12
Resolution:fixed Pull request:

Related issues

Related to Backlog #2351: Make 'one' script optionally ignore locks Pending 10/01/2013
Related to Backlog #2429: Compatibility with heartbeat Pending 11/05/2013
Related to Bug #2866: opennebula starting before mysql in debian based distros Closed 05/05/2014

Associated revisions

Revision 23939000
Added by Javi Fontan almost 6 years ago

feature #2697: add systemd init scripts for CentOS 7

Based on openSUSE systemd scripts by Robert Schweikert

*.service files go in /lib/systemd/system
opennebula.conf goes in /lib/tmpfiles.d

sunstone, oneflow and onegate lose the *.error log files. That information
can be retrieved using systemctl status, for example for sunstone:

systemctl status -l opennebula-sunstone

Revision c2ac8227
Added by Javi Fontan almost 6 years ago

feature #2697: add novnc systemd start script

Revision 5f045785
Added by Javi Fontan almost 6 years ago

feature #2697: add econe systemd script

Revision 5a18ce4f
Added by Javi Fontan almost 6 years ago

feature #2697: update sunstone systemd to start novnc

History

#1 Updated by Jaime Melis over 6 years ago

  • Target version changed from Release 4.6 to Release 4.8

#2 Updated by Jaime Melis over 6 years ago

  • Category changed from Context to Packaging

#3 Updated by Ruben S. Montero about 6 years ago

  • Tracker changed from Feature to Backlog
  • Assignee deleted (Jaime Melis)
  • Priority changed from Normal to High
  • Target version deleted (Release 4.8)

#4 Updated by Ruben S. Montero about 6 years ago

  • Related to Backlog #2351: Make 'one' script optionally ignore locks added

#5 Updated by Ruben S. Montero about 6 years ago

#6 Updated by Ruben S. Montero about 6 years ago

  • Related to Bug #2866: opennebula starting before mysql in debian based distros added

#7 Updated by Ruben S. Montero about 6 years ago

  • Status changed from New to Pending

#8 Updated by Edouard Bourguignon almost 6 years ago

Here is one systemd unit file I'm using for opennebula service:

[Unit]
Description=OpenNebula daemon
After=syslog.target network.target auditd.service

[Service]
Type=forking
User=oneadmin
Group=oneadmin
ExecStart=/usr/bin/one start
ExecStop=/usr/bin/one stop

[Install]
WantedBy=multi-user.target

Not sure if it fix the problem about oned starting before mysqld

#9 Updated by Edouard Bourguignon almost 6 years ago

I forgot, directories /var/run/one and /var/lock/one should be created by the rpm and owned by oneadmin.oneadmin, by specifing those directories in the %files section of the RPM spec file.
Without that the systemd unit I've provided should not work. CF http://fedoraproject.org/wiki/Packaging:Tmpfiles.d

best regards

#10 Updated by Ruben S. Montero almost 6 years ago

  • Tracker changed from Backlog to Feature
  • Target version set to Release 4.12

#11 Updated by Javi Fontan almost 6 years ago

  • Assignee set to Javi Fontan

#12 Updated by Edouard Bourguignon almost 6 years ago

here is my systemd unit files for opennebula with mysql/mariadb on CentOS 7 (fix problem with the opennebula sysvinit scripts where opennebula starts before mysql):

/lib/systemd/system/opennebula.service

[Unit]
Description=OpenNebula daemon
After=syslog.target network.target auditd.service mysqld.service

[Service]
Type=forking
User=oneadmin
Group=oneadmin
PermissionsStartOnly=true
ExecStartPre=-/usr/bin/mkdir /var/run/one
ExecStartPre=-/usr/bin/mkdir /var/lock/one
ExecStartPre=/usr/bin/chown -R oneadmin:oneadmin /var/run/one/
ExecStartPre=/usr/bin/chown -R oneadmin:oneadmin /var/lock/one/
ExecStart=/usr/bin/one start
ExecStop=/usr/bin/one stop

[Install]
WantedBy=multi-user.target

/lib/systemd/system/opennebula-sunstone.service

[Unit]
Description=OpenNebula daemon
After=syslog.target network.target auditd.service opennebula.service

[Service]
Type=forking
User=oneadmin
Group=oneadmin
ExecStart=/usr/bin/sunstone-server start-sunstone
ExecStop=/usr/bin/sunstone-server stop-sunstone

[Install]
WantedBy=multi-user.target

and /lib/systemd/system/opennebula-novnc.service

[Unit]
Description=OpenNebula daemon
After=syslog.target network.target auditd.service opennebula-sunstone.service

[Service]
Type=forking
User=oneadmin
Group=oneadmin
ExecStart=/usr/bin/novnc-server start
ExecStop=/usr/bin/novnc-server stop

[Install]
WantedBy=multi-user.target

Have to do oneflow and onegate service units but it's trivial.

best regards

#13 Updated by Ruben S. Montero almost 6 years ago

  • Status changed from Pending to New

#14 Updated by Jaime Melis over 5 years ago

  • Category changed from Packaging to Documentation
  • Priority changed from High to Normal

Documentation is required

#15 Updated by Javi Fontan over 5 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Added information about new systemd scripts in upgrade guide and CentOS 7 quickstart

Also available in: Atom PDF