Commit Graph

36 Commits

Author SHA1 Message Date
Ghanshyam Mann a43311b7ef Retire Tripleo: remove repo content
TripleO project is retiring
- https://review.opendev.org/c/openstack/governance/+/905145

this commit remove the content of this project repo

Change-Id: Ic209179b0be9c3746a702ccea2dd35e883e78bee
2024-02-24 11:43:49 -08:00
Gregory Haynes 4c31859fbb Log from upstart console
We are no longer piping our service output to logger, so we should be
logging the stdout via upstart. This is useful for detecting tracebacks
and other info which does not go through python logging.

Change-Id: I5d4abb94ff15f74fd2478e70d0fa4d3bb9c09f2d
2015-01-14 19:50:42 -08:00
Jenkins a39ec21014 Merge "Log directly to syslog from os services" 2015-01-05 17:29:44 +00:00
Gregory Haynes 5fc2040aa5 Log directly to syslog from os services
We currently have a horrible hack for upstart where we run our services
with stdout and stderr piped into logger. There are lots of issues with
this, such as upstart has a hard time knowing which PID to track.
Conveniently, python logging knows how to syslog, so why not just use
that!

This changes the default behaviour of os-svc-daemon to create a python
logging.conf so services log directly to syslog.

This also changes the default upstart respawn limiting to be 2 fails in
10 secs. This is becauce making upstart monitor the actual service
daemon was causing some services to respawn loop due to time it took
them to fail.

Closes-Bug: #1385346

Change-Id: Ibd491881d79160ad1457526d51512f5fc1cf9ea5
2015-01-05 09:28:57 -08:00
Gregory Haynes 57dd108fd0 Deprecate positional args for os-svc-daemon
We advertise supporting passthrough arguments in os-svc-daemon by using
'--' followed by extra params. This does not work if using the
undocumented old-style positional arguments and fixing this is a
non-trivial parsing problem. Lets just deprecate this old behaviour so
we can remove it.

Change-Id: I0e75f7f975325b5f199daf697004628461a20075
2014-12-01 18:20:47 -08:00
Derek Higgins 5b228d2064 Revert "We need to tell upstart to expect the logger fork"
This reverts commit 615c6bb95b.
Using "expect fork" results in hitting a bug causing some service
restarts to hang which in turn is preventing os-refresh-config
from completing.
https://bugs.launchpad.net/upstart/+bug/406397

Change-Id: Ib893b1428e3cac3084d07b4d98c9cb69d60bb3cf
2014-11-13 11:25:31 +00:00
Michael Kerrin 615c6bb95b We need to tell upstart to expect the logger fork
Otherwise upstart doesn't get the correct process id for the service
and in some causes can fail to kill the process during a servcie stop

Change-Id: I138dd2206ed1e511fbabaf43bd3cb1d163c76db4
Closes-bug: #1385346
2014-10-24 16:42:12 +01:00
Gonéri Le Bouder a59e7ea360 systemd: always use /lib/systemd
Debian and Ubuntu use /lib/systemd whereas Fedora usr /usr/lib/systemd as the
default system unit directory. This already leads to conflict when the
debian-systemd is used.

Fedora provides a symbolic link between /lib/systemd and /usr/lib/systemd
to also support /lib/systemd directory. With this patch, we use /lib/systemd
everywhere.

This patch supersedes I413a92284e6a79e7fcdde99c5138bc3ce8e85e80.

Change-Id: I459f7514ab35082d31607968252a9005fa25de2a
See: https://bugs.debian.org/719634
2014-10-17 10:27:28 +02:00
Ryan Brady 49dbaae6df Add initial svc-map support
This patch incorporates the svc-map patch[1] into other
elements by integrating svc-map into the os-svc-install
element.  This patch adds the -a option to select svc-map
instead of the default of map-services.  The -a option
enables a phased transition from map-services to svc-map
usage throughout the rest of the elements.

[1] Id11433ea342aace71a358936a7ca3151ec11d506

Change-Id: I382631746e458f2f8603a7dcf5221a21f4b53255
2014-10-02 10:35:54 -04:00
Jenkins 42f751106c Merge "Log tripleo services to syslog" 2014-08-22 15:48:00 +00:00
Richard Su bd228e4b3a Fix /var/run SELinux file contexts
/var/run/<service> needs to be relabeled with the correct file
contexts. With systemd, these directories are created anew each
boot by /lib/systemd/system/<service>-create-dir.service.
os-svc-daemon was updated to correct the file contexts.

Change-Id: I6487d0726db08912eed3062dfee2552940eadcfb
Closes-Bug: 1346559
2014-08-01 17:12:31 -07:00
Derek Higgins 1ad23b193f Log tripleo services to syslog
Logging to an upstart logfile results in log entries that are not
associated with a timestamp(e.g. os-collect-config). This isn't
consistent with the log files produced in other openstack CI tests
and means we can't index them in logstash (at least consistently
with how the other projects are indexed).

As a result of this we will need to remove the double time stamps that
get produced (by taking them out in each of the services configuration)
and extract the log at the end of CI into per-service files so that we
can selectively index the files we want.

In particular the service that doesn't contain timestamps in all of the
log entries is os-collect-config which is arguably one of the most
important service logs we want indexed. We could simply just divert this
service alone to syslog but doing them all is more consistent with other
distros and how this will presumably work when ubuntu moves to systemd.

Change-Id: Ib8c1fc39d56b2b9c6d8e9b64a868def619aa2f1f
2014-07-03 22:49:17 +01:00
Gonéri Le Bouder 0a71316726 indent using 4 spaces (3/3)
As advised in I072cf8bf6748d0c910fecffdf2282bcc4656d038, code should
use 4 spaces for indentation.
This commit enforces the use of 4 spaces indentation.
In order to simplify the review process, this patch only cover the
following elements:
 - os-apply-config
 - os-collect-config
 - os-refresh-config
 - os-svc-install
 - pacemaker
 - pypi-mirror
 - qpidd
 - rabbitmq-server
 - snmpd
 - stackuser
 - tripleo-cd

Change-Id: I3f365f6a1cd6fd9e56402ad3bd6572192b85d798
2014-05-23 00:32:41 +02:00
Ben Nemec 97f9fbed77 Allow os-svc-daemon to specify dir name with -d option
In some circumstances we need to be able to create a /var/run
directory without actually installing a service.  This behavior
was supported before, but these changes allow the user to specify
the directory name and streamline the process by making -c an
optional parameter instead of requiring a dummy value.  It also
makes this functionality available on upstart-based systems.

The existing uses of -d had to be updated as well to reflect this
new behavior.

Change-Id: I34f33f2290eeefb5be82c0cf5198ae53d34332ce
2014-03-25 13:53:59 -05:00
Dan Prince 848f2b881b Add -i options to os-svc-install/os-svc-daemon...
Update os-svc-install with a new -i option which can be used
to specify the virtualenv directory.

Update os-svc-install with a new -s option which can be used
to enable system-site-packages within the virtualenv. By
default this is disabled (matches virtualenv's default...)
In doing this we remove a hard coded check for the 'nova' service
by making nova use the -s option instead.

Update os-svc-daemon with a new -i option which can be used
to specify the virtualenv directory.

NOTE:
 I used -i for both os-svc-daemon and os-svc-install since it wasn't
 already used and I wanted to make the option the same in both places.

Change-Id: Ief53567711b0153de890d50a28c471b1e5acd56c
2014-03-24 09:55:53 -04:00
James Slagle 8475d117d7 Ability to add *-create-dir service separately
For systemd services, we create 2 services: one for the daemon and one
that creates the run directory under /var/run for the daemon.

For the packaged installs, the daemon service is already provided by the
package, so we need the ability to add just the *-create-dir service.

Some might say that the package should create it's run directory...and
it in fact does. However, we are reconfiguring the services to use
/var/run and the package uses /var/lib. Since /var/run is tmpfs mounted,
we need the *-create-dir services for the packages as well.

Change-Id: If26d9d7da04d3d1d97809db0e21e54dd9f8042ca
2014-02-18 07:49:19 -05:00
Ralf Haferkamp 4175a75c18 Install systemd service files into /usr/lib/
Install systemd service files into a location that will work on Fedora as well
as on openSUSE. Note, that on Fedora /lib is just a symlink to /usr/lib anyway.

Change-Id: If1dcd0d428d36d587fab501d42b0c8689a972e31
2014-02-07 14:30:31 +01:00
Clint Byrum c04d472064 Export OS_SVC_ENABLE_CONTROl in upstart jobs
Without this export os-svc-enable.conf never sees the starting event and
thus never does anything to prevent starting the job.

Change-Id: Ib94c817ce3f2e6c3aada1515beea6e7fb41605af
2013-12-16 07:45:32 -08:00
Clint Byrum a6f86e6ef9 Fix os-svc-daemon missing env in upstart jobs
Recent changes landed to set the environment variable
OS_SVC_ENABLE_CONTROL=1 but the env statement was left out, rendering
the upstart job completely broken as the syntax is now invalid.

Change-Id: I88a7a63304d1fe759067e47e2fab88ee27f91914
2013-12-16 07:43:13 -08:00
Dan Prince bac203b672 Don't enable services in os-svc-install
Now that we call os-svc-enable in the individual elements we
can drop the call here.

With this commit *most* services will no longer autostart on first boot
and will rely on post-configuration scripts in os-refresh-config
to enable services. This should clean up our first boot logs
quite a bit...

Change-Id: Ied3622a5e7fce4c3ac2fbd9a0e513ae877cafc5d
2013-12-12 21:04:47 -05:00
Dan Prince 4e482c192a Enable services with os-svc-enable
Split out the code which enables services to start on boot into
a new os-svc-enable script. This script is currently called by
os-svc-deamon so that services automatically start on first boot
(as is the case with os-svc-install)

The motivation here is to decouple service installation and enabling
so that we can eventually avoid starting services on first boot
until after they are configured. Auto starting services on boot like
we currently do is causing lots of log ERROR messages, etc.

Change-Id: I66d4660c169f5918e924eab1876134891c3a24a1
2013-12-12 10:26:42 -05:00
Derek Higgins 16165ff827 Remove the systemctl daemon-reload commands
These aren't needed during an image build and keep getting
copied each time a new service unit is added.

Change-Id: I498a229b69e78a3eca06bf8691c13157ecd6739d
2013-11-20 09:10:34 +00:00
Roman Podoliaka ac0d6607ec Use dib helper script to determine init system
diskimage-builder provides a helper script + env variable
to determine, which init system is used. We should use them
in elements instead of manual checks after update of raring
cloud images broke "if [ -d /etc/systemd/system ]" test.

Related-Bug: #1251610

Change-Id: I6d27491302ff0c4c6de82d6d60fc80e83fec519e
2013-11-15 18:29:43 +02:00
Steve Baker a269433780 Allow environment be specified for os-svc-install
This creates environment entries in both upstart and systemd files.

Change-Id: I8ac2658fc9bfc376e91944fdbcb8d98632c40718
Related-Bug: #1226310
2013-09-17 09:16:38 -07:00
Lucas Alvares Gomes 01061a1d7d Fix systemd services.
Systemd services should be created at /lib/systemd/system instead of
/etc/systemd/system, once the service is enabled systemd will create a
link from /lib/systemd... to /etc/systemd...

Also systemd services should contain the absolute path to the executables.

Change-Id: I741fe249de8ecc7b2af100ca6cf55c51f86f84b0
2013-06-17 17:49:34 +01:00
Lucas Alvares Gomes 6aa037e390 Remove useless code.
That block of code is useless.

Change-Id: I88c63576a7f32bd6122f98f8f7d12cdf423777f1
2013-06-06 15:16:10 +01:00
Jenkins 6d1c130f88 Merge "Add respawn limit to prevent infinite respawn." 2013-05-21 02:41:24 +00:00
Clint Byrum b969532109 Add post-start option to os-svc-daemon.
We also migrate os-svc-daemon to supporting switches to modify its
behavior and be more flexible as it grows. The old positional style is
still supported but will be deprecated.

Each service will have a unique way to verify that it has started. The
default 'exec sleep 1' will be sufficient for some, but not all. Quantum
is the first example, which can take more than 5 seconds to open a
listening socket.

Due to a lack of knowledge and testing on systemd, it will simply print
out a warning about the issue until we have a better answer.

Change-Id: I8d0e0842dfa66b2e32b942270ed071e593d3865e
2013-05-17 22:26:53 -07:00
Clint Byrum 6d28d4c99c Add respawn limit to prevent infinite respawn.
The respawn count is not incremented until post-start exits, so we
need to set the count lower than the interval to allow for the lag
caused by the one second sleep. Two times in 5 seconds seems like
enough to handle the occasional unexpected crash but stay dead when
things are badly broken.

Change-Id: I8eaca6f9ea131861a42d473ffc5c09a41226ce0e
2013-05-16 20:31:08 -07:00
Clint Byrum 567e8a0599 Avoid race condition with 1 second sleep.
Upstart will return from 'start xxx' immediately upon forking. We still
need to run start-stop-daemon, change users, exec again, and then run
the python code to get to listen() before the service is actually ready.
This all should take < 1s, but the sleep is just a stopgap until we have
a better way to track "is the service ready" in upstart.

Fixes bug #1179766

Change-Id: I3842e572c940e833cb3036b67df0ee71fe5bb129
2013-05-14 15:24:08 -07:00
Lucas Alvares Gomes e61f88c310 Add systemd support for os-svc-daemon.
Change-Id: I04f30db1ff64af383ca605598379e926635cc5e8
2013-04-25 11:55:06 +01:00
Tim Miller 08f27d3556 A self-contained one-node baremetal openstack.
The 'boot-stack' element is a self-contained, baremetal openstack.
Upon first boot, it will initialize itself with default keystone
users, nova flavors, etc.

Change-Id: Ib0c411627154a3d666f74513c6b8edfbfbf6c07e
2013-04-09 07:59:10 -07:00
Clint Byrum a18a5c85ff Do not require arguments for os-svc-daemon.
They are not actually required, so allow os-svc-daemon to be called
without them.

Change-Id: I62c2887d48e4173005c54c9cab4ecd6aff8069a1
2013-04-04 13:05:43 -07:00
Clint Byrum 4762f65dc1 Streamline upstart scripts in os-svc-daemon
Best practice is to use start-stop-daemon rather than sudo, as sudo will
apply user-centric pam limits and create a wtmp entry. Also there is no
need for a script stanza, as we are only execing one command.

Change-Id: I0c2f12536b56d90fd43ab40e74424350efcc0b61
2013-04-03 11:32:17 -07:00
Tim Miller ea57869d3e Run all openstack services in virtualenvs:
Python package dependency conflicts have been observed
to occur for certain combinations of services at certain
revision.

Running all services in virtualenvs removes the issue.

Change-Id: I100817569b43a5af3427b0ae20cebdc7d55d03a5
2013-04-02 18:13:07 -07:00
Tim Miller 6cfd9681b7 Seperate install of services and start scripts:
This allows openstack services to be git/pip installed
without installing any startup scripts.

This is useful for keystone-db or nova-db elements, for
example, where the service must be installed to perform
database migration, but no service start scripts need
be installed.

Additionally, add a tool to create openstack sql databases.

Use openstack pypi mirror:

Use the openstack pypi mirror for openstack service
installation. It's much faster than pypi.org.

Also, pip install $svc_repo/tools/pip-requires first,
if it exists, which is required to pick up oslo.config.

Change-Id: I72751d4da59f8597d20aea2f27a9dfabe2f63a8f
2013-03-07 11:45:41 -08:00