Commit graph

68 commits

Author SHA1 Message Date
Matt Martz
c7845456a6 Various simple linting type cleanups on modules 2016-02-16 15:58:44 -06:00
Brian Coca
827b9596da service goes back to failing when absent
if no tools and no init script, this should always fail
2015-12-17 12:55:43 -05:00
Brian Coca
4072bc1da0 rearranged systemd check, removed redundant systemctl check
fixed unused cmd and state var assignements
2015-10-23 18:59:05 -04:00
Simon Hafner
6233e72001 added earlier paths to systemd
2b583ce657
b925e72633
2015-10-24 00:20:59 +02:00
Simon Hafner
e65c0f896a simpler way to check if systemd is the init system
According to
http://www.freedesktop.org/software/systemd/man/sd_booted.html
check if the directory /run/systemd/system/ exists.
2015-10-22 22:26:51 +02:00
Brian Coca
f6bbd2ac5b removed syslog in favor of common module logging functions 2015-10-01 00:13:58 -04:00
Brian Coca
3e42527fde revert must_exist 2015-10-01 00:13:58 -04:00
Brian Coca
e278f285aa partially reverted previous change to deal with systemctl show status not returning errors on missing service
Now it looks for not-found key instead of running status which does return error codes when service is present but in diff states.
fixes #12216
2015-09-02 17:11:30 -04:00
Brian Coca
bbcfb1092a check systemctl status before show as show will not return antyhing other than rc=0 even when it fails. 2015-09-01 10:58:15 -04:00
Brian Coca
5d7cb981d3 made continue into a pass (there was no loop) 2015-08-13 10:05:30 -04:00
Brian Coca
cd0a1947c2 Merge pull request #1899 from austinhyde/fix-service-rcconf-newlines
Service module incorrectly handles lines not ending in a newline
2015-08-12 19:34:34 -04:00
Brian Coca
7a2687178e avoid shlex exceptions in rc parsing (happens with multiline entries)
fixes #1898
2015-08-12 18:10:24 -04:00
Evgeny Vereshchagin
55e8863cb4 Fix service.enable on: Debian 8, Ubuntu 15.04
Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751638
See https://github.com/systemd/systemd/issues/937
2015-08-12 14:13:19 +00:00
Austin Hyde
5c25057868 Always end rc.conf entries with a new line 2015-08-10 17:42:26 -04:00
James Cammarata
bc60c893f5 Prefer non-zero rc's over text analyis in service status checks
Fixes ansible/ansible#10441
2015-07-27 12:51:30 -04:00
KIKUCHI Koichiro
a3b9fb58bf Fix service enabled check failure on FreeBSD 2015-07-24 21:05:16 +09:00
Brian Coca
03d4805074 Merge pull request #1279 from no2a/devel
Not use "is" to compare strings
2015-07-04 16:00:05 -04:00
Greg DeKoenigsberg
2a5f0bde87 Proper author info for all remaining modules 2015-06-15 15:53:30 -04:00
Brian Coca
9acc7c402f Revert "added innitial daemon-reloaded support to service module"
This reverts commit 438d87d269.
2015-06-10 12:53:34 -04:00
Brian Coca
438d87d269 added innitial daemon-reloaded support to service module 2015-06-08 20:12:30 -04:00
Patrik Lundin
fb41bdfc1e service: Fix comments in OpenBsdService class.
No functional change.
2015-05-27 08:05:30 +02:00
Brian Coca
d02ef57815 minor doc fix 2015-05-26 13:43:29 -04:00
Brian Coca
0c9dd0e6a4 Merge pull request #751 from j2sol/service_must_exist
Add service option to avoid failure on missing service
2015-05-26 13:39:08 -04:00
Jonathan Mainguy
442b6a2067 fixes check mode for Ubuntu 14.04 2015-05-22 21:28:36 -04:00
Semyon Deviatkin
4e22a8039c Fix unused variable systemd_enabled
Removed declared but unused variable systemd_enabled
2015-05-15 11:36:04 +03:00
Arata Notsu
fff29f049e Not use "is" to compare strings
As "is" tests whether if operands are the same object rather than
they have the same value, potentially causes a wrong result.
2015-05-08 01:53:13 +09:00
James Cammarata
c4f6e63117 Fix bug in service where upstart services incorrectly use init scripts
Fixes #1170
2015-05-04 14:03:05 -05:00
Brian Coca
727c9131c8 Merge pull request #1138 from bcoca/service_fix
simplified bad if chain
2015-04-14 14:04:28 -04:00
Brian Coca
f1d72ea004 simplified bad if chain
hopefully fixes #1136
2015-04-14 13:54:42 -04:00
Brian Coca
61f664bc47 Merge pull request #251 from davidfritzsche/patch-1
Add working status detection for pf on FreeBSD
i'm going to merge this to give you a usable workaround, still I consider this a bug in the init script.
2015-04-13 12:36:13 -04:00
David Wittman
8d53ef2f60 [service] Fix bug with upstart detection
Upstart scripts are being incorrectly identified as SysV init scripts
due to a logic error in the `service` module.

Because upstart uses multiple commands (`/sbin/start`, `/sbin/stop`,
etc.) for managing service state, the codepath for upstart sets
`self.svc_cmd` to an empty string on line 451.

Empty strings are considered a non-truthy value in Python, so
conditionals which are checking the state of `self.svc_cmd` should
explicitly compare it to `None` to avoid overlooking the fact that
the service may be controlled by an upstart script.
2015-03-25 17:37:18 -05:00
Toshio Kuratomi
939ecd33d4 In service_enable, the default of changed is True so we have to set it
to False explicitly if it is False.

Fixes #875
2015-03-03 11:23:35 -08:00
Brian Coca
1bca815d37 Merge pull request #95 from Gamevy/use-insserv
Use insserv where available
2015-02-16 18:52:38 -05:00
Brian Coca
ed8154bdc7 Merge pull request #759 from jonhadfield/systemd_enabled_check
use is-enabled to check systemd service status.
2015-02-16 12:29:44 -05:00
Dagobert Michelsen
1f2ffb3900 Solaris SMF is already supported and should be mentioned in the docs, 2015-02-12 17:04:31 +01:00
Brian Coca
b82055f021 Merge pull request #648 from bcoca/service_fix_update-rc.d
simplified update-rc.d enable/disable handling,
2015-02-11 21:05:25 -05:00
Jon Hadfield
b20b29bd17 use is-enabled to check systemd service status. 2015-02-08 18:15:15 +00:00
Jesse Keating
cf0e8d62d2 Add service option to avoid failure on missing service
This adds a must_exist option to the service module, which gives callers the
ability to be tolerant to services that do not exist. This allows for
opportunistic manipulation of a list of services if they happen to exist on the
host. While failed_when could be used, it's difficult to track all the
different error strings that might come from various service tools regarding a
missing service.
2015-02-05 15:23:35 -08:00
Graham Hay
17c7d9c5d5 Use insserv where available 2015-02-04 12:24:56 +00:00
Jonathan Armani
645e0653a3 Merge branch 'devel' into openbsd_rcctl 2015-01-23 13:01:34 +01:00
Toshio Kuratomi
4f1f8e89c9 More information about distutils on Solaris in case we run into this again 2015-01-22 21:55:27 -08:00
Toshio Kuratomi
effdba95de Merge pull request #639 from tgolly/devel
distutils is not available on some non-Linux OS's
2015-01-22 21:49:17 -08:00
Brian Coca
e957150f77 Merge pull request #189 from jarmani/openbsd_rcctl
Openbsd rcctl
2015-01-19 10:12:16 -05:00
Patrik Lundin
e8c328773a Update OpenBSD rcctl handling to use new syntax.
See http://marc.info/?l=openbsd-cvs&m=142054488027109&w=2
2015-01-17 12:04:41 +01:00
Tim G
8f43a0a4fe Load distutils on all platforms EXCEPT Solaris.
Solaris doesn't ship distutils with with the default Python package.  This patch fixes "service" on Solaris since 30d6713.
2015-01-16 10:06:36 +10:00
Brian Coca
9ac5ed2621 now allows for case in which someone removed the K* links and is trying
to reenable a service
2015-01-15 15:53:39 -05:00
Brian Coca
f4a709ad7c simplified update-rc.d enable/disable handling, removed forced defaults
creation as that breaks local customizations
2015-01-15 15:32:19 -05:00
Tim G
68b5b7be72 distutils is not available on some non-Linux OS's 2015-01-14 13:15:38 +10:00
Patrik Lundin
2acfbf016d Handle string returned by 'default' correctly.
We need to handle the string returned by 'default' in the same way we handle
the string returned by 'status' since the resulting flags are compared later.
2014-12-11 23:01:23 +01:00
Brian Coca
aba9e5e4f9 vastly simplified systemd detection, made enable/disable errors clearer
both of which allows us to remove 'service name detection' as if systemd
is init we still use it to handle initscripts.
2014-12-08 08:15:54 -05:00