summaryrefslogtreecommitdiff
path: root/lib/chef/provider/service
Commit message (Collapse)AuthorAgeFilesLines
* Fix most Ruby 2.7 test failureslcg/ruby-2.7.0Lamont Granquist2020-01-211-13/+13
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Add chef-utils gem with various recipe DSL helpersLamont Granquist2019-11-088-24/+24
| | | | | | | | | | | | | This is the implementation of [RFC-087](https://github.com/chef-boneyard/chef-rfc/blob/master/rfc087-distro-sugar-helpers.md) although some of the specifics have been iterated on and changed. The documentation will be in the [README.md](https://github.com/chef/chef/tree/master/chef-utils/README.md) once this is merged. While this PR mostly moves chef-sugar utilities into core-chef via this chef-utils gem, the scope of the chef-utils gem should be considered larger than just that. As an example this PR moves the Mash class into this gem for reuse in ohai as well. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix enable on indirect unitsPhil Dibowitz2019-11-041-0/+16
| | | | | | | | | This follows this `is_masked` path to ensure we don't try to enable OR disable systemd units if they are indirect Fixes #9041 Signed-off-by: Phil Dibowitz <phil@ipom.com>
* Update windows_service to ignore run_as_user caseJason Barnett2019-10-101-1/+1
| | | | Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
* fix 4 copsLamont Granquist2019-07-051-1/+2
| | | | | | | | | | | | | | - Layout/MultilineMethodCallBraceLayout - Layout/ClosingParenthesisIndentation - Layout/IndentFirstArgument EnforcedStyle: consistent - Layout/BlockEndNewline the first of these autocorrected to horrible looking code which exposed that we really needed the other three as well, which also cleaned up a bunch of other terrible looking code. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/SymbolProcLamont Granquist2019-07-051-1/+1
| | | | | | enforce pretzels. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/StringLiteralsInInterpolationLamont Granquist2019-07-053-5/+5
| | | | | | since we use double quotes, be consistent everywhere. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/RegexpLiteralLamont Granquist2019-07-054-5/+5
| | | | | | | given how many regexps we have with /'s in the match this seems like a very good one. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/NegatedIfLamont Granquist2019-07-052-6/+6
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/EmptyMethodLamont Granquist2019-07-021-2/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* tweak Lint/BlockAlignmentLamont Granquist2019-07-022-11/+11
| | | | | | | | | | | | | | | Lint/BlockAlignment: Enabled: true EnforcedStyleAlignWith: start_of_block this works better with Layout/MultilineMethodCallIndentation to force indentation of multiline method calls that wind up with multiline blocks. i'd probably pull back the end to match with the start of the expression but this gets the indentation level inside the block correct. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/EmptyLineAfterGuardClauseLamont Granquist2019-07-025-0/+5
| | | | | | | i like this one, gives visual priority to returns or raises that are buried in the middle of things. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/AlignArgumentslcg/new-chefstyleLamont Granquist2019-07-021-3/+3
| | | | | | | | | | | | | | this is using: Layout/AlignArguments: Enabled: true EnforcedStyle: with_fixed_indentation the default style can use really excessive whitespace. on starting lines which are already long, it fully indents across to where the arguments start and then begins the line there. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Target mode for systemd service helperLamont Granquist2019-05-291-1/+2
| | | | | | | | | | Makes it so that local cookbook can bounce a remote service over train/ssh/whatever. Works at least for ubuntu. Introduces a fairly rudimentary TrainHelpers class, using some inspiration from ohbye. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix service enable idempotency in sles11 (#8256)dheerajd-msys2019-05-231-1/+3
| | | | | | * fix service enable idempotency in sles11 Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
* This hits the ones that are most frequently required.lcg/require-idempotencyLamont Granquist2019-05-202-3/+3
| | | | | | | | | Stops the kernel from scanning through all the activated gems every time in order to resolve names into pathnames. See rubygems/rubygems#2762 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix a bunch of weirdly mangled require linesLamont Granquist2019-05-083-3/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Convert require to require_relativeLamont Granquist2019-05-0817-34/+34
| | | | | | | This gives a speed boost since rubygems does not have to scan through every gem in the gemset in order to find the file. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Prevent accidentally configuring windows_service propertiesJason Barnett2019-04-151-14/+4
| | | | Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
* Fixes #8195Jason Barnett2019-03-271-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as Indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
* Fix #8080Jason Barnett2019-03-081-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as Indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
* changes for rubocop engine upgrades.lcg/rubocop-upgradesLamont Granquist2019-01-154-6/+6
| | | | | | | this is the result of changes to rules we already previously had enabled. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Remove potentially sensitive info from the logsp/fix-7634Stuart Preston2018-09-181-1/+1
| | | | Signed-off-by: Stuart Preston <stuart@chef.io>
* stop parsing init script at the "### END INIT INFO" marker.Guido Schoening2018-08-041-1/+1
| | | | Signed-off-by: Guido Schoening <guido.schoeing@gmail.com>
* fix Style/MutableConstantLamont Granquist2018-07-022-13/+13
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/PreferredHashMethodsLamont Granquist2018-07-021-1/+1
| | | | | | | absolutely hard requirement on the fixes that went into chef-config 2.2.11, so the floor of that gem is bumped up. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix some Style/StringLiterals introduced by the UnneededInterpolationLamont Granquist2018-07-021-1/+1
| | | | | | cop Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/UnneededInterpolationLamont Granquist2018-07-021-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/LeadingCommentSpaceLamont Granquist2018-07-021-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/HashSyntaxLamont Granquist2018-07-024-6/+6
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Unification of shell_out APIsLamont Granquist2018-06-151-0/+1
| | | | | | | converts all usage to just shell_out() from the numerous helper utilities that we've had previously. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #7297 from jasonwbarnett/fix-windows-startupTim Smith2018-06-031-0/+2
|\ | | | | Fix :configure_startup action to configure delayed start
| * Fix :configure_startup action to configure delayed startJason Barnett2018-05-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as Indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
* | convert shell_out_with_systems_locale to `default_env: true`lcg/remove-shell-out-with-systems-localeLamont Granquist2018-05-306-31/+32
|/ | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix systemd_unit user property usageMal Graty2018-05-191-1/+1
| | | | | | | Use Etc.getpwnam rather than Etc.getpwuid, since getpwuid expects a UID and the resource provides a string. Signed-off-by: Mal Graty <mal.graty@googlemail.com>
* [Debian/Ubuntu] Detect init script service levelstm/ub_1404_serviceThom May2018-04-231-14/+31
| | | | | | | | | | Debian removed the no-op flag from update-rc.d, and so we're now unlinking services rather than just querying them. Just parsing the scripts ourselves is much safer. Fixes: #7119 Signed-off-by: Thom May <thom@chef.io>
* Avoid lookups for rights of 'LocalSystem' in windows serviceBryan McLellan2018-03-291-1/+2
| | | | | | | | | | LocalSystem is a special account for the service subsystem, and the security subsystem doesn't know about it. It inherits rights from BUILTIN\Administrators so we don't need to check it for SeServiceLogonRight. Even if we look up System it wouldn't show up as it gets that right from hidden membership in BUILTIN\Administrators. Signed-off-by: Bryan McLellan <btm@loftninjas.org>
* mechanical conversion of most debug log statements to traceThom May2018-03-2611-67/+67
| | | | Signed-off-by: Thom May <thom@chef.io>
* Remove platfom restrictions in provides and don't require providersTim Smith2018-03-072-2/+2
| | | | | | Don't require providers in the resources since we map these automatically. Also remove or simplify the platform restrictions in the provides lines in the resources. We're not really getting anything from these the way we wire up resources. Signed-off-by: Tim Smith <tsmith@chef.io>
* Chefstyle fixTim Smith2018-03-051-1/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* better docs for Chef::Provider::Service::Upstart.supports?Brad2018-03-051-0/+1
| | | | Signed-off-by: Brad <bradarv90@gmail.com>
* remove callers of passwd ohai plugintm/disable_chatty_ohaiThom May2018-02-071-1/+1
| | | | Signed-off-by: Thom May <thom@chef.io>
* Add description property to converge configure actionJason Barnett2018-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as Indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
* chefstyle -aJason Barnett2018-01-261-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as Indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
* Fix existing tests and add new onesJason Barnett2018-01-261-71/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as Indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
* Add :create, :delete, and :configure actions to the windows_service resourceJason Barnett2018-01-251-11/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as Indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
* Revert "add create and delete actions for windows_service"Lamont Granquist2018-01-221-175/+11
|
* Merge pull request #6595 from ↵Thom May2018-01-221-11/+175
|\ | | | | | | | | jasonwbarnett/feature/add-action_create-to-windows_service add create and delete actions for windows_service
| * add :create, :delete, and :configure actions to the windows_service resource.Jason Barnett2017-11-231-11/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as Indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
* | Remove update-rc.d -n (dryrun) option.Vinson Lee2018-01-021-2/+2
| | | | | | | | | | | | | | | | init-system-helpers 1.50 removed the broken -n (dryrun) option. https://anonscm.debian.org/git/collab-maint/init-system-helpers.git/commit/?id=e0d3d2261c91c5d3dd8a980fcc5244b3b6ce8158 Signed-off-by: Vinson Lee <vlee@freedesktop.org>