* validate systemctl command
* validate systemctl command
* add rcS support
* only attempt to set environment if list is not empty
* check if service bin exists
* Update XML prolog and DTD
Also converts single-quotes to double-quotes
* Remove whitespace from parent dict
* Only populate EnvironmentVariables when available
* Only add additional arguments when defined
Also cleans up whitespace around each argument
* Cleanup whitespace and only populate when defined
* Convert remaining spaces to tabs
* Sort keys. Similar to `plutil -convert xml1`
Using the service manager from an remote ssh command promt fails
with
`The service process could not connect to the service controller`
Thanks to the detailed analysis from @kelseyma the fix was very straight
forward.
Using IsWindowsService() solved this problem for me.
The mentioned issue at https://github.com/golang/go/issues/44921
has also been fixed in the meantime, so there is no reason not to
use IsWindowsService() instead.
Fixes#300
Doing so will create services that are broken and will fail
when started:
`Error 87: The parameter is incorrect`
This is a regression from https://github.com/kardianos/service/pull/312
* fix for the openrc status func
Signed-off-by: Karen Almog <kalmog@mirantis.com>
* openrc: exitCode parsing for better status
Signed-off-by: Karen Almog <kalmog@mirantis.com>
The library is using inconsistent names when calling `systemctl`
commands.
Let's say that the service is named `name`. The unit file will be
then named `name.service` - this is the popular pattern used also by
this library.
While for most common commands like `systemctl start` there is no
difference whether `name` or `name.service` will be used as the service
identifier, the `list-unit-files` command expects explicitly the unit
file name.
Currently just the name - without the `.service` suffix - is being used,
which causes the command to return no output, not match the name of the
service and finally respond the status of installed but inactive service
as `StatusUnknown` with `ErrNotInstalled` error. While `StatusStopped`
without any error is expected.
Considering `systemctl` behavior it's just easier to:
- have one method that constructs the `name.service` name,
- use it for all `systemctl` commands calls.
And this is the change that this commit is adding.
* Shutdowner interface and Windows trigger
* Updating Shutdown doc
Stop won't be called when Shutdown is.
Co-authored-by: Juan Hernandez <jhernandez@newrelic.com>
* service(windows): added option flag for delayed automatic start
* service(windows): added option flag for delayed automatic start
Co-authored-by: Utkarsh Dixit <utkarsh.dixit@siemens.com>