Commit Graph

232 Commits

Author SHA1 Message Date
Maycon Santos 6f65ca52db remove windows fix 2022-10-11 10:00:08 +02:00
Maycon Santos 20ab3c184e remove windows fix 2022-10-11 09:59:29 +02:00
Maycon Santos edc05e0623 Merge pull request #1 from kardianos/master
sync upstream
2022-10-11 09:56:51 +02:00
Nate Felton f4a4df2b5e Update launchd template (#346)
* 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`
2022-10-10 17:02:22 -05:00
optim-aizawa 645b10f1a8 Add EnvVars to linux init.d (#339)
* change module name

* add init.d env

* add init.d env
2022-10-10 17:00:23 -05:00
Marco Pfatschbacher 380dcf887e Replace deprecated IsAnInteractiveSession() call (#344)
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
2022-10-10 16:59:33 -05:00
Marco Pfatschbacher 6547573c4d Do not create windows services with an empty environment key (#343)
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
2022-10-10 16:56:32 -05:00
Maycon Santos 6ac14ad5ea check if service bin exists 2022-09-05 02:25:24 +02:00
Maycon Santos 56a6ec0818 only attempt to set environment if list is not empty 2022-09-01 18:17:12 +02:00
Maycon Santos 15772f72c0 add rcS support 2022-09-01 16:22:00 +02:00
Maycon Santos e6fe74ca0a validate systemctl command 2022-08-31 17:58:43 +02:00
Maycon Santos 43eac3eb40 validate systemctl command 2022-08-31 17:55:07 +02:00
tomfeigin 29f8c79c51 Windows access service with minimal perms (#313)
When performing actions on a service in a windows host, use the minimal
required permissions to allow non admin users to control the service
2022-04-28 07:57:17 -05:00
tomfeigin abe98a9274 Provide custom log directory for posix (#311)
When running a service with posix, provide a custom path to the
service output
2022-04-28 07:56:17 -05:00
tomfeigin bc65850ac5 Allow setting environment variables for services (#312)
Setting environment variables for services running with systemd, OSx or
windows
2022-04-27 07:11:36 -05:00
tomfeigin ff1da96551 Run systemd commands with --user flag (#310)
When controlling a user service with systemd supply the --user flag
2022-04-27 07:10:17 -05:00
Ali Yousuf ed46af2312 Replace std out/err path to an existing directory (#307) 2022-04-27 07:08:57 -05:00
Marcel Gebhardt 5c08916379 fix: use /etc/rc.d/rc2.d instead of /etc/rc2.d depending on AIX version (#317)
Co-authored-by: Codehardt <marcel.gebhardt@bsk-consulting.de>
2022-01-26 09:11:01 -06:00
chbuescher 6fe2824ee8 aix issue 242: improved test, if process runs as child of srcmstr (#302)
Co-authored-by: xca1075 <Christoph.Buescher@atruvia.de>
2021-11-11 11:20:41 -06:00
Yujie.Zhao b9d1d5b727 fix: sysv linux not support ps $pid (#299) 2021-11-04 11:38:26 -05:00
Karen Almog a323c3813b fix for the openrc status func (#283)
* 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>
2021-07-27 19:15:19 -05:00
Daniel Theophanes 36c9bf8c36 fix windows build 2021-06-15 20:19:51 -05:00
Alex Collins 5f1fed4906 patch the error text to check a syscall number instead (#276) 2021-06-15 14:18:25 -05:00
Daniel Theophanes a8dda22bce fix windows build 2021-06-10 09:36:42 -05:00
Eugene 17a2c7bcb5 Adds service control options for Windows service. (#258)
- StartType               string ("automatic")  - start service. Constants: ServiceStartDisabled, ServiceStartManual, ServiceStartDisabled
- OnFailure               string ("noaction" )  - action to perform on service failure. Constants: OnFailureRestart, OnFailureReboot, OnFailureNoAction
- OnFailureDelayDuration  string ( "1s" )       - delay before restarting the service, time.Duration string.
- OnFailureResetPeriod    int ( 10 )            - reset period for errors, seconds.

Fixes kardianos/service#226
Fixes kardianos/service#207
Fixes kardianos/service#103

Co-authored-by: Eugene <jdevelop@users.noreply.github.com>
Co-authored-by: Daniel Theophanes <kardianos@gmail.com>
2021-06-10 07:11:16 -05:00