Commit Graph

188 Commits

Author SHA1 Message Date
SteelPhase 15406c80f4 Return a better status for "activating" 2020-06-07 11:14:48 -07:00
Daniel Theophanes 095e475882 service: on windows close service handle on status 2020-06-07 11:06:18 -07:00
Daniel Theophanes 5544762d3e service/example/runner: do not check ProcessState as it may be nil
Fixes #218
2020-06-07 11:01:04 -07:00
Daniel Theophanes 2ce04d92a6 service: requrie go1.12 due to aix 2020-06-07 10:46:29 -07:00
Anthony "Ishpeck" Tedjamulia 5ab104476c Fixing systemd complaint that service configurations are world-inaccessible after install 2020-06-07 10:36:36 -07:00
Dean(老路) 3c356ae54c Upstart supports the "restart" option (#193) 2019-12-10 19:17:25 -08:00
chbuescher 7c2e4f75a4 Initial support for aix and solaris (#194)
* initial support for aix and solaris

* support for aix & solaris - missing changes
2019-12-10 19:14:15 -08:00
ANDREY KHASANOV 6b582019e8 Redirect logs to std for mac (#196)
Add support for StandardOutPath and StandardErrorPath for darwin
2019-12-10 19:12:41 -08:00
Rustam 4df36c9fc1 Fix the inability to start with logger in docker contianer (#178)
* check for docker/lxc in isInteractive() for linux

* more clear logic and function name

* add some tests for linux part

* fix test

* cover coverage
2019-10-17 07:57:38 -07:00
Liam Haworth 28e7e9edbb bugfix(unix): Check for and ingore "Operating in progress" (#182)
Added some checking in the stderr reading of `run` in `service_unix` to
identify if the output ended with `Operation now in progress` is the
command was `launchctl`.

If the output has the suffix it is ignored and treated as a non-error,
all other standard error output is treaded as an error like normal.
2019-10-17 07:56:41 -07:00
Rozen Lin fffe6c52ed Support the systemd option setting for 'Restart' and 'SuccessExitStatus (#168)
* support the dependency config for linux systemd

* remote the binary file incorrectly added

* Support the systemd option setting for 'Restart' and 'SuccessExitStatus'
2019-05-14 08:51:56 -07:00
Peter Hommel 61d6d01901 Linux systemd: two small fixes (#171)
* Linux systemd: fixed bug in service configuration template. Dependencies should now work for Linux systemd.

* Linux systemd: enabled detection of systemd inside chroot environments

* Linux systemd: enabled detection of systemd inside chroot environments fix
2019-05-14 08:36:39 -07:00
RozenLin 0e5bec1b9e Systemd/dep (#165)
* support the dependency config for linux systemd

* remote the binary file incorrectly added
2019-03-26 09:10:25 -07:00
Daniel Theophanes 56787a3ea0 remove dep on osext 2019-02-08 09:29:24 -08:00
Harald Nordgren 4c239ee84e Bump Go versions (#153) 2018-11-14 16:55:16 -08:00
SteelPhase b1866cf769 Add ability for service to report the system managing the service (#147)
* Add ability for service to report the system managing the service

* Clarify that the output of SystemName should return the same value as Platform in most cases

* Rename SystemName to Platform to match the rest of the package

* be a little more clear in the Platform comment
2018-09-10 15:42:44 -07:00
Daniel Theophanes 2b860c2dd7 Merge pull request #146 from osleg/fix/windows-reinstall
Fixes reinstall after uninstall with SC
2018-09-10 15:17:54 -07:00
Alex Kir 73cafb2ed3 Fixes reinstall after uninstall with SC
Fix for https://github.com/kardianos/service/issues/125
2018-09-07 15:42:59 +08:00
SteelPhase 8f267d80f2 Potentially resolve issue with os signals (#144)
* change error format

* capture SIGTERM for upstart, ignore SIGKILL

* for windows only notify on SIGINT
2018-08-22 17:15:10 -07:00
SteelPhase 45244176fc Add support for retrieving service status (#143)
* update command execution to support returing error codes, and stdout

add function to service interface to support returning service status

clean up places where strings were being converted to strings

* Spelling fix

* Simply service Status method

Add stopped detection to launchd
Switch to case statements
Return ErrNotInstalled in situations where we should
2018-08-22 11:05:01 -07:00
SteelPhase 4cdeddd6f4 remove debug statements 2018-08-21 09:13:27 -07:00
SteelPhase 4f2cc00692 stdout/stderr isn't supported by all versions of systemd 2018-08-21 09:13:27 -07:00
SteelPhase e5178e50d2 add support for overriding service templates at runtime 2018-08-21 09:13:27 -07:00
SteelPhase 994866c14a add file logging support to systemd 2018-08-20 21:45:52 -07:00
SteelPhase 3bfa85e2d7 use /sbin/initctl to detect upstart 2018-08-20 21:45:14 -07:00
SteelPhase 18492ae499 Remove const/structs that were included in error 2018-08-20 11:44:20 -07:00
SteelPhase 46447978a4 use new versionAtMost function 2018-08-20 11:44:20 -07:00
SteelPhase d1814f7d33 update upstart version check logic 2018-08-20 11:44:20 -07:00
SteelPhase 1166804cbc update upstart script 2018-08-20 11:44:20 -07:00
Alexey Palazhchenko 615a14ed75 Test with latest 1.10.x release
`1.10.x` works now.
2018-03-20 04:59:54 -07:00
Daniel Theophanes 0ab6efe2ea service: use flag package to correctly run su test 2018-03-02 15:11:09 -08:00
Ryan Chipman 1dd765d045 BI-1472: Fix upstart service on 0.6.5 and earlier 2018-03-02 13:07:06 -08:00
itnihao 89346fbade Update service_upstart_linux.go 2018-01-04 09:27:56 -08:00
Alexey Palazhchenko 14a49b39b3 Bump Go versions 2017-11-16 23:05:38 -08:00
Evgeniy Patlan f53685ef76 For does not work on dash
IN case of dash(for example default on wheezy) for operator shold be reworked
2017-09-26 09:47:04 -07:00
Daniel Theophanes f6635a45ec service: add missing imports 2017-05-10 12:40:35 -07:00
SteelPhase a37cd5efa8 Update linux upstart detection to support RHEL6 (#92)
* Update linux upstart detection to support RHEL6

I've added additional detection logic to the isUpstart function, that should validate the existence of upstart on a RHEL 6 system.

* Remove debug message
2017-05-10 05:15:22 -07:00
Simon Backx e173e96a4e Improved launchctl error handling
Start, stop, install and uninstall errors are now passed correctly on Darwin systems
2017-04-03 11:52:49 -07:00
Daniel Theophanes ef06f2f890 service: do not call osext if go1.8+ is used 2017-02-07 11:25:59 -08:00
Daniel Theophanes 6d3a0ee7d3 Merge pull request #80 from jessecarbon/master
Add support for loading environment variables from optional file
2016-11-19 13:06:48 -08:00
Jesse Jarzynka bd219ce2c8 Add support for loading environment variables from optional file 2016-11-08 14:17:29 -05:00
Daniel Theophanes 6a55aece86 Merge pull request #79 from jessecarbon/master
Fix SysV pid_file to be consistent when ran from a differently named symlink
2016-11-03 17:29:35 -07:00
Jesse Jarzynka 03b7b20ce7 Fix SysV pid_file to be consistent when ran from a differently named symlink
SysV init scripts are ran on boot from symlinks in `/etc/rc.d/rc.X`, where
X is the runlevel. These symlinks are usually named something like
`S99foobar`, which is a link to the real script `foobar`. This leads to
differences in the pid_file filename and can lead to multiple processes
running. By using readlink to get the actual destination filename, the
pid_file name should always be consistent.

Resolves: #78
2016-11-03 13:33:19 -04:00
Daniel Theophanes 7a88211485 Merge pull request #70 from jmccarthy/master
working directory also expects cmdEscaping rules introduced in b008df…
2016-08-23 17:03:17 -07:00
Justin McCarthy 6636ccb00f working directory also expects cmdEscaping rules introduced in b008df209b 2016-08-22 11:45:12 -07:00
Daniel Theophanes ca5fc5f6dc Merge pull request #69 from jmccarthy/master
upstart: conditionally set service to run as .UserName variable
2016-08-22 08:56:10 -07:00
Justin McCarthy 58e40a0bfa conditionally set service to run as .UserName variable 2016-08-19 15:45:40 -07:00
Daniel Theophanes 5e33559005 Merge pull request #66 from LawrenceWoodman/improvetest
Improve the TestInstallRunRestartStopRemove test
2016-07-13 06:32:37 -07:00
Lawrence Woodman 9ea6d25b45 Correct formatting in file 2016-07-12 05:46:52 +01:00
Lawrence Woodman 57c4b2b572 Improve testing of Start/Stop/Restart 2016-07-12 05:45:16 +01:00